Showing 207 of 317 total issues
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
for name in sorted(
n for n in remote.listdir(rec.folder)
if n.endswith(".dump.zip")
)[:-rec.days_to_keep]:
remote.unlink('%s/%s' % (rec.folder, name))
Avoid deeply nested control flow statements. Open
if basename.split('_')[0] not in keep_langs:
continue
yield filepath
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 _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 _inherited_models
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _inherited_models(self, cr, uid, ids, field_name, arg, context=None):
Function find
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find(self, cr, uid, context=None):
"""
Search for columns that are not in the corresponding model.
Group models by table to prevent false positives for columns
- 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_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):
Avoid deeply nested control flow statements. Open
with open(backup) as cached:
shutil.copyfileobj(cached, destiny)
# Generate new backup
else:
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 _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 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
Function check
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def check(self, cr, uid, model, mode='read', raise_exception=True,
Function write
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def write(self, cr, uid, ids, vals, context=None, **kwargs):
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 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 _compute_database
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _compute_database(self):
table_names = []
for line in self.filtered(lambda x: x.model_id):
model_obj = self.env.registry.get(line.model_id.model, False)
if model_obj:
- 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 _search
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _search(self, args, offset=0, limit=None, order=None, count=False,