OCA/l10n-italy

View on GitHub

Showing 1,161 of 1,161 total issues

Function compute_amount_withholdin_tax has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def compute_amount_withholdin_tax(
Severity: Minor
Found in l10n_it_withholding_tax/models/voucher.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if key not in inv_lines_by_ddt:
                                inv_lines_by_ddt[key] = []
                            inv_lines_by_ddt[key].append(line.ftpa_line_number)
    Severity: Major
    Found in l10n_it_fatturapa_out_ddt/wizard/wizard_export_fatturapa.py - About 45 mins to fix

      Function _compute_lines has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _compute_lines(self, cr, uid, ids, name, args, context=None):
      Severity: Minor
      Found in account_vat_period_end_statement/models/account.py - About 45 mins to fix

        Function _compute_balance has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _compute_balance(self, cr, uid, ids, name, args, context=None):
        Severity: Minor
        Found in l10n_it_withholding_tax/models/voucher.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if debit:
                                      p_debit = payment_line[1]
                                  else:
                                      p_credit = payment_line[1]
                                  val_move_line = {
          Severity: Major
          Found in l10n_it_withholding_tax/models/voucher.py - About 45 mins to fix

            Function _compute_deductible_vat_amount has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def _compute_deductible_vat_amount(
            Severity: Minor
            Found in account_vat_period_end_statement/models/account.py - About 45 mins to fix

              Function _reconciled has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def _reconciled(self, cr, uid, ids, name, args, context=None):
              Severity: Minor
              Found in account_vat_period_end_statement/models/account.py - About 45 mins to fix

                Function _amount_withholding_tax has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def _amount_withholding_tax(self, cr, uid, ids, name, args, context=None):
                Severity: Minor
                Found in l10n_it_withholding_tax/models/voucher.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (
                                                  (line['amount'] + amount_overflow_residual) <=
                                                  (
                                                      line['amount_unreconciled'] -
                                                      line['amount_residual_withholding_tax']
                  Severity: Major
                  Found in l10n_it_withholding_tax/models/voucher.py - About 45 mins to fix

                    Function onchange_partner_id has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def onchange_partner_id(self, type, partner_id, date_invoice=False,
                    Severity: Minor
                    Found in l10n_it_fiscal_document_type/models/account_invoice.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if main_tax.id == tax.id:
                                                  # se risulta un'eccedenza, la tolgo dalla parte detraibile
                                                  if tax_difference < 0:
                                                      inv_tax['amount'] = inv_tax['amount'] + tax_difference
                                                  # se risulta una mancanza, la aggiungo alla parte indetraibile
                      Severity: Major
                      Found in l10n_it_partially_deductible_vat/account.py - About 45 mins to fix

                        Function _compute_has_pdf_invoice_print has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _compute_has_pdf_invoice_print(self):
                                """Check if all the invoices related to this attachment
                                have at least one attachment containing
                                the PDF report of the invoice"""
                                for attachment_out in self:
                        Severity: Minor
                        Found in l10n_it_fatturapa_out/models/attachment.py - About 45 mins 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_authority_vat_amount has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def _compute_authority_vat_amount(
                        Severity: Minor
                        Found in account_vat_period_end_statement/models/account.py - About 45 mins to fix

                          Function generate_creditor_scheme_identification has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def generate_creditor_scheme_identification(
                          Severity: Minor
                          Found in l10n_it_sepa_bonifici/wizard/export_sepa_cbi.py - About 45 mins to fix

                            Function generate_party_agent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def generate_party_agent(
                                        self, parent_node, party_type, party_type_label,
                                        order, party_name, iban, bic, eval_ctx, gen_args, context=None):
                                    # CBI logic modified for add ABI of debitor
                                    # ABI code from IBAN
                            Severity: Minor
                            Found in l10n_it_sepa_bonifici/wizard/export_sepa_cbi.py - About 45 mins 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_is_unsolved has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def _get_is_unsolved(self, cr, uid, ids, name, arg, context=None):
                            Severity: Minor
                            Found in l10n_it_ricevute_bancarie/models/account/account.py - About 45 mins to fix

                              Function _get_is_unsolved has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def _get_is_unsolved(self, cr, uid, ids, name, arg, context=None):
                                      res = {}
                                      for invoice in self.browse(cr, uid, ids, context=context):
                                          res[invoice.id] = False
                                          reconciled_unsolved = 0
                              Severity: Minor
                              Found in l10n_it_ricevute_bancarie/models/account/account.py - About 45 mins 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 export_zip has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def export_zip(self):
                                      self.ensure_one()
                                      attachments = self.env[self.env.context['active_model']].browse(
                                          self.env.context['active_ids'])
                                      for att in attachments:
                              Severity: Minor
                              Found in l10n_it_fatturapa_export_zip/wizard/export_fatturapa.py - About 45 mins 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 generate_creditor_scheme_identification has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def generate_creditor_scheme_identification(
                              Severity: Minor
                              Found in l10n_it_sepa_bonifici/wizard/export_sepa_cbi_estero.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        for grouped_line in grouped_lines[key]:
                                                            riba_list_move_line.create({
                                                                'riba_line_id': rdl_id,
                                                                'amount': grouped_line.amount_residual,
                                                                'move_line_id': grouped_line.id,
                                Severity: Major
                                Found in l10n_it_ricevute_bancarie/wizard/wizard_riba_issue.py - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language