Showing 9,525 of 13,510 total issues
Avoid deeply nested control flow statements. Open
if self.esum == self.rsum:
return '='
else:
return 'U'
elif self.esum == self.rsum:
Function formatline
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def formatline(self, line):
words = []
for word in re.split('(\W+)', line):
if self.iswikiword(word):
if os.path.isfile(self.mkfile(word)):
- 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
Function read
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def read(self, amt=None):
if self._line_consumed:
return self._file.read(amt)
assert self._line_left
if amt is None or amt > self._line_left:
- 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
if name in ("__dict__", "__weakref__"):
continue
# mangled names
elif name.startswith('__') and not name.endswith('__'):
names.append('_%s%s' % (c.__name__, name))
Function docclass
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def docclass(self, object, name=None, mod=None, funcs={}, classes={},
Avoid deeply nested control flow statements. Open
if line == "\n":
after.append(line)
else:
after.append(" " * diff + line)
else:
Function main
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def main():
tree = {}
# Check that the output directory exists
checkopdir(pagedir)
- 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
Function info
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def info(self, name_rev):
"""Return a dictionary of info (from rlog -h) for NAME_REV
The dictionary's keys are the keywords that rlog prints
(e.g. 'head' and its values are the corresponding data
- 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
if ans is None:
ans = self.__namespaces.get(aprefix)
if ans is not None:
Function do_node
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def do_node(self, args):
self.endnode()
self.nodelineno = 0
parts = [s.strip() for s in args.split(',')]
while len(parts) < 4: parts.append('')
- 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
Function findwordend
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def findwordend(str, i, n):
level = 0
while i < n:
mo = fwprog.search(str, i)
if not mo:
- 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
if self.nofill:
self.write('\n')
else:
self.write('<P>\n')
accu = []
Function format_all
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def format_all(self, files, edit=1, headers=1):
sec = 0
for file in files:
try:
entry = self.dir.open(file)
- 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
if k == 2:
#print "CATEGORY",hex(i), old.table[i][k], new.table[i][k]
category_changes[i] = CATEGORY_NAMES.index(value)
elif k == 4:
#print "BIDIR",hex(i), old.table[i][k], new.table[i][k]
Function make_double_frame
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def make_double_frame(master=None, class_=None, name=None, relief=RAISED,
borderwidth=1):
"""Create a pair of frames suitable for 'hosting' a dialog."""
if name:
if class_: frame = Frame(master, class_=class_, name=name)
- 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
Function compile_dir
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def compile_dir(dir, maxlevels=10, ddir=None,
Avoid deeply nested control flow statements. Open
if not compile_dir(arg, maxlevels, ddir,
force, rx, quiet):
success = 0
else:
Avoid deeply nested control flow statements. Open
for t, d, nst in self.stack:
if aprefix in d:
ans = d[aprefix]
if ans is None:
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, source, want, exc_msg=None, lineno=0, indent=0,
Function save_reduce
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def save_reduce(self, func, args, state=None,