OCA/l10n-italy

View on GitHub

Showing 1,161 of 1,161 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        account_receivable = self.env['account.account'].create({
            'name': 'Test WH tax',
            'code': 'whtaxrec2',
            'user_type': self.env.ref(
                'account.data_account_type_receivable').id,
Severity: Major
Found in l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py and 1 other location - About 1 hr to fix
l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py on lines 689..694

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if line.discount3:
                DettaglioLinea.ScontoMaggiorazione.append(
                    ScontoMaggiorazioneType(
                        Tipo='SC',
                        Percentuale='%.2f' % float_round(line.discount3, 2)
l10n_it_fatturapa_out_triple_discount/wizard/wizard_export_fatturapa.py on lines 21..25

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        self.assertTrue(
            set(payment.move_id.line_id.mapped('debit')) ==
            set([0, 5, 1164, 23, 0])
l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 281..283

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                            for boe_move_line in bill_of_entry.move_id.line_id:
                                if boe_move_line.account_id.id == bill_of_entry.account_id.id:
                                    reconcile_ids.append(boe_move_line.id)
Severity: Major
Found in l10n_it_bill_of_entry/account_invoice.py and 1 other location - About 1 hr to fix
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 206..211

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        for acceptance_move_line in distinta_line.acceptance_move_id.line_id:
            if (
                acceptance_move_line.account_id.id ==
                wizard.effects_account_id.id
            ):
Severity: Major
Found in l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py and 1 other location - About 1 hr to fix
l10n_it_bill_of_entry/account_invoice.py on lines 116..118

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        account_payable = self.env['account.account'].create({
            'name': 'Test WH tax',
            'code': 'whtaxpay2',
            'user_type': self.env.ref(
                'account.data_account_type_payable').id,
Severity: Major
Found in l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py and 1 other location - About 1 hr to fix
l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py on lines 695..700

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def _get_fatture_ricevute(self):
        self.ensure_one()
        domain = self._get_fatture_ricevute_domain()
        return self.env['account.invoice'].search(domain)
Severity: Major
Found in l10n_it_invoices_data_communication/models/communication.py and 1 other location - About 1 hr to fix
l10n_it_invoices_data_communication/models/communication.py on lines 510..513

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                if invoice.type == 'out_invoice':
                    payment_line_amount = (
                        invoice.amount_total * payment_line.debit) / inv_total
                    payment_line.write(
                        {'debit': payment_line_amount}, update_check=False)
Severity: Major
Found in l10n_it_split_payment/models/account.py and 1 other location - About 1 hr to fix
l10n_it_split_payment/models/account.py on lines 89..93

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function test_01_xml_import has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def test_01_xml_import(self):
        res = self.run_wizard('test1', 'IT02780790107_11004.xml')
        invoice_id = res.get('domain')[0][2][0]
        invoice = self.invoice_model.browse(invoice_id)
        self.assertEqual(invoice.reference, '123')
Severity: Minor
Found in l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py - About 1 hr to fix

    Function _BuildAutomaton_4 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function _BuildAutomaton_3 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function _BuildAutomaton_ has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Function test_00_xml_import has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def test_00_xml_import(self):
                  self.env.user.company_id.cassa_previdenziale_product_id = (
                      self.service.id)
                  res = self.run_wizard('test0', 'IT05979361218_001.xml')
                  invoice_id = res.get('domain')[0][2][0]
          Severity: Minor
          Found in l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py - About 1 hr to fix

            Function _BuildAutomaton_6 has 26 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
            Severity: Minor
            Found in l10n_it_fatturapa/bindings/_ds.py - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                      if taxes:
                          tax = taxes[0]
                          # search for the related base code
                          base_code = (
                              tax.base_code_id or tax.parent_id and
              Severity: Major
              Found in l10n_it_account/models/account_tax.py - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                            if Delivery.IndirizzoResa:
                                delivery_dict['delivery_address'] = (
                                    '{0}, {1}\n{2} - {3}\n{4} {5}'.format(
                                        Delivery.IndirizzoResa.Indirizzo or '',
                                        Delivery.IndirizzoResa.NumeroCivico or '',
                Severity: Major
                Found in l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py - About 1 hr to fix

                  Function voucher_move_line_create has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def voucher_move_line_create(
                  Severity: Major
                  Found in l10n_it_withholding_tax/models/voucher.py - About 1 hr to fix

                    Function compute_all has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def compute_all(self, cr, uid, taxes, price_unit, quantity, product=None, partner=None, force_excluded=False):
                    Severity: Major
                    Found in l10n_it_partially_deductible_vat/account.py - About 1 hr to fix

                      Function onchange_reconcile has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def onchange_reconcile(self, cr, uid, ids, reconcile, amount,
                      Severity: Major
                      Found in l10n_it_withholding_tax/models/voucher.py - About 1 hr to fix

                        Similar blocks of code found in 4 locations. Consider refactoring.
                        Open

                                    elif (ct.notes == 'AGP' and
                                            (not dtcostvar or not ct.var_date or
                                                dtcostvar < ct.var_date)):
                        Severity: Major
                        Found in l10n_it_fiscalcode/wizard/compute_fc.py and 3 other locations - About 1 hr to fix
                        l10n_it_fiscalcode/wizard/compute_fc.py on lines 120..122
                        l10n_it_fiscalcode/wizard/compute_fc.py on lines 129..131
                        l10n_it_fiscalcode/wizard/compute_fc.py on lines 138..140

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 38.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language