Showing 207 of 317 total issues
Avoid deeply nested control flow statements. Open
if basename.split('_')[0] not in keep_langs:
continue
yield filepath
Function _inverse_name
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _inverse_name(self):
"""Get the fields from the name."""
for one in self:
# Field names can have up to only 4 indentation levels
parts = one.name.split("/")
- 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
with rec.custom_tempdir():
db.dump_db(self.env.cr.dbname, destiny)
backup = backup or destiny.name
Function _get_login_date
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_login_date(self, cr, uid, ids, name, args, context=None):
Function onchange_server_type
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def onchange_server_type(
Function render_tag_usertime
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def render_tag_usertime(self, element, template_attributes,
generated_attributes, qwebcontext):
tformat = template_attributes['usertime']
if not tformat:
# No format, use default time and date formats from qwebcontext
- 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 write
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def write(self, cr, uid, ids, vals, context=None, **kwargs):
Function purge
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def purge(self, cr, uid, ids, context=None):
"""
Unlink tables upon manual confirmation.
"""
lines = self.browse(cr, uid, ids, context=context)
- 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
with open(backup) as cached:
shutil.copyfileobj(cached, destiny)
# Generate new backup
else:
Function check
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def check(self, cr, uid, model, mode='read', raise_exception=True,
Function _get_environment_config_by_name
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_environment_config_by_name(self, cr, uid, ids, field_names, arg, context):
Function _add_tz
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _add_tz(self, value, tz):
"""set the timezone on an rruleset and adjust dates there"""
value.tz = tz
tz = gettz(tz)
for rule in value._rrule:
- 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_is_template_template
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_is_template_template(self, cr, uid, ids, fields_name, arg,
Function _inherited_models
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _inherited_models(self, cr, uid, ids, field_name, arg, context=None):
Function initialize_raven
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize_raven(config, client_cls=None):
'''
Setup an instance of :class:`raven.Client`.
:param config: Sentry configuration
- 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_name
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _check_name(self):
for one in self:
if not one.label:
raise exceptions.ValidationError(
_("Field '%s' does not exist") % one.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
Avoid deeply nested control flow statements. Open
with rec.sftp_connection() as remote:
# Directory must exist
try:
remote.makedirs(rec.folder)
except pysftp.ConnectionException:
Function _get_views
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_views(self, cr, uid, module_id, context=None):
module_module_obj = self.pool.get('ir.module.module')
model_data_obj = self.pool.get('ir.model.data')
view_obj = self.pool.get('ir.ui.view')
report_obj = self.pool.get('ir.actions.report.xml')
- 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 _type_search
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _type_search(self, cr, uid, obj, name, args, context=None):
Avoid deeply nested control flow statements. Open
if modifiers[field][modifier]:
modifiers[field][modifier].insert(0, '|')
modifiers[field][modifier].append(