Showing 1,050 of 1,372 total issues
Function _render_dir
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _render_dir(self, req, repos, node, rev, order, desc):
Avoid deeply nested control flow statements. Open
Open
if parent != parents[0]:
thread.append([0, col, line])
add_edge(thread, next_revs.index(parent), line + 1)
Function render_property_diff
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def render_property_diff(self, name, old_context, old_props,
Avoid deeply nested control flow statements. Open
Open
if name and name != path_info and 'alias' not in info:
cset_added = tag.code('trac-admin "%s" changeset '
'added "%s" $REV'
% (self.env.path,
pretty_name))
Function get_path_links
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_path_links(href, reponame, path, rev, order=None, desc=None):
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
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,
Function unified_diff
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def unified_diff(fromlines, tolines, context=None, ignore_blank_lines=0,
Function annotate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def annotate(self, row, lineno):
if lineno > len(self.annotations):
row.append(tag.th())
return
rev = self.annotations[lineno-1]
- 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 _render_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _render_file(self, req, context, repos, node, rev=None):
Function _render_zip
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _render_zip(self, req, context, repos, root_node, rev=None):
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:
Avoid deeply nested control flow statements. Open
Open
for chg in c.get_changes():
resource = c.resource.parent.child('source',
chg[0] or '/',
r.id)
if 'FILE_VIEW' not in context.perm(resource):
Avoid deeply nested control flow statements. Open
Open
if ($('em', cells[3]).length) newTag = "\\";
Function get_filtered_hunks
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_filtered_hunks(fromlines, tolines, context=None,
Avoid deeply nested control flow statements. Open
Open
if prev_rev:
prev_href = req.href.changeset(prev_rev, reponame,
prev_path)
else:
Avoid deeply nested control flow statements. Open
Open
if processor != 'comment':
buf.write(' [...]\n')
processor = None
Function render_timeline_event
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def render_timeline_event(self, context, field, event):
wiki_page, comment = event[3]
if field == 'url':
return context.href.wiki(wiki_page.id, version=wiki_page.version)
elif field == 'title':
- 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"