Showing 341 of 1,161 total issues
Function set_welfares_fund
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def set_welfares_fund(
self, FatturaBody, credit_account_id, invoice, wt_founds
):
if not self.e_invoice_detail_level == '2':
return
- 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 add_tax_stamp_line
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def add_tax_stamp_line(self):
for inv in self:
if not inv.tax_stamp:
raise exceptions.Warning(_("Tax stamp is not applicable"))
stamp_product_id = self._get_stamp_product(inv)
- 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_ddt_data
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def set_ddt_data(self, FatturaBody, invoice_id):
DdtDatas = FatturaBody.DatiGenerali.DatiDDT
if not DdtDatas:
return
invoice_line_model = self.env['account.invoice.line']
- 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_id
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def onchange_invoice_id(self):
for fattura in self:
if fattura.invoice_id:
fattura.dati_fattura_TipoDocumento = \
fattura.invoice_id.fiscal_document_type_id 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
Function onchange_company_id
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def onchange_company_id(
self, company_id, part_id, type, invoice_line, currency_id
):
res = super(AccountInvoice, self).onchange_company_id(
company_id, part_id, type, invoice_line, currency_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 action_draft
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def action_draft(self, cr, uid, ids, context=None):
"""
Called when the user clicks the confirm button.
"""
if context is None:
- 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_tax_line_vals
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_tax_line_vals(self, tax_line):
self.ensure_one()
# aliquota, natura, esigibilità
aliquota = 0
kind_id = 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
Function setDatiRiepilogo
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def setDatiRiepilogo(self, invoice, body):
model_tax = self.env['account.tax']
if not invoice.tax_line:
raise UserError(
_("Invoice {invoice} has no tax lines")
- 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_document_fiscal_type
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _get_document_fiscal_type(self, type=None, partner=None,
fiscal_position=None, journal=None):
dt = []
doc_id = False
if not type:
- 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_tax_lines
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _get_tax_lines(self, move):
res = []
# index è usato per non ripetere la stampa dei dati fattura quando ci
# sono più codici IVA
index = 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 _get_statement_from_line
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _get_statement_from_line(self, cr, uid, ids, context=None):
move = {}
for line in self.pool.get('account.move.line').browse(
cr, uid, ids, context=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 test_10_withholding_tax
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_10_withholding_tax(self):
domain = [('name', '=', 'Provision')]
wts = self.env['withholding.tax'].search(domain)
self.assertEqual(len(wts), 1, msg="Withholding tax was not created")
Function _BuildAutomaton_10
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_10 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_10
del _BuildAutomaton_10
import pyxb.utils.fac as fac
Function _BuildAutomaton_27
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_27 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_27
del _BuildAutomaton_27
import pyxb.utils.fac as fac
Function _BuildAutomaton_7
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_7 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_7
del _BuildAutomaton_7
import pyxb.utils.fac as fac
Function _BuildAutomaton_33
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_33 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_33
del _BuildAutomaton_33
import pyxb.utils.fac as fac
Function _BuildAutomaton_26
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_26 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_26
del _BuildAutomaton_26
import pyxb.utils.fac as fac
Function set_withholding_tax
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def set_withholding_tax(self, FatturaBody, invoice_data):
Withholdings = FatturaBody.DatiGenerali. \
DatiGeneraliDocumento.DatiRitenuta
if not Withholdings:
return None
- 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 _setStabileOrganizzazione
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _setStabileOrganizzazione(self, CedentePrestatore, company):
if company.fatturapa_stabile_organizzazione:
stabile_organizzazione = company.fatturapa_stabile_organizzazione
if not stabile_organizzazione.street:
raise UserError(
- 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 _normalizza_dati_partner
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _normalizza_dati_partner(self, partner, vals):
# Paesi Esteri :
# - Rimuovo CAP/provincia che potrebbero dare problemi nella
# validazione
# Paesi UE :
- 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"