Showing 1,048 of 1,370 total issues
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, category, target, time, author, comment=None,
Function teo_role
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def teo_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
Function extensionpoints_role
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def extensionpoints_role(name, rawtext, text, lineno, inliner, options={},
Function _render_dir
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _render_dir(self, req, repos, node, rev, order, desc):
Function annotate_row
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def annotate_row(self, context, row, lineno, line, blame_annotator):
Avoid deeply nested control flow statements. Open
Open
for line in tolines[j1:j2]:
line = expandtabs(line, tabwidth, '\0\1')
line = escape(line, quotes=False)
line = '<ins>'.join(space_re.sub(htmlify, seg)
for seg in line.split('\0'))
Avoid deeply nested control flow statements. Open
Open
if 'svn:special' in props and data.startswith('link '):
data = data[5:]
kwargs['symlink'] = True
if 'svn:executable' in props:
Function unified_diff
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def unified_diff(fromlines, tolines, context=None, ignore_blank_lines=0,
Avoid deeply nested control flow statements. Open
Open
for line in tolines[j1:j2]:
yield '+' + line
Avoid deeply nested control flow statements. Open
Open
for name in sel:
db_provider.remove_repository(name)
add_notice(req, _('The selected repositories have '
Avoid deeply nested control flow statements. Open
Open
if section[user]:
return True
denied = True
Function get_filtered_hunks
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_filtered_hunks(fromlines, tolines, context=None,
Function get_repositories
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def get_repositories(self):
"""Retrieve repositories specified in the repository DB table."""
repos = {}
for id, name, value in self.env.db_query(
"SELECT id, name, value FROM repository WHERE name IN (%s)"
- 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 'svn:executable' in props:
kwargs['executable'] = True
elif node.isdir and path:
Avoid deeply nested control flow statements. Open
Open
for line in fromlines[i1:i2]:
yield '-' + line
if tag in ('replace', 'insert'):
Avoid deeply nested control flow statements. Open
Open
if 'dir' in changes:
msg = tag_('You should now run %(resync)s to '
'synchronize Trac with the repository.',
resync=resync)
add_notice(req, msg)
Function render_property_diff
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def render_property_diff(self, name, old_node, old_props,
Avoid deeply nested control flow statements. Open
Open
if ($('em', cells[2]).length) oldTag = newTag = "\\";
Function _copy_tables
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _copy_tables(self, dst_env, src_db, dst_db, src_dburi, dst_dburi):
Avoid deeply nested control flow statements. Open
Open
if ($('em', cells[3]).length) newTag = "\\";