Showing 207 of 317 total issues
Function onchange_company_id
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def onchange_company_id(self, cr, uid, ids, company_id, context=None):
" update related fields "
values = {}
values['currency_id'] = False
if not company_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 _get_download_links
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _get_download_links(self):
def _is_connection_status_good(link):
server = "openerp.com"
status_good = False
try:
- 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 fetch_mail
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def fetch_mail(self, cr, uid, ids, context=None):
if context is None:
context = {}
check_original = []
- 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 _module_data_uninstall
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _module_data_uninstall(self, cr, uid, modules_to_remove, context=None):
"""this function crashes for xmlids on undefined models or fields
referring to undefined models"""
if context is None:
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 _iter_inheritance_specs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _iter_inheritance_specs(self, spec):
if spec.tag == 'data':
for child in spec:
for node, handler in self._iter_inheritance_specs(child):
yield node, handler
- 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 authenticate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def authenticate(self, db, login, password, user_agent_env):
""" Authenticate the user 'login' is password is ok or if
is admin password. In the second case, send mail to user and admin."""
user_id = super(ResUsers, self).authenticate(
db, login, password, user_agent_env)
- 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 _bind_http_remote_user
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _bind_http_remote_user(self, db_name):
try:
registry = openerp.registry(db_name)
with registry.cursor() as cr:
if AuthFromHttpRemoteUserInstalled._name not in registry:
- 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _search(self, args, offset=0, limit=None, order=None, count=False,
access_rights_uid=None):
if not args:
return super(RestrictFieldAccessMixin, self)._search(
args, offset=offset, limit=limit, order=order, count=count,
- 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 fields_view_get
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def fields_view_get(self, cr, user, view_id=None, view_type='form',
Function fields_view_get
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def fields_view_get(self, cr, uid, view_id=None, view_type='form',
Function _handle_callback_exception
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _handle_callback_exception(self, cr, uid, model_name, method_name,
Function _import_data
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _import_data(self, cr, uid, flds, data, model_obj, table_obj, log):
Function fields_view_get
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def fields_view_get(self, cr, user, view_id=None, view_type='form',
Function create_logs
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_logs(self, uid, res_model, res_ids, method,
Function fields_view_get
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def fields_view_get(self, cr, uid, view_id=None, view_type='form',
Function read_group
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def read_group(self, domain, fields, groupby, offset=0, limit=None,
Function execute
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute(self, cr, uid, ids, sqlquery, sqlparams=None, metadata=False,
Function fields_view_get
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def fields_view_get(
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
Avoid deeply nested control flow statements. Open
with rec.sftp_connection() as remote:
# Directory must exist
try:
remote.makedirs(rec.folder)
except pysftp.ConnectionException: