OCA/l10n-italy

View on GitHub

Showing 341 of 1,161 total issues

Function _BuildAutomaton_38 has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Function check_tax has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_tax(self, cr, uid, tax, context=None):
            """
            This is used to check that every (purchase) tax code is linked to
            only one (main) tax.
            This allows to print a VAT register summary where
    Severity: Minor
    Found in l10n_it_account/models/account_tax.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

    Function onchange_company_id has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        def onchange_company_id(self, cr, uid, ids, company_id, context=None):
            res = super(AccountConfigSettings, self).onchange_company_id(
                cr, uid, ids, company_id, context=context)
            if company_id:
                company = self.pool.get('res.company').browse(
    Severity: Minor
    Found in l10n_it_fatturapa/models/company.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

    Function create_move has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        def create_move(self, cr, uid, ids, context=None):
            if context is None:
                context = {}
            # wf_service = netsvc.LocalService("workflow")
            active_id = context and context.get('active_id', False) or False
    Severity: Minor
    Found in l10n_it_ricevute_bancarie/wizard/wizard_unsolved.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 wizard_riba_file_export.py has 301 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    #
    #
    #    Copyright (C) 2011-2012 Associazione OpenERP Italia
    #    (<http://www.odoo-italia.org>).
    Severity: Minor
    Found in l10n_it_ricevute_bancarie/wizard/wizard_riba_file_export.py - About 3 hrs to fix

      Function _BuildAutomaton_9 has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        File export_sepa_cbi_estero.py has 300 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        ##############################################################################
        #
        #    SEPA Direct Debit module for Odoo
        #    Copyright (C) 2013-2015 Akretion (http://www.akretion.com)
        Severity: Minor
        Found in l10n_it_sepa_bonifici/wizard/export_sepa_cbi_estero.py - About 3 hrs to fix

          Function _BuildAutomaton_11 has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function get_tax_by_tax_code has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

                def get_tax_by_tax_code(self):
                    """
                    Get account.tax linked to current tax code.
                    If the account.tax has a parent, the parent account.tax is returned.
                    """
            Severity: Minor
            Found in l10n_it_account/models/account_tax.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

            Function create_opening_move has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

                def create_opening_move(self, cr, uid, operation, fyc, context):
                    """
                    Create an opening move (based on the closing one)
                    """
                    pool = self.pool
            Severity: Minor
            Found in account_fiscal_year_closing/wizard/wizard_run.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

            Function split_communication has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

                def split_communication(self):
                    self.ensure_one()
                    if self.dati_trasmissione == 'DTE':
                        if not self.check_fatture_emesse_partners():
                            fatture_emesse = self.mapped(
            Severity: Minor
            Found in l10n_it_invoices_data_communication/models/communication.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

            Function recompute_withholding_tax_voucher_line has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

                def recompute_withholding_tax_voucher_line(
                        self, cr, uid, voucher_line_id, context=None):
                    """
                    Split amount voucher line second WT lines invoice
                    """
            Severity: Minor
            Found in l10n_it_withholding_tax/models/voucher.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

            AccountVatPeriodEndStatement has 26 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class AccountVatPeriodEndStatement(orm.Model):
            
                def _compute_authority_vat_amount(
                    self, cr, uid, ids, field_name, arg, context
                ):
            Severity: Minor
            Found in account_vat_period_end_statement/models/account.py - About 3 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                          if not ct.notes:
                              nc = ct.national_code
                          elif (ct.notes == 'ORA' and
                                  (not dtcostvar or not ct.var_date or
                                      dtcostvar < ct.var_date)):
              Severity: Critical
              Found in l10n_it_fiscalcode/wizard/compute_fc.py - About 3 hrs to fix

                Function run has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    def run(self, cr, uid, ids, context=None):
                        """
                        Creates / removes FYC entries
                        """
                
                
                Severity: Minor
                Found in account_fiscal_year_closing/wizard/wizard_run.py - About 2 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 setDatiPagamento has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    def setDatiPagamento(self, invoice, body):
                        if invoice.payment_term:
                            payment_line_ids = invoice.move_line_id_payment_get()
                            if not payment_line_ids:
                                return True
                Severity: Minor
                Found in l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py - About 2 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_19 has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function _BuildAutomaton_17 has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Function _compute_e_invoice_validation_error has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _compute_e_invoice_validation_error(self):
                            bills_to_check = self.filtered(
                                lambda inv:
                                    inv.type in ['in_invoice', 'in_refund'] and
                                    inv.state in ['draft', 'open', 'paid'] and
                    Severity: Minor
                    Found in l10n_it_fatturapa_in/models/account.py - About 2 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 _addGlobalDiscount has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _addGlobalDiscount(self, invoice_id, DatiGeneraliDocumento):
                            discount = 0.0
                            if (
                                DatiGeneraliDocumento.ScontoMaggiorazione and
                                self.e_invoice_detail_level == '2'
                    Severity: Minor
                    Found in l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py - About 2 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

                    Severity
                    Category
                    Status
                    Source
                    Language