Showing 165 of 421 total issues
Function set_domain
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_domain(self, country_id=False, state_id=False,
Function compute_all
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def compute_all(self, price_unit, currency=None, quantity=1.0,
product=None, partner=None):
exists_br_tax = len(self.filtered(lambda x: x.domain)) > 0
if not exists_br_tax:
- 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 _invoice_total
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _invoice_total(self):
account_invoice_report = self.env['account.invoice.report']
if not self.ids:
self.total_invoiced = 0.0
return True
- 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_worked_day_lines
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_worked_day_lines(self, contract_ids, date_from, date_to):
res = super(HrPayslip, self).get_worked_day_lines(
contract_ids, date_from, date_to)
for contract in contract_ids:
leaves = self.env['hr.holidays'].search(
- 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 _process_order
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _process_order(self, pos_order):
num_controle = int(''.join([str(SystemRandom().randrange(9))
for i in range(8)]))
res = super(PosOrder, self)._process_order(pos_order)
res.numero_controle = str(num_controle)
- 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 seach_by_address
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def seach_by_address(self, obj, country_id=False, state_id=False,
Function _compute_ipi
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _compute_ipi(self, price_base):
ipi_tax = self.filtered(lambda x: x.domain == 'ipi')
if not ipi_tax:
return []
vals = self._tax_vals(ipi_tax)
- 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 modulo11
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def modulo11(num, base=9, r=0):
if not isinstance(num, basestring):
raise TypeError
soma = 0
fator = 2
- 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 modulo11
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def modulo11(self, num, base=9, r=0):
if not isinstance(num, basestring):
raise TypeError
soma = 0
fator = 2
- 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_cnpj_cpf
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _check_cnpj_cpf(self):
check_cnpj_cpf = True
if self.cnpj_cpf:
if self.cpfcnpj_type == 'cnpj':
if not fiscal.validate_cnpj(self.cnpj_cpf):
- 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 onchange_invoice_related_id
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def onchange_invoice_related_id(self):
if not self.invoice_related_id:
return
inv_id = self.invoice_related_id
if not inv_id.fiscal_document_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 _check_cnpj_cpf
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _check_cnpj_cpf(self):
country_code = self.country_id.code or ''
if self.cnpj_cpf and country_code.upper() == 'BR':
if self.is_company:
if not fiscal.validate_cnpj(self.cnpj_cpf):
- 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 invoice_validate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def invoice_validate(self):
res = super(AccountInvoice, self).invoice_validate()
self.action_number()
for item in self:
if item.is_eletronic and\
- 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
Consider simplifying this complex logical expression. Open
if bank_account.bank_id:
acc_number_format = bank_account.bank_id.acc_number_format \
or '%(acc_number)s'
args = {
'bra_number': bank_account.bra_number or '',
Function values_postprocess
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def values_postprocess(self, order, mode, values, errors, error_msg):
Function compute_all
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def compute_all(self, price_unit, currency=None, quantity=1.0,
Function create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(self, cr, uid, ids, datas, context=False):
Function _load_template
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _load_template(self, company, code_digits=None,
Function _filter_rules
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _filter_rules(self, fpos_id, type_tax, partner, product, state):
Function _prepare_refund
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _prepare_refund(self, invoice, date_invoice=None, date=None,