Showing 1,050 of 1,372 total issues
PostgreSQLConnection
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class PostgreSQLConnection(ConnectionBase, ConnectionWrapper):
"""Connection wrapper for PostgreSQL."""
poolable = True
File trac.js
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function($){
if (typeof _ == 'undefined')
babel.Translations.load({}).install();
Function pre_process_request
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def pre_process_request(self, req, handler):
if handler is not Chrome(self.env):
for repo_info in self.get_all_repositories().values():
if not as_bool(repo_info.get('sync_per_request')):
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_repositories
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_repositories(self):
"""Retrieve repositories specified in TracIni.
The `[repositories]` section can be used to specify a list
of repositories.
- 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
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def format(self, text, out, max_depth=6, min_depth=1, shorten=True):
self.shorten = shorten
whitespace_indent = ' '
self.outline = []
Formatter.format(self, text)
- 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_link
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _make_link(self, ns, target, match, label, fullmatch):
# first check for an alias defined in trac.ini
ns = self.env.config['intertrac'].get(ns, ns)
if ns in self.wikiparser.link_resolvers:
resolver = self.wikiparser.link_resolvers[ns]
- 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_datetime
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _format_datetime(t, format, tzinfo, locale, hint):
t = to_datetime(t, tzinfo or localtz)
if format == 'iso8601':
return _format_datetime_iso8601(t, 'long', hint)
- 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_date
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def parse_date(text, tzinfo=None, locale=None, hint='date'):
tzinfo = tzinfo or localtz
text = text.strip()
dt = _parse_date_iso8601(text, tzinfo)
- 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 to_datetime
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def to_datetime(t, tzinfo=None):
"""Convert ``t`` into a `datetime` object in the ``tzinfo`` timezone.
If no ``tzinfo`` is given, the local timezone `localtz` will be used.
- 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_relative_resource
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_relative_resource(resource, path=''):
"""Build a Resource relative to a reference resource.
:param path: path leading to another resource within the same realm.
"""
- 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 upgrade_tables
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def upgrade_tables(self, new_schema):
"""Upgrade table schema to `new_schema`, preserving data in
columns that exist in the current schema and `new_schema`.
:param new_schema: tuple or list of `Table` objects
- 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 delete_change
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def delete_change(self, cnum=None, cdate=None, when=None):
"""Delete a ticket change identified by its number or date."""
if cdate is None:
row = self._find_change(cnum)
if not row:
- 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 sql_sub_vars
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def sql_sub_vars(self, sql, args):
"""Extract $XYZ-style variables from the `sql` query.
"""
names = set()
values = []
- 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_ticket_actions
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_ticket_actions(self, req, ticket):
"""Returns a list of (weight, action) tuples that are valid for this
request and this ticket."""
# Get the list of actions that can be performed
- 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_href
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_href(self, href, id=None, order=None, desc=None, format=None,
max=None, page=None):
"""Create a link corresponding to this query.
:param href: the `Href` object used to build the URL
- 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_ticket_changes
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_ticket_changes(self, req, ticket, selected_action):
"""Returns a dictionary of field changes.
The field changes are represented as:
`{field: {'old': oldvalue, 'new': newvalue, 'by': what}, ...}`
- 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 check_permission
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def check_permission(self, action, username, resource, perm):
# We add the 'VULNERABILITY_VIEW' pre-requisite for any action
# other than 'VULNERABILITY_VIEW' itself, as this would lead
# to recursion.
if action == 'VULNERABILITY_VIEW':
- 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_history
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_history(self, limit=None):
"""Yield change events that happened on this path"""
newer = None # 'newer' is the previously seen history tuple
older = None # 'older' is the currently examined history tuple
pool = Pool(self.pool)
- 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 createBatchInput
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createBatchInput(propertyName, property) {
var td = $('<td class="batchmod_property">');
var inputName = getBatchInputName(propertyName);
var focusElement = null;
switch (property.type) {
Function process_request
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_request(self, req):
req.perm.require('LOG_VIEW')
mode = req.args.get('mode', 'stop_on_copy')
path = req.args.get('path', '/')