functions must have less than 100 lines

Metadata

ID: python-design/function-too-long

Language: Python

Severity: Warning

Category: Best Practices

Description

Function should be short to be easy to understand and maintain. Functions more of 100 lines trigger a warning and should be refactored into smaller units of code.

Arguments

  • max-lines: Maximum number of lines. Default: 100.

Non-Compliant Code Examples

def myfunc():  # function is too long




































































































  pass

Compliant Code Examples

def myfunc():
  pass
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Analysis