Showing 165 of 421 total issues
Function get_taxes_values
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_taxes_values(self):
tax_grouped = {}
for line in self.invoice_line_ids:
other_taxes = line.invoice_line_tax_ids.filtered(
lambda x: not x.domain)
- 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 _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 validate_ie_ap
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate_ie_ap(inscr_est):
inscr_est = re.sub('[^0-9]', '', inscr_est)
# verificando o tamanho da inscrição estadual
if len(inscr_est) != 9:
- 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_bank
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_bank(self):
bank = self.journal_id.bank_id.bic
if bank == '237':
from cnab240.bancos import bradesco
- 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 zip_search_multi
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def zip_search_multi(self, country_id=False,
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 validate_ie_to
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate_ie_to(inscr_est):
inscr_est = re.sub('[^0-9]', '', inscr_est)
# verificando o tamanho da inscrição estadual
if len(inscr_est) == 11:
- 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 set_domain
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_domain(self, 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 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 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 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 compute_all
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def compute_all(self, price_unit, currency=None, quantity=1.0,
Function _load_template
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _load_template(self, company, code_digits=None,
Function _prepare_refund
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _prepare_refund(self, invoice, date_invoice=None, date=None,
Function values_postprocess
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def values_postprocess(self, order, mode, values, errors, error_msg):
Function _filter_rules
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _filter_rules(self, fpos_id, type_tax, partner, product, state):
Function create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(self, cr, uid, ids, datas, context=False):