facebook pixelCodiga Analysis Python Rules, severity warning
BACK TO LIST

Python rules

The Codiga Static Analysis engine is powered by the best open-source tools to check your Python code. Make sure your code does not have any security issues and follow design and other best practices. Automate your code reviews today and merge with confidence with Codiga.

C0122

Code style
Warning

Check correct use of constants in comparisons.

Learn more

C0123

Best practice
Warning

Using type() instead of isinstance() for a typecheck.

C0200

Best practice
Warning

Consider using enumerate instead of iterating with range and len

C0201

Best practice
Warning

Consider iterating the dictionary directly instead of calling .keys()

C0325

Code style
Warning

Unnecessary parens

C0410

Best practice
Warning

Multiple imports on one line

C0411

Best practice
Warning

Wrong import order

C0415

Best practice
Warning

Import not put at the top level of the file

E0701

Safety
Warning

Bad except clauses order

E1305

Error prone
Warning

Too many arguments for format string

I1101

Error prone
Warning

Variable is accessed for non-existent member of C extension

R0124

Design
Warning

Comparison with same value

R0202

Design
Warning

No classmethod decorator

R0914

Design
Warning

Too many local variables

R0915

Design
Warning

Too many statements, split your functions in smaller functions

R0916

Design
Warning

Too many boolean expressions in if statement

R1702

Design
Warning

Too many nested blocks

R1703

Design
Warning

The if statement can be replaced with a return and a boolean expression

R1705

Design
Warning

Unnecessary else after return

R1716

Design
Warning

Simplify chained comparison between the operands

R1720

Design
Warning

Unnecessary else after raise

R1721

Design
Warning

Unnecessary use of a comprehension

R1723

Design
Warning

Unnecessary elif after break

R1724

Design
Warning

Unnecessary elif after continue

W0107

Design
Warning

Unnecessary pass statement

W0125

Design
Warning

Conditional statement with a constant value

W0129

Error prone
Warning

Assert statement has a string literal as its first argument and the assert will never fail.

W0143

Error prone
Warning

Comparing against a callable (parenthesis needed)

W0150

Design
Warning

return statement in finally block may swallow exception

W0212

Design
Warning

Access to a protected member of a client class

W0222

Design
Warning

Signature is different than in the implemented interface or in an overridden method

W0231

Design
Warning

__init__ method from base class is not called in inherited class

W0232

Code style
Warning

Class has no __init__ method

W0235

Design
Warning

Useless super delegation

W0301

Code style
Warning

Unnecessary semicolon

W0401

Best practice
Warning

Use of wildcard imports

W0404

Best practice
Warning

Module imported twice

W0602

Error prone
Warning

Global variable used but not assigned

W0603

Best practice
Warning

Using the global statement

W0612

Best practice
Warning

Unused variable

W0614

Error prone
Warning

Unused import from another module

W0641

Error prone
Warning

Variable defined but not used

W0642

Design
Warning

Invalid assignment to cls or self

W1113

Design
Warning

Keyword argument before variable positional arguments list

W1114

Design
Warning

Positional arguments appear to be out of order

W1201

Best practice
Warning

Do not use lazy formatting

W1202

Best practice
Warning

Do not use format() in logging function

W1305

Error prone
Warning

Invalid combined format specification

W1306

Best practice
Warning

Missing format attribute

W1308

Best practice
Warning

Duplicate string formatting argument

W1401

Best practice
Warning

Anomalous backslash in string

W1503

Best practice
Warning

Redundant use of unit test assert

W1505

Best practice
Warning

Use of deprecated method

W1506

Best practice
Warning

Thread needs the target function

W1509

Safety
Warning

Using preexec_fn keyword which may be unsafe in the presence of threads

W0238

Error prone
Warning

Unused private member

C0206

Best practice
Warning

Consider iterating with .items()

C0207

Best practice
Warning

Accessing only the first or last element of str.split() and should be done more efficiently.

C1802

Best practice
Warning

Use implicit boolean with len()

C1803

Error prone
Warning

Make use of implicit boolean

C0208

Best practice
Warning

Use a sequence type when iterating over values When iterating over values, sequence types (e.g., lists, tuples, ranges) are more efficient than sets.

R0203

Best practice
Warning

Consider using a decorator instead of calling staticmethod

R1709

Design
Warning

https://vald-phoenix.github.io/pylint-errors/plerr/errors/refactoring/R1709

R1725

Best practice
Warning

Consider using Python 3 style super() without arguments

R1726

Design
Warning

Boolean expression can be simplified

R1728

Performance
Warning

Consider using a generator instead for better performance

R1729

Performance
Warning

Comprehension inside of 'any' or 'all' is unnecessary. A generator would be sufficient and faster.

R1732

Best practice
Warning

Consider using 'with' for resource-allocating operations

R1733

Performance
Warning

Iterating over the dictionary items (key-item pairs) and accessing the value by index lookup when the value can be accessed directly instead

W0177

Best practice
Warning

An expression is compared to NaNvalues like numpy.NaN and float('nan')

W1406

Best practice
Warning

Used when we detect a string with a u prefix. These prefixes were necessary in Python 2 to indicate a string was Unicode, but since Python 3.0 strings are Unicode by default.

W1512

Best practice
Warning

Using deprecated module

W1513

Best practice
Warning

Use deprecated decorator

W1514

Error prone
Warning

Using open without explicitly specifying an encoding

R1730

Error prone
Warning

Use the min builtin instead of using an if condition

W0199

Error prone
Warning

Assert called on a 2-item-tuple.

C2801

Best practice
Warning

Unnecessarily calls dunder method %s. %s.

C3001

Error prone
Warning

Lambda expression assigned to a variable. Define a function using the "def" keyword instead.

W1515

Best practice
Warning

Leaving functions creating breakpoints in production code is not recommended.

R0022

Error prone
Warning

Useless option value.

R1736

Best practice
Warning

Unnecessary list index lookup, use '%s' instead.

W0012

Error prone
Warning

Unknown option value.

W2301

Documentation
Warning

Unnecessary ellipsis constant.

W1518

Best practice
Warning

cache will keep all method args alive indefinitely, including 'self'

E2515

Security
Warning

Invalid unescaped character zero-width-space, use "u200B" instead.

W0130

Best practice
Warning

Duplicate value in set

C2403

Error prone
Warning

Import a module with non-ASCII characters