akretion/odoo-shopinvader

View on GitHub
partner_contact_company/models/partner.py

Summary

Maintainability
B
4 hrs
Test Coverage

Showing 3 of 3 total issues

Function name_get has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def name_get(self):
res = []
for partner in self:
name = partner.name or ""
 
 
Severity: Minor
Found in partner_contact_company/models/partner.py - About 2 hrs to fix

Function _inverse_name has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _inverse_name(self):
"""Try to revert the effect of :meth:`._compute_name`."""
for record in self:
names = record.name.split(", ", 1)
if record.is_company:
Severity: Minor
Found in partner_contact_company/models/partner.py - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

if record.is_company:
company = names[0]
contact_name = len(names) > 1 and names[1] or ""
else:
company = len(names) > 1 and names[0] or ""
Severity: Major
Found in partner_contact_company/models/partner.py - About 1 hr to fix

    There are no issues that match your filters.

    Category
    Status