Showing 1,161 of 1,161 total issues
Function compute_amount_withholdin_tax
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def compute_amount_withholdin_tax(
Avoid deeply nested control flow statements. Open
if key not in inv_lines_by_ddt:
inv_lines_by_ddt[key] = []
inv_lines_by_ddt[key].append(line.ftpa_line_number)
Function _compute_lines
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _compute_lines(self, cr, uid, ids, name, args, context=None):
Function _compute_balance
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _compute_balance(self, cr, uid, ids, name, args, context=None):
Avoid deeply nested control flow statements. Open
if debit:
p_debit = payment_line[1]
else:
p_credit = payment_line[1]
val_move_line = {
Function _compute_deductible_vat_amount
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _compute_deductible_vat_amount(
Function _reconciled
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _reconciled(self, cr, uid, ids, name, args, context=None):
Function _amount_withholding_tax
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _amount_withholding_tax(self, cr, uid, ids, name, args, context=None):
Avoid deeply nested control flow statements. Open
if (
(line['amount'] + amount_overflow_residual) <=
(
line['amount_unreconciled'] -
line['amount_residual_withholding_tax']
Function onchange_partner_id
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def onchange_partner_id(self, type, partner_id, date_invoice=False,
Avoid deeply nested control flow statements. Open
if main_tax.id == tax.id:
# se risulta un'eccedenza, la tolgo dalla parte detraibile
if tax_difference < 0:
inv_tax['amount'] = inv_tax['amount'] + tax_difference
# se risulta una mancanza, la aggiungo alla parte indetraibile
Function _compute_has_pdf_invoice_print
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _compute_has_pdf_invoice_print(self):
"""Check if all the invoices related to this attachment
have at least one attachment containing
the PDF report of the invoice"""
for attachment_out in self:
- 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_authority_vat_amount
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _compute_authority_vat_amount(
Function generate_creditor_scheme_identification
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_creditor_scheme_identification(
Function generate_party_agent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def generate_party_agent(
self, parent_node, party_type, party_type_label,
order, party_name, iban, bic, eval_ctx, gen_args, context=None):
# CBI logic modified for add ABI of debitor
# ABI code from IBAN
- 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_is_unsolved
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_is_unsolved(self, cr, uid, ids, name, arg, context=None):
Function _get_is_unsolved
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_is_unsolved(self, cr, uid, ids, name, arg, context=None):
res = {}
for invoice in self.browse(cr, uid, ids, context=context):
res[invoice.id] = False
reconciled_unsolved = 0
- 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 export_zip
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def export_zip(self):
self.ensure_one()
attachments = self.env[self.env.context['active_model']].browse(
self.env.context['active_ids'])
for att in attachments:
- 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 generate_creditor_scheme_identification
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_creditor_scheme_identification(
Avoid deeply nested control flow statements. Open
for grouped_line in grouped_lines[key]:
riba_list_move_line.create({
'riba_line_id': rdl_id,
'amount': grouped_line.amount_residual,
'move_line_id': grouped_line.id,