OCA/l10n-italy

View on GitHub

Showing 820 of 1,161 total issues

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

        account_move_ids = pool.get('account.move').search(cr, uid, [
                                ('period_id', 'in', period_ids),
                                ('date', '<', fyc.closing_fiscalyear_id.date_start),
Severity: Minor
Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 40 mins to fix
account_fiscal_year_closing/wizard/wizard_run.py on lines 160..162

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

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 TaxRappresentative:
                    tax_partner_id = self.getPartnerBase(
                        TaxRappresentative.DatiAnagrafici, supplier=False)
                    invoice.write(
                        {
Severity: Minor
Found in l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py and 1 other location - About 40 mins to fix
l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py on lines 1446..1450

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

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

    def _get_effects_account_id(self, cr, uid, context=None):
        return self.pool.get(
            'riba.configuration'
        ).get_default_value_by_list_line(
            cr, uid, 'acceptance_account_id', context=context)
Severity: Major
Found in l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py and 9 other locations - About 40 mins to fix
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 31..35
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 37..41
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 43..47
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 49..53
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 30..34
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 51..55
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 57..61
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 63..67
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 69..73

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

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

            if pain_flavor in pain_03_to_05:
                nb_of_transactions_2_4.text = str(transactions_count_2_4)
                control_sum_2_5.text = '%.2f' % amount_control_sum_2_5
Severity: Minor
Found in l10n_it_sepa_bonifici/wizard/export_sepa_cbi_estero.py and 1 other location - About 40 mins to fix
l10n_it_sepa_bonifici/wizard/export_sepa_cbi.py on lines 244..246

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

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_move_ids = pool.get('account.move').search(cr, uid, [
                                ('period_id', 'in', period_ids),
                                ('state', '=', 'draft'),
Severity: Minor
Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 40 mins to fix
account_fiscal_year_closing/wizard/wizard_run.py on lines 230..232

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

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.product_id == self.product1:
                self.assertTrue(line.product_uom_qty in [1, 2])
Severity: Minor
Found in l10n_it_ddt/tests/test_ddt.py and 1 other location - About 40 mins to fix
l10n_it_ddt/tests/test_ddt.py on lines 154..155

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

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

    def _get_accreditation_journal_id(self, cr, uid, context=None):
        return self.pool.get(
            'riba.configuration'
        ).get_default_value_by_list(
            cr, uid, 'accreditation_journal_id', context=context)
Severity: Major
Found in l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py and 9 other locations - About 40 mins to fix
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 37..41
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 43..47
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 49..53
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 30..34
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 36..40
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 51..55
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 57..61
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 63..67
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 69..73

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

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_move_ids.extend(pool.get('account.move').search(cr, uid, [
                                ('period_id', 'in', period_ids),
                                ('date', '>', fyc.closing_fiscalyear_id.date_stop),
Severity: Minor
Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 40 mins to fix
account_fiscal_year_closing/wizard/wizard_run.py on lines 154..156

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

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

    def _get_bank_expense_account_id(self, cr, uid, context=None):
        return self.pool.get(
            'riba.configuration'
        ).get_default_value_by_list(
            cr, uid, 'bank_expense_account_id', context=context)
Severity: Major
Found in l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py and 9 other locations - About 40 mins to fix
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 31..35
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 37..41
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 43..47
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 30..34
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 36..40
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 51..55
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 57..61
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 63..67
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 69..73

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

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

    def _get_bank_expense_account_id(self, cr, uid, context=None):
        return self.pool.get(
            'riba.configuration'
        ).get_default_value_by_list_line(
            cr, uid, 'protest_charge_account_id', context=context)
Severity: Major
Found in l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py and 9 other locations - About 40 mins to fix
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 31..35
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 37..41
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 43..47
l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py on lines 49..53
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 30..34
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 36..40
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 51..55
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 57..61
l10n_it_ricevute_bancarie/wizard/wizard_unsolved.py on lines 63..67

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

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 company.fatturapa_sender_partner.vat:
                raise UserError(
                    _('Partner %s TIN not set.')
                    % company.fatturapa_sender_partner.display_name
Severity: Major
Found in l10n_it_fatturapa_out/models/attachment.py and 6 other locations - About 35 mins to fix
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_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_enasarco = self.env['account.account'].create({
            'name': 'Debiti per Enasarco',
            'code': 'WT_002',
            '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 17..21
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

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

        self.journalrec = self.env['account.journal'].search(
            [('type', '=', 'sale')])[0]
Severity: Major
Found in l10n_it_fiscal_document_type/tests/test_doc_type.py and 4 other locations - About 35 mins to fix
l10n_it_fatturapa_out/tests/fatturapa_common.py on lines 27..28
l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 25..26
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

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

    def _compute_display_name(self):
        self.display_name = \
            self.partner_id.name + ' - ' + self.withholding_tax_id.name
Severity: Minor
Found in l10n_it_withholding_tax/models/withholding_tax.py and 1 other location - About 35 mins to fix
l10n_it_withholding_tax/models/withholding_tax.py on lines 275..277

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

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

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 = self.tax_code_model.create({
            'name': '22%',
            'vat_statement_type': 'debit',
            'vat_statement_account_id': self.env.ref('account.ova').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 40..43

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_withholding_tax/tests/test_invoice_multi_line_tax.py and 4 other locations - About 35 mins to fix
l10n_it_fatturapa_out/tests/fatturapa_common.py on lines 27..28
l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 25..26
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

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.journalrec = self.env['account.journal'].search(
            [('type', '=', 'sale')])[0]
Severity: Major
Found in l10n_it_ricevute_bancarie/tests/test_invoice_due_cost.py and 4 other locations - About 35 mins to fix
l10n_it_fatturapa_out/tests/fatturapa_common.py on lines 27..28
l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 25..26
l10n_it_fiscal_document_type/tests/test_doc_type.py on lines 12..13
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 6 locations. Consider refactoring.
Open

        self.wt_account_receivable = self.env['account.account'].create({
            'name': 'Crediti per ritenute subite',
            'code': 'WT_002',
            'user_type': type_receivable.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 13..17
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

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

    @api.onchange('type')
    def on_type_changed(self):
        if self.type:
            if self.type == 'supplier':
                self.tax_sign = -1
Severity: Minor
Found in l10n_it_vat_registries/wizard/print_registro_iva.py and 1 other location - About 35 mins to fix
l10n_it_vat_registries/wizard/print_registro_iva.py on lines 78..82

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