OCA/l10n-italy

View on GitHub

Showing 341 of 1,161 total issues

Function compute_amounts has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    def compute_amounts(self, cr, uid, ids, context=None):
        if context is None:
            context = {}
        statement_generic_account_line_obj = self.pool[
            'statement.generic.account.line']
Severity: Minor
Found in account_vat_period_end_statement/models/account.py - About 5 hrs to fix

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 setDatiDDT has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    def setDatiDDT(self, invoice, body):
        res = super(WizardExportFatturapa, self).setDatiDDT(
            invoice, body)
        if self.include_ddt_data == 'dati_ddt':
            inv_lines_by_ddt = {}
Severity: Minor
Found in l10n_it_fatturapa_out_ddt/wizard/wizard_export_fatturapa.py - About 4 hrs to fix

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_ftpa_partner_data has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    def _check_ftpa_partner_data(self):
        for partner in self:
            if partner.electronic_invoice_subjected and partner.customer:
                # These checks must be done for customers only, as only
                # needed for XML generation
Severity: Minor
Found in l10n_it_fatturapa/models/partner.py - About 4 hrs to fix

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 _prepare_wt_values has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    def _prepare_wt_values(self):

        partner = False
        wt_competence = {}
        # First : Partner and WT competence
Severity: Minor
Found in l10n_it_withholding_tax/models/account.py - About 4 hrs to fix

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 has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    def compute(self, cr, uid, invoice_id, context=None):
        tax_grouped = super(account_invoice_tax, self).compute(cr, uid, invoice_id, context)
        inv_obj = self.pool.get('account.invoice')
        tax_obj = self.pool.get('account.tax')
        tax_code_obj = self.pool.get('account.tax.code')
Severity: Minor
Found in l10n_it_partially_deductible_vat/account.py - About 4 hrs to fix

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_8 has 118 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def _BuildAutomaton_8 ():
    # Remove this helper function from the namespace after it is invoked
    global _BuildAutomaton_8
    del _BuildAutomaton_8
    import pyxb.utils.fac as fac
Severity: Major
Found in l10n_it_fatturapa/bindings/_ds.py - About 4 hrs to fix

    Function create_sepa has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

        def create_sepa(self):
            """Creates the SEPA Credit Transfer file. That's the important code!"""
            sepa_export = self[0]
            pain_flavor = self.payment_order_ids[0].mode.type.code
            convert_to_ascii = \
    Severity: Minor
    Found in l10n_it_sepa_bonifici/wizard/export_sepa_cbi_estero.py - About 4 hrs to fix

    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_roundings has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        def set_roundings(self, FatturaBody, invoice):
            rounding = 0.0
            if FatturaBody.DatiBeniServizi.DatiRiepilogo:
                for summary in FatturaBody.DatiBeniServizi.DatiRiepilogo:
                    rounding += float(summary.Arrotondamento or 0.0)
    Severity: Minor
    Found in l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py - About 4 hrs to fix

    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

    File wizard_run.py has 345 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    ##############################################################################
    #
    #    OpenERP - Import operations model 347 engine
    #    Copyright (C) 2009 Asr Oss. All Rights Reserved
    Severity: Minor
    Found in account_fiscal_year_closing/wizard/wizard_run.py - About 4 hrs to fix

      Function generate_self_invoice has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          def generate_self_invoice(self):
              rc_type = self.fiscal_position.rc_type_id
              if not rc_type.payment_journal_id.default_credit_account_id:
                  raise UserError(
                      _('There is no default credit account defined \n'
      Severity: Minor
      Found in l10n_it_reverse_charge/models/account_invoice.py - About 4 hrs to fix

      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_list has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          def create_list(self):
              def create_rdl(countme, bank_id, rd_id, date_maturity, partner_id,
                             acceptance_account_id):
                  rdl = {
                      'sequence': countme,
      Severity: Minor
      Found in l10n_it_ricevute_bancarie/wizard/wizard_riba_issue.py - About 4 hrs to fix

      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

      File test_fatturapa_wt.py has 340 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      from openerp.addons.l10n_it_fatturapa_out.tests.fatturapa_common import (
          FatturaPACommon)
      
      
      class TestInvoiceWT(FatturaPACommon):
      Severity: Minor
      Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py - About 4 hrs to fix

        File account.py has 337 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        # Copyright © 2015 Alessandro Camilli (<http://www.openforce.it>)
        # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
        
        
        
        Severity: Minor
        Found in l10n_it_withholding_tax/models/account.py - About 4 hrs to fix

          File riba.py has 337 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          ##############################################################################
          #
          #    Copyright (C) 2012 Andrea Cometa.
          #    Email: info@andreacometa.it
          Severity: Minor
          Found in l10n_it_ricevute_bancarie/models/riba.py - About 4 hrs to fix

            File account.py has 328 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            
            from openerp import fields, models, api, _
            from openerp.exceptions import ValidationError, Warning as UserError
            from openerp.tools import float_compare
            Severity: Minor
            Found in l10n_it_fatturapa_in/models/account.py - About 3 hrs to fix

              Function action_move_create has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
              Open

                  def action_move_create(self, cr, uid, ids, context=None):
              
                      if not context:
                          context = {}
              
              
              Severity: Minor
              Found in account_invoice_entry_date/models/account.py - About 3 hrs to fix

              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

              File account_invoice.py has 321 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              # Copyright 2017 Davide Corio
              # Copyright 2017 Alex Comba - Agile Business Group
              # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
              
              
              Severity: Minor
              Found in l10n_it_reverse_charge/models/account_invoice.py - About 3 hrs to fix

                File withholding_tax.py has 312 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                # Copyright © 2015 Alessandro Camilli (<http://www.openforce.it>)
                # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
                
                
                
                Severity: Minor
                Found in l10n_it_withholding_tax/models/withholding_tax.py - About 3 hrs to fix

                  Function _BuildAutomaton_12 has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def _BuildAutomaton_12 ():
                      # Remove this helper function from the namespace after it is invoked
                      global _BuildAutomaton_12
                      del _BuildAutomaton_12
                      import pyxb.utils.fac as fac
                  Severity: Major
                  Found in l10n_it_fatturapa/bindings/binding.py - About 3 hrs to fix

                    Function _BuildAutomaton_18 has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    def _BuildAutomaton_18 ():
                        # Remove this helper function from the namespace after it is invoked
                        global _BuildAutomaton_18
                        del _BuildAutomaton_18
                        import pyxb.utils.fac as fac
                    Severity: Major
                    Found in l10n_it_fatturapa/bindings/binding.py - About 3 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language