Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 3.46 KB

README.rst

File metadata and controls

66 lines (47 loc) · 3.46 KB
Root.Smell.MethodSmell Parent Index
Sibling aspects ClassSmell Complexity Naming

MethodSmell

This aspect detects code smells related to methods' and functions definitions in your codebase.

Method-level code smells indicate poorly defined method and or functions (too long method or functions, or functions with too many parameters) in your source code.

Tastes

Taste Meaning Values
max_method_length Represents the max number of lines for a method or a function'sdefinition. 40
max_parameters Represents the max number of parameters for a function's. 10, 5

* bold denotes default value

Subaspects

This aspect does not have any sub aspects.

Example

# This function has way too many parameters

def func(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, z):
    pass

Importance

Make your functions and methods unambiguous, easy to read and debug by reducing the number of parameters and length of your methods and functions.

How to fix this

A fix for this would simply consist of redefining the functions (and or method), making them shorter and reducing the number of parameters (maybe by creating more functions or using libraries).