Rationale behind maximum metrics for "DESIGN" in Pylint

Viewed 281

Pylint has many metrics to ensure that code is readable and not too complex.

[DESIGN]

# Maximum number of arguments for function / method.
max-args=5

# Maximum number of attributes for a class (see R0902).
max-attributes=7

# Maximum number of boolean expressions in an if statement.
max-bool-expr=5

# Maximum number of branch for function / method body.
max-branches=12

# Maximum number of locals for function / method body.
max-locals=15

# Maximum number of parents for a class (see R0901).
max-parents=7

# Maximum number of public methods for a class (see R0904).
max-public-methods=20

# Maximum number of return / yield for function / method body.
max-returns=6

# Maximum number of statements in function / method body.
max-statements=50

# Minimum number of public methods for a class (see R0903).
min-public-methods=2

What is the rationale (or some literature) behind these maximum numbers?

In particular, I would like to know for

  • Maximum number of arguments for function / method (5)
  • Maximum number of branch for function / method body (12)
  • Maximum number of locals for function / method body (15)

Thanks

0 Answers
Related