Showing 341 of 1,161 total issues
Function setDettaglioLinee
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def setDettaglioLinee(self, invoice, body):
body.DatiBeniServizi = DatiBeniServiziType()
# TipoCessionePrestazione not handled
- 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 _BuildAutomaton_35
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_35 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_35
del _BuildAutomaton_35
import pyxb.utils.fac as fac
File fyc.py
has 436 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Pexego Sistemas Informáticos. All Rights Reserved
File test_fatturapa_xml_validation.py
has 436 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright 2014 Davide Corio
# Copyright 2015-2016 Lorenzo Battistini - Agile Business Group
# Copyright 2018-2019 Alex Comba - Agile Business Group
# Copyright 2019 Sergio Corato
Function _BuildAutomaton_6
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_6 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_6
del _BuildAutomaton_6
import pyxb.utils.fac as fac
Function getPartnerBase
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def getPartnerBase(self, DatiAnagrafici, supplier=True):
if not DatiAnagrafici:
return False
partner_model = self.env['res.partner']
cf = DatiAnagrafici.CodiceFiscale 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
Function _createPaymentsLine
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def _createPaymentsLine(self, payment_id, line, partner_id):
details = line.DettaglioPagamento or False
if details:
PaymentModel = self.env['fatturapa.payment.detail']
PaymentMethodModel = self.env['fatturapa.payment_method']
- 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 _BuildAutomaton_5
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_5 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_5
del _BuildAutomaton_5
import pyxb.utils.fac as fac
Function getCedPrest
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def getCedPrest(self, cedPrest):
partner_model = self.env['res.partner']
partner_id = self.getPartnerBase(cedPrest.DatiAnagrafici)
no_contact_update = False
if partner_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 _check_national_codes
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def _check_national_codes(
self, birth_city, birth_prov, birth_date, cities):
nc = ''
dtcostvar = None
for ct in cities:
- 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
WizardImportFatturapa
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
class WizardImportFatturapa(models.TransientModel):
_name = "wizard.import.fatturapa"
_description = "Import E-bill"
e_invoice_detail_level = fields.Selection([
File account.py
has 400 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright 2014 Davide Corio <davide.corio@abstract.it>
# Copyright 2018 Gianmarco Conte, Marco Calcagni - Dinamiche Aziendali srl
# Copyright 2019 Sergio Corato
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
Function setRelatedDocumentTypes
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def setRelatedDocumentTypes(self, invoice, body):
for line in invoice.invoice_line:
for related_document in line.related_documents:
doc_type = RELATED_DOCUMENT_TYPES[related_document.type]
documento = DatiDocumentiCorrelatiType()
- 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 create_invoice
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def create_invoice(self):
ddt_model = self.env['stock.picking.package.preparation']
picking_pool = self.pool['stock.picking']
ddts = ddt_model.search(
- 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 act_getfile
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def act_getfile(self, cr, uid, ids, context=None):
active_ids = context and context.get('active_ids', [])
order_obj = self.pool['riba.distinta'].browse(
cr, uid, active_ids, context=context)[0]
credit_bank = order_obj.config_id.bank_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
TestFatturaPAXMLValidation
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class TestFatturaPAXMLValidation(FatturapaCommon):
def setUp(self):
super(TestFatturaPAXMLValidation, self).setUp()
self.wt = self.create_wt_4q()
Consider simplifying this complex logical expression. Open
if details:
PaymentModel = self.env['fatturapa.payment.detail']
PaymentMethodModel = self.env['fatturapa.payment_method']
BankModel = self.env['res.bank']
PartnerBankModel = self.env['res.partner.bank']
ComunicazioneDatiIva
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class ComunicazioneDatiIva(models.Model):
_name = 'comunicazione.dati.iva'
_description = 'Invoices data communication'
_rec_name = 'identificativo'
Consider simplifying this complex logical expression. Open
if company_id:
company = self.pool.get('res.company').browse(
cr, uid, company_id, context=context)
default_sequence = self.pool.get('ir.sequence').search(cr, uid, [
('code', '=', 'account.invoice.fatturapa')
WizardExportFatturapa
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class WizardExportFatturapa(models.TransientModel):
_name = "wizard.export.fatturapa"
_description = "Export E-invoice"
@api.model