Showing 341 of 1,161 total issues
Function _compute_amount
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _compute_amount(self):
super(AccountInvoice, self)._compute_amount()
if self.efatt_rounding != 0:
self.amount_total += self.efatt_rounding
amount_total_company_signed = self.amount_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
Function action_move_create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def action_move_create(self):
res = super(AccountInvoice, self).action_move_create()
for invoice in self:
if (
invoice.fiscal_position 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 _compute_split_payments
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _compute_split_payments(self):
for invoice in self:
payment_line_ids = invoice.move_line_id_payment_get()
move_line_pool = self.env['account.move.line']
for payment_line in move_line_pool.browse(payment_line_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
Function _setRea
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _setRea(self, CedentePrestatore, company):
if company.fatturapa_rea_office and company.fatturapa_rea_number:
CedentePrestatore.IscrizioneREA = IscrizioneREAType(
Ufficio=(
- 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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _compute_authority_vat_amount(
self, cr, uid, ids, field_name, arg, context
):
res = {}
for i in 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
Function _check_date
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _check_date(self):
if self.withholding_tax_id.active:
domain = [
('withholding_tax_id', '=', self.withholding_tax_id.id),
('id', '!=', self.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 _compute_type
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _compute_type(self):
for st in self:
if st.move_id:
domain = [
('move_id', '=', st.move_id.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 _get_invoice_total
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_invoice_total(self, move):
total = 0.0
receivable_payable_found = False
for move_line in move.line_id:
if move_line.account_id.type == 'receivable':
- 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_line_values
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_line_values(self):
self.amount = 0.0
self.invoice_date = ""
self.invoice_number = ""
for move_line in self.move_line_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
Function _check_tax_comunicazione_dati_iva_fattura
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _check_tax_comunicazione_dati_iva_fattura(self, args=None):
self.ensure_one()
if (
self.currency_id and
self.currency_id.id != self.company_id.currency_id.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 _prepareInvoiceLine
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _prepareInvoiceLine(self, credit_account_id, line, wt_founds=False):
retLine = self._prepare_generic_line_data(line)
retLine.update({
'name': line.Descrizione,
'sequence': int(line.NumeroLinea),
- 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 setDettaglioLinea
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def setDettaglioLinea(
self, line_no, line, body, price_precision, uom_precision):
res = super(WizardExportFatturapa, self).setDettaglioLinea(
line_no, line, body, price_precision, uom_precision)
if line.discount2 or line.discount3:
- 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 find_attachment_by_subject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_attachment_by_subject(self, subject):
attachment_out_model = self.env['fatturapa.attachment.out']
if 'CONSEGNA: ' in subject:
att_name = subject.replace('CONSEGNA: ', '')
fatturapa_attachment_out = attachment_out_model \
- 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_done
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_done(self):
for picking in self.picking_ids:
if picking.state != 'done':
raise exceptions.Warning(
_("Not every picking is in done status"))
- 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 write
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write(self, values):
if 'move_lines' in values:
pack_to_update = self.env['stock.picking.package.preparation']
for picking in self:
pack_to_update |= picking.ddt_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
Function check_partner_base_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_partner_base_data(self, partner_id, DatiAnagrafici):
partner = self.env['res.partner'].browse(partner_id)
if (
DatiAnagrafici.Anagrafica.Denominazione and
partner.name != DatiAnagrafici.Anagrafica.Denominazione
- 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_put_in_pack
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def action_put_in_pack(self):
for package in self:
# ----- Check if package has details
if not package.line_ids:
raise exceptions.Warning(
- 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 remove_move
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def remove_move(self, cr, uid, operation, fyc, context):
"""
Remove a account move (L&P, NL&P, Closing or Opening move)
"""
pool = self.pool
- 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_from_moves
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def generate_from_moves(self, cr, uid, move_ids, context=None):
res_id = False
wt_move_obj = self.pool['withholding.tax.move']
sequence_obj = self.pool['ir.sequence']
wt_moves = []
- 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_xml_string
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_xml_string(self):
try:
data = base64.b64decode(self.datas)
except binascii.Error as e:
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"