C0113
Detect inappropriate use of the not keyword
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.
Detect inappropriate use of the not keyword
Check when valid is compared to True, False or None (and can be replaced by simpler expressions)
Using type() instead of isinstance() for a typecheck.
Detect when a name contains at least one non-ASCII unicode character
Consider using enumerate instead of iterating with range and len
Consider iterating the dictionary directly instead of calling .keys()
Ensure that __slots__ is an iterable and not a base type
Trailing newlines
Multiple imports on one line
Wrong import order
Imports are not grouped
Import and code are mixed
Import alias is same as original package
Import not put at the top level of the file
Consider using tuple unpacking for swapping variables
Consider using str.join() for concatenating strings from an iterable
Consider using dict.get for getting values from a dict if a key is present or a default if not
Use sys.exit()
Use of wildcard imports
Uses of deprecated modules
Module imported twice
Use TODO, not FIXME
Using the global statement
Unused import
Unused variable
Passing multiple incorrect arguments to an exception constructor
Do not use lazy formatting
Do not use format() in logging function
Use %s in logging function
Unused format argument
Missing format attribute
Duplicate string formatting argument
Using an f-string that does not have any interpolated variables
Anomalous backslash in string
Invalid file open mode
Redundant use of unit test assert
Use of deprecated method
Thread needs the target function
Method parameter has a different name than in the implemented interface or in an overridden method
Disallowed name (e.g. foo, bar, etc)
Consider iterating with .items()
Use in instead of iterating over value and using equal
Accessing only the first or last element of str.split() and should be done more efficiently.
Use implicit boolean with len()
Use a sequence type when iterating over values When iterating over values, sequence types (e.g., lists, tuples, ranges) are more efficient than sets.
Consider using a decorator instead of calling staticmethod
Consider using Python 3 style super() without arguments
Using the max builtin instead of a conditional improves readability and conciseness
Consider using 'with' for resource-allocating operations
Using dict() to create an empty dictionary instead of the literal {}. The literal is faster as it avoids an additional function call.
An expression is compared to NaNvalues like numpy.NaN and float('nan')
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.
Using deprecated module
Use deprecated decorator
'await' should be used within an async function
Unnecessarily calls dunder method %s. %s.
Leaving functions creating breakpoints in production code is not recommended.
Contains control characters that can permit obfuscated code executed differently than displayed.
Unnecessary list index lookup, use '%s' instead.
cache will keep all method args alive indefinitely, including 'self'
Duplicate value in set
Using deprecated method
We use cookies to improve your site experience, including analytics cookies to understand how you use our product and design better experiences. Please read our Cookie Policy.