OCA/l10n-italy

View on GitHub

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
Severity: Minor
Found in l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py - About 1 hr 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 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)
Severity: Minor
Found in l10n_it_account_stamp/models/invoice.py - About 1 hr 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_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']
Severity: Minor
Found in l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py - About 1 hr 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_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 \
Severity: Minor
Found in l10n_it_invoices_data_communication/models/communication.py - About 1 hr 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 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)
Severity: Minor
Found in l10n_it_corrispettivi/account.py - About 1 hr 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 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:
Severity: Minor
Found in account_fiscal_year_closing/fyc.py - About 1 hr 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 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
Severity: Minor
Found in l10n_it_invoices_data_communication/models/account_invoice.py - About 1 hr 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 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")
Severity: Minor
Found in l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py - About 1 hr 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 _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:
Severity: Minor
Found in l10n_it_fiscal_document_type/models/account_invoice.py - About 1 hr 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 _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
Severity: Minor
Found in l10n_it_vat_registries/vat_registry.py - About 1 hr 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 _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
        ):
Severity: Minor
Found in account_vat_period_end_statement/models/account.py - About 1 hr 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 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")

Severity: Minor
Found in l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py - About 1 hr to fix

    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
    Severity: Minor
    Found in l10n_it_fatturapa/bindings/binding.py - About 1 hr to fix

      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
      Severity: Minor
      Found in l10n_it_fatturapa/bindings/binding.py - About 1 hr to fix

        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
        Severity: Minor
        Found in l10n_it_fatturapa/bindings/binding.py - About 1 hr to fix

          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
          Severity: Minor
          Found in l10n_it_fatturapa/bindings/binding.py - About 1 hr to fix

            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
            Severity: Minor
            Found in l10n_it_fatturapa/bindings/binding.py - About 1 hr to fix

              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
              Severity: Minor
              Found in l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py - About 1 hr 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 _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(
              Severity: Minor
              Found in l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py - About 1 hr 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 _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 :
              Severity: Minor
              Found in l10n_it_invoices_data_communication/models/communication.py - About 1 hr 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