R0915 too-many-statements

Message

'Too many statements (%s/%s)'

Description

Used when a function or method has too many statements. You should then split it in smaller functions / methods.

Example

For the example, pylint was configured to accept at max five statements (default is 100).

def fn():
    a = 1
    b = 2
    c = 3
    d = a * b + c
    print(d)
1:0: R0915: Too many statements (6/5)

Why bother?

Functions and methods with too many statements are hard to understand.

Running Pylint locally? In your CI?

There is a better way! Run PyCodeQual & get Pylint findings with history, diffs and statistics.

Click here to find out more.