Showing 1,372 of 1,372 total issues
Function __init__
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, env, report=None, constraints=None, cols=None,
order=None, desc=0, group=None, groupdesc=0, verbose=0,
rows=None, page=None, max=None, format=None):
self.env = env
self.id = report # if not None, it's the corresponding saved query
- 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 _make_lhref_link
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def _make_lhref_link(self, match, fullmatch, rel, ns, target, label):
if not label: # e.g. `[http://target]` or `[wiki:target]`
if target:
if ns and target.startswith('//'): # for `[http://target]`
label = ns + ':' + target # use `http://target`
- 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_diff
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def _render_diff(self, req, page):
if not page.exists:
raise TracError(_("Version %(num)s of page \"%(name)s\" does not "
"exist",
num=req.args.get('version'), name=page.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 _reloader_thread
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def _reloader_thread(modification_callback, loop_callback):
"""When this function is run from the main thread, it will force other
threads to exit when any modules currently loaded change.
:param modification_callback: a function taking a single argument,
- 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 get_mimetype
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def get_mimetype(filename, content=None, mime_map=MIME_MAP,
mime_map_patterns={}):
"""Guess the most probable MIME type of a file with the given name.
`filename` is either a filename (the lookup will then use the suffix)
- 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
File standalone.py
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2023 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
WikiModule
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class WikiModule(Component):
implements(IContentConverter, INavigationContributor,
IPermissionRequestor, IRequestHandler, ITimelineEventProvider,
ISearchSource, ITemplateProvider)
File model.py
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2023 Edgewall Software
# Copyright (C) 2010 Robert Corsaro
# All rights reserved.
File api.py
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2023 Edgewall Software
# Copyright (C) 2003-2005 Daniel Lundin <daniel@edgewall.com>
# Copyright (C) 2005-2006 Emmanuel Blot <emmanuel.blot@free.fr>
Function toggleDir
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.toggleDir = function(expander, qargs, autoexpand) {
var tr = expander.parents("tr:first");
var folderid = tr.get(0).id;
if (expander.hasClass("expanded")) { // then *fold*
Function get_resource_description
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def get_resource_description(self, resource, format=None, **kwargs):
if resource.realm == self.changeset_realm:
parent = resource.parent
reponame = parent and parent.id
id = resource.id
- 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 _format_link
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def _format_link(self, formatter, ns, pagename, label, ignore_missing,
original_label=None):
pagename, query, fragment = formatter.split_link(pagename)
version = None
if '@' in pagename:
- 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 md5crypt
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def md5crypt(password, salt, magic='$1$'):
"""Based on FreeBSD src/lib/libcrypt/crypt.c 1.2
:param password: the plain text password to crypt
:param salt: the raw salt
- 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 __call__
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, *args, **kw):
href = self.base
params = []
def add_param(name, value):
- 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 mime_map
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def mime_map(self):
# Extend default extension to MIME type mappings with configured ones
if not self._mime_map:
self._mime_map = MIME_MAP.copy()
# augment mime_map from `IHTMLPreviewRenderer`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
Function _change_list
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def _change_list(self, old_list, new_list, new_list2, mode):
changed_list = to_list(old_list, self.list_separator_re)
new_list = to_list(new_list, self.list_separator_re)
new_list2 = to_list(new_list2, self.list_separator_re)
- 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 parse_workflow_config
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def parse_workflow_config(rawactions):
"""Given a list of options from [ticket-workflow]"""
required_attrs = {
'oldstates': [],
- 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 _save_ticket_changes
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def _save_ticket_changes(self, req, selected_tickets, new_values, comment,
action):
"""Save changes to tickets."""
valid = True
for manipulator in self.ticket_manipulators:
- 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 get_path_history
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def get_path_history(self, path, rev=None, limit=None):
"""Retrieve creation and deletion events that happened on
given `path`.
"""
path = self.normalize_path(path)
- 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 remove_jinja_exprs
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def remove_jinja_exprs(linenum, line, opened_braces):
"""This probably could be a one-liner... ;-)
"""
idx = 0
line = line.replace('$', '')
- 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"