Showing 1,161 of 1,161 total issues
Avoid deeply nested control flow statements. Open
if line.advance_customs_vat:
advance_customs_vat_line = True
break
if not advance_customs_vat_line:
Function exist
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def exist(self, cr, uid, field, value, id_doc, context=None):
Function _prepareRelDocsLine
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _prepareRelDocsLine(self, invoice_id, line, type):
res = []
lineref = line.RiferimentoNumeroLinea or False
IdDoc = line.IdDocumento or 'Error'
Data = line.Data or False
- 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
if quant.qty >= 0:
quants |= quant
weight = sum(l.product_id.weight * l.qty for l in quants)
Avoid deeply nested control flow statements. Open
if fatturapa_atts:
_logger.info("In invoice %s already processed"
% fatturapa_atts.mapped('name'))
else:
fatturapa_attachment_in.create({
Avoid deeply nested control flow statements. Open
if boe_line.invoice_line_tax_id:
if len(boe_line.invoice_line_tax_id) > 1:
raise osv.except_osv(_('Error'),
_("Can't handle more than 1 tax for line %s") % boe_line.name)
tax_code_id = (boe_line.invoice_line_tax_id[0].base_code_id
Avoid deeply nested control flow statements. Open
if tax_code_id:
line_vals['tax_code_id'] = tax_code_id
line_vals['tax_amount'] = boe_line.price_subtotal
move_lines.append((0, 0, line_vals))
Avoid deeply nested control flow statements. Open
if not dline.IstitutoFinanziario:
self.log_inconsistency(
_("Name of Bank with BIC '%s' is not set."
" Can't create bank") % dline.BIC
)
Avoid deeply nested control flow statements. Open
if account_map.dest_account_id:
dest_accounts_totals[account_map.dest_account_id.id] -= balance
accounts_done += 1
Avoid deeply nested control flow statements. Open
if move_line.account_id.id == bill_of_entry.account_id.id:
reconcile_ids.append(move_line.id)
for boe_move_line in bill_of_entry.move_id.line_id:
if boe_move_line.account_id.id == bill_of_entry.account_id.id:
reconcile_ids.append(boe_move_line.id)
Function _check_multiple_picking_ids
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _check_multiple_picking_ids(self):
for package in self:
if not package.ddt_type_id.restrict_pickings:
continue
for picking in package.picking_ids:
- 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
if num_messages < MAX_POP_MESSAGES:
break
pop_server.quit()
Function get_line_product
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_line_product(self, line, partner):
product = None
supplier_info = self.env['product.supplierinfo']
if len(line.CodiceArticolo) == 1:
supplier_code = line.CodiceArticolo[0].CodiceValore
- 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
for num in range(
1, min(MAX_POP_MESSAGES, num_messages) + 1
):
(header, messages, octets) = pop_server.retr(
num)
Function _compute_total
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _compute_total(self, cr, uid, ids, field_names, args, context=None):
Function _compute_payable_vat_amount
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _compute_payable_vat_amount(
Function _get_account_vat_amounts
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_account_vat_amounts(
self, type='credit', statement_account_line=None, context=None
):
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 get_undeductible_balances
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_undeductible_balances(self, tax):
total_undeduct = 0
total_deduct = 0
if self.is_totally_undeductable(tax):
total_undeduct = self.compute_tax_code_total(
- 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
for wt_invoice_line in inv.withholding_tax_line.\
filtered(lambda x: x == wt_tax):
i += 1
if i == rate_num:
wt_amount = wt_residual
Function _amount_residual
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _amount_residual(self, cr, uid, ids, name, args, context=None):