Showing 9,525 of 13,510 total issues
Avoid deeply nested control flow statements. Open
Open
if m: # unquoted value
text = unmatched(m)
value = m.group(1)
value = value.rstrip()
else:
Avoid deeply nested control flow statements. Open
Open
if this in (None, "\n"):
break
continue
Avoid deeply nested control flow statements. Open
Open
if not source.next in FLAGS:
raise error, "unexpected end of pattern"
while source.next in FLAGS:
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, message, category, filename, lineno, file=None,
Avoid deeply nested control flow statements. Open
Open
while 1:
if source.next is None or source.next == ")":
break
sourceget()
if not sourcematch(")"):
Avoid deeply nested control flow statements. Open
Open
if isname(condname):
condgroup = state.groupdict.get(condname)
if condgroup is None:
raise error, "unknown group name"
else:
Avoid deeply nested control flow statements. Open
Open
while source.next in FLAGS:
state.flags = state.flags | FLAGS[sourceget()]
if group:
Avoid deeply nested control flow statements. Open
Open
if char == ")":
break
raise error, "unknown extension"
Function filterwarnings
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def filterwarnings(action, message="", category=Warning, module="", lineno=0,
Function py_encode_basestring_ascii
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def py_encode_basestring_ascii(s):
"""Return an ASCII-only JSON representation of a Python string
"""
if isinstance(s, str) and HAS_UTF8.search(s) is not None:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
Open
if char == "<":
if source.next not in LOOKBEHINDASSERTCHARS:
raise error, "syntax error"
dir = -1 # lookbehind
char = sourceget()
Avoid deeply nested control flow statements. Open
Open
if code1[0] is IN:
code1 = code1[1][0]
setappend(code1)
Avoid deeply nested control flow statements. Open
Open
while source.next in DIGITS:
hi = hi + sourceget()
else:
Avoid deeply nested control flow statements. Open
Open
if not sourcematch(")"):
raise error, "unbalanced parenthesis"
if char == "=":
Avoid deeply nested control flow statements. Open
Open
while 1:
char = sourceget()
if char is None:
raise error, "unterminated name"
if char == ")":
Function _show_warning
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _show_warning(message, category, filename, lineno, file=None, line=None):
Avoid deeply nested control flow statements. Open
Open
if not nl: print
a.dump(level+1); nl = 1
Avoid deeply nested control flow statements. Open
Open
if not sourcematch(")"):
raise error, "unbalanced parenthesis"
continue
Avoid deeply nested control flow statements. Open
Open
if char is None:
raise error, "unexpected end of pattern"
if char == ")":
Avoid deeply nested control flow statements. Open
Open
while 1:
char = sget()
if char is None:
raise error, "unterminated group name"
if char == ">":