akretion/odoo-shopinvader

View on GitHub
base_url/models/abstract_url.py

Summary

Maintainability
B
6 hrs
Test Coverage

Showing 4 of 4 total issues

Function set_url has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def set_url(self, url_key):
""" Se a new url
backup old url
 
1 find url redirect true and same model_id
Severity: Minor
Found in base_url/models/abstract_url.py - About 55 mins to fix

Function _compute_url_key has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def _compute_url_key(self):
for record in self:
if not record.active:
record.url_key = ""
else:
Severity: Minor
Found in base_url/models/abstract_url.py - About 45 mins to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

@api.model
def create(self, value):
res = super(AbstractUrl, self).create(value)
synced = res._sync_urls()
super(AbstractUrl, synced).write({"is_urls_sync_required": False})
Severity: Major
Found in base_url/models/abstract_url.py and 1 other location - About 2 hrs to fix
base_url/models/abstract_url.py on lines 207..212

Similar blocks of code found in 2 locations. Consider refactoring.
Open

@api.multi
def write(self, value):
res = super(AbstractUrl, self).write(value)
synced = self._sync_urls()
super(AbstractUrl, synced).write({"is_urls_sync_required": False})
Severity: Major
Found in base_url/models/abstract_url.py and 1 other location - About 2 hrs to fix
base_url/models/abstract_url.py on lines 200..205

There are no issues that match your filters.

Category
Status