Showing 1,050 of 1,372 total issues
Function display_html
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def display_html(self, req, query):
# The most recent query is stored in the user session;
orig_list = None
orig_time = datetime_now(utc)
query_time = req.session.as_int('query_time', 0)
Function _insert_ticket_data
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _insert_ticket_data(self, req, ticket, data, author_id, field_changes):
"""Insert ticket data into the template `data`"""
replyto = req.args.get('replyto')
data['replyto'] = replyto
data['version'] = ticket.resource.version
Function appendBatchListControls
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function appendBatchListControls(td, propertyName, inputName) {
var modeSelect = createSelect("batchmod_mode_" + propertyName,
batch_list_modes).attr("id", inputName);
var name1 = "batchmod_primary_" + propertyName;
var name2 = "batchmod_secondary_" + propertyName;
Consider simplifying this complex logical expression. Open
if resource.realm == self.changeset_realm:
parent = resource.parent
return href.changeset(resource.id, parent and parent.id or None)
elif resource.realm == self.source_realm:
parent = resource.parent
Function _from_database
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _from_database(self, id, sid, authenticated, distributor, format,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, section, name, interface, default=None,
Function init_db
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def init_db(self, path, schema=None, log=None, user=None, password=None,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, section, name, default=None, sep=',', keep_empty=False,
Function init_db
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def init_db(self, path, schema=None, log=None, user=None, password=None,
Function preview_data
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def preview_data(self, context, content, length, mimetype, filename,
Consider simplifying this complex logical expression. Open
if not ticket.exists and 'owner' not in updated:
updated['owner'] = self._sub_owner_keyword(ticket['owner'], ticket)
elif ticket['status'] == 'new' and \
'component' in ticket.values and \
'component' in ticket._old and \
Function get_diff_options
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_diff_options(req):
"""Retrieve user preferences for diffs.
:return: ``(style, options, data)`` triple.
- 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_changes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_changes(repos, revs, log=None):
changes = {}
for rev in revs:
if rev in changes:
continue
- 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_link_resolvers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_link_resolvers(self):
def link_resolver(formatter, ns, target, label):
path, query, fragment = split_url_into_path_query_fragment(target)
precision = None
time = path.split("T", 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 _get_authz_info
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _get_authz_info(self):
if not self.authz_file:
self.log.error("The [svn] authz_file configuration option in "
"trac.ini is empty or not defined")
raise ConfigurationError()
- 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 expand_macro
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def expand_macro(self, formatter, name, content):
args, kwargs = parse_args(content)
format = kwargs.get('format', 'compact')
glob = kwargs.get('glob', '*')
order = kwargs.get('order')
- 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 _precise_now_windows
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _precise_now_windows():
"""Provide high-resolution system time if Windows 8+ and Windows
Server 2012+.
"""
import ctypes
- 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 _prepare_rules
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _prepare_rules(self):
from trac.wiki.api import WikiSystem
if not self._compiled_rules:
helpers = []
handlers = {}
- 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 _do_dump
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _do_dump(self, directory, *names):
if not names:
names = ['*']
pages = self.get_wiki_list()
if not os.path.isdir(directory):
- 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 url
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def url(self, ns, target):
"""Return `(url, title)` for the given InterWiki `ns`.
Expand the colon-separated `target` arguments.
"""
- 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"