OCA/l10n-italy

View on GitHub

Showing 820 of 1,161 total issues

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

        wizard = self.env['ddt.from.pickings'].with_context({
            'active_ids': [pick.id]
Severity: Minor
Found in l10n_it_ddt_delivery/tests/test_ddt_delivery.py and 2 other locations - About 35 mins to fix
l10n_it_ddt/tests/test_ddt.py on lines 206..207
l10n_it_ddt/tests/test_ddt.py on lines 211..212

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 33.

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.account_tax_22_credit = self.tax_model.create({
            'name': '22% credit',
            'amount': 0.22,
            'tax_code_id': self.account_tax_code_22_credit.id,
            'base_code_id': self.account_tax_code_22_imp_credit.id,
Severity: Minor
Found in account_vat_period_end_statement/tests/test_vat_statement.py and 1 other location - About 35 mins to fix
account_vat_period_end_statement/tests/test_vat_statement.py on lines 49..53

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 33.

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 not invoice.dati_fattura_DataRegistrazione:
                    errors.append(
                        _(u'No registration date for supplier bill %s') % (
                            invoice.invoice_id.number))
Severity: Minor
Found in l10n_it_invoices_data_communication/models/communication.py and 1 other location - About 35 mins to fix
l10n_it_invoices_data_communication/models/communication.py on lines 1181..1184

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 33.

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 not invoice.dati_fattura_Numero:
                    errors.append(
                        _(u'No invoice number for supplier bill %s') % (
                            invoice.invoice_id.number))
Severity: Minor
Found in l10n_it_invoices_data_communication/models/communication.py and 1 other location - About 35 mins to fix
l10n_it_invoices_data_communication/models/communication.py on lines 1185..1188

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 33.

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 7 locations. Consider refactoring.
Open

                if not invoice.carrier_id.vat:
                    raise UserError(
                        _('TIN not set for %s.') % invoice.carrier_id.name)
Severity: Major
Found in l10n_it_fatturapa_out_ddt/wizard/wizard_export_fatturapa.py and 6 other locations - About 35 mins to fix
l10n_it_fatturapa_out/models/attachment.py on lines 36..39
l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py on lines 786..789
l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py on lines 790..793
l10n_it_fatturapa_out_wt/wizard/wizard_export_fatturapa.py on lines 129..132
l10n_it_fatturapa_out_wt/wizard/wizard_export_fatturapa.py on lines 133..136
l10n_it_reverse_charge/models/account_invoice.py on lines 207..210

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 33.

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 7 locations. Consider refactoring.
Open

            if not invoice.payment_term.fatturapa_pt_id:
                raise UserError(
                    _('Payment term %s does not have a linked e-invoice '
                      'payment term') % invoice.payment_term.name)
Severity: Major
Found in l10n_it_fatturapa_out_wt/wizard/wizard_export_fatturapa.py and 6 other locations - About 35 mins to fix
l10n_it_fatturapa_out/models/attachment.py on lines 36..39
l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py on lines 786..789
l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py on lines 790..793
l10n_it_fatturapa_out_ddt/wizard/wizard_export_fatturapa.py on lines 82..84
l10n_it_fatturapa_out_wt/wizard/wizard_export_fatturapa.py on lines 133..136
l10n_it_reverse_charge/models/account_invoice.py on lines 207..210

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 33.

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 7 locations. Consider refactoring.
Open

            if not invoice.payment_term.fatturapa_pm_id:
                raise UserError(
                    _('Payment term %s does not have a linked e-invoice '
                      'payment method') % invoice.payment_term.name)
Severity: Major
Found in l10n_it_fatturapa_out_wt/wizard/wizard_export_fatturapa.py and 6 other locations - About 35 mins to fix
l10n_it_fatturapa_out/models/attachment.py on lines 36..39
l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py on lines 786..789
l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py on lines 790..793
l10n_it_fatturapa_out_ddt/wizard/wizard_export_fatturapa.py on lines 82..84
l10n_it_fatturapa_out_wt/wizard/wizard_export_fatturapa.py on lines 129..132
l10n_it_reverse_charge/models/account_invoice.py on lines 207..210

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 33.

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 5 locations. Consider refactoring.
Open

        self.journal_misc = self.env['account.journal'].search(
            [('type', '=', 'general')])[0]
Severity: Major
Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py and 4 other locations - About 35 mins to fix
l10n_it_fatturapa_out/tests/fatturapa_common.py on lines 27..28
l10n_it_fiscal_document_type/tests/test_doc_type.py on lines 12..13
l10n_it_ricevute_bancarie/tests/test_invoice_due_cost.py on lines 83..84
l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 47..48

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 33.

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 3 locations. Consider refactoring.
Open

            fatturapa_attachments = [x for x in message_dict['attachments']
                                     if fatturapa_regex.match(x[0])]
Severity: Minor
Found in l10n_it_fatturapa_pec/models/mail_thread.py and 2 other locations - About 35 mins to fix
l10n_it_fatturapa_pec/models/fatturapa_attachment_out.py on lines 118..119
l10n_it_fatturapa_pec/models/mail_thread.py on lines 71..72

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 33.

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 3 locations. Consider refactoring.
Open

            response_attachments = [x for x in message_dict['attachments']
                                    if response_regex.match(x[0])]
Severity: Minor
Found in l10n_it_fatturapa_pec/models/mail_thread.py and 2 other locations - About 35 mins to fix
l10n_it_fatturapa_pec/models/fatturapa_attachment_out.py on lines 118..119
l10n_it_fatturapa_pec/models/mail_thread.py on lines 69..70

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 33.

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.account_tax_code_22_credit = self.tax_code_model.create({
            'name': '22% credit',
            'vat_statement_type': 'credit',
            'vat_statement_account_id': self.env.ref('account.iva').id,
Severity: Minor
Found in account_vat_period_end_statement/tests/test_vat_statement.py and 1 other location - About 35 mins to fix
account_vat_period_end_statement/tests/test_vat_statement.py on lines 32..35

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 33.

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 6 locations. Consider refactoring.
Open

        self.wt_account_receivable = self.env['account.account'].create({
            'name': 'Crediti per ritenute da versare',
            'code': 'WT_003',
            'user_type': type_receivable.id,
            'reconcile': True,
Severity: Major
Found in l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py and 5 other locations - About 35 mins to fix
l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 13..17
l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 19..23
l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 17..21
l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 23..27
l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 35..39

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 33.

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.account_tax_22 = self.tax_model.create({
            'name': '22%',
            'amount': 0.22,
            'tax_code_id': self.account_tax_code_22.id,
            'base_code_id': self.account_tax_code_22_imp.id,
Severity: Minor
Found in account_vat_period_end_statement/tests/test_vat_statement.py and 1 other location - About 35 mins to fix
account_vat_period_end_statement/tests/test_vat_statement.py on lines 55..59

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 33.

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 len(res) > 1:
                raise UserError(
                    _("File %s already present.") %
                    att.datas_fname)
Severity: Minor
Found in l10n_it_fatturapa_out/models/attachment.py and 1 other location - About 35 mins to fix
l10n_it_causali_pagamento/models/causale_pagamento.py on lines 16..19

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 33.

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

        invoice2 = self.inv_model.create({
            'partner_id': self.partner3.id,
            'account_id': self.env.ref('account.a_recv').id,
Severity: Minor
Found in l10n_it_fiscal_document_type/tests/test_doc_type.py and 1 other location - About 35 mins to fix
l10n_it_fiscal_document_type/tests/test_doc_type.py on lines 20..22

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 33.

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 7 locations. Consider refactoring.
Open

            if not invoice.payment_term.fatturapa_pm_id:
                raise UserError(
                    _('Payment term %s does not have a linked e-invoice '
                      'payment method') % invoice.payment_term.name)
Severity: Major
Found in l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py and 6 other locations - About 35 mins to fix
l10n_it_fatturapa_out/models/attachment.py on lines 36..39
l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py on lines 786..789
l10n_it_fatturapa_out_ddt/wizard/wizard_export_fatturapa.py on lines 82..84
l10n_it_fatturapa_out_wt/wizard/wizard_export_fatturapa.py on lines 129..132
l10n_it_fatturapa_out_wt/wizard/wizard_export_fatturapa.py on lines 133..136
l10n_it_reverse_charge/models/account_invoice.py on lines 207..210

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 33.

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 6 locations. Consider refactoring.
Open

        self.wt_account_payable = self.env['account.account'].create({
            'name': 'Debiti per ritenute da versare',
            'code': 'WT_001',
            'user_type': type_payable.id,
            'reconcile': True,
Severity: Major
Found in l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py and 5 other locations - About 35 mins to fix
l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 13..17
l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 19..23
l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 23..27
l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 29..33
l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 35..39

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 33.

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

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

        for period in period_obj.browse(
            self.cr, self.uid,
            self.localcontext['data']['form']['period_ids']
Severity: Minor
Found in l10n_it_vat_registries/vat_registry.py and 1 other location - About 35 mins to fix
l10n_it_vat_registries/vat_registry.py on lines 234..236

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 33.

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

        invoice = self.inv_model.create({
            'partner_id': self.partner3.id,
            'account_id': self.env.ref('account.a_recv').id,
Severity: Minor
Found in l10n_it_fiscal_document_type/tests/test_doc_type.py and 1 other location - About 35 mins to fix
l10n_it_fiscal_document_type/tests/test_doc_type.py on lines 27..29

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 33.

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 6 locations. Consider refactoring.
Open

        self.wt_account_payable = self.env['account.account'].create({
            'name': 'Debiti per ritenute da versare',
            'code': 'WT_001',
            'user_type': type_payable.id,
            'reconcile': True,
Severity: Major
Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py and 5 other locations - About 35 mins to fix
l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 19..23
l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 17..21
l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 23..27
l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 29..33
l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 35..39

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 33.

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