OCA/l10n-italy

View on GitHub
l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py

Summary

Maintainability
F
2 wks
Test Coverage

File test_fatturapa_wt.py has 340 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from openerp.addons.l10n_it_fatturapa_out.tests.fatturapa_common import (
    FatturaPACommon)


class TestInvoiceWT(FatturaPACommon):
Severity: Minor
Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py - About 4 hrs to fix

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

        def test_e_invoice_wt_enas_1(self):
            """
            Fill DatiCassaPrevidenziale with Enasarco data
            """
            self.set_sequences(15, '2019')
    Severity: Major
    Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py and 3 other locations - About 2 days to fix
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 201..243
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 285..326
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 329..371

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

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

        def test_e_invoice_wt_enas_2(self):
            """
            Fill DatiCassaPrevidenziale with Enasarco data,
            when DatiRiepilogo already has 0 VAT
            """
    Severity: Major
    Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py and 3 other locations - About 2 days to fix
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 157..198
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 285..326
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 329..371

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

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

        def test_e_invoice_wt_inps_1(self):
            """
            Fill DatiCassaPrevidenziale with INPS data
            """
            self.set_sequences(18, '2019')
    Severity: Major
    Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py and 3 other locations - About 2 days to fix
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 157..198
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 201..243
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 329..371

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

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

        def test_e_invoice_wt_inps_2(self):
            """
            Fill DatiCassaPrevidenziale with INPS data,
            when DatiRiepilogo already has 0 VAT
            """
    Severity: Major
    Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py and 3 other locations - About 2 days to fix
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 157..198
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 201..243
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 285..326

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

    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 test_e_invoice_wt_enas_0(self):
            self.set_sequences(14, '2019')
            invoice = self.invoice_model.create({
                'date_invoice': '2019-01-07',
                'partner_id': self.res_partner_fatturapa_2.id,
    Severity: Major
    Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py and 1 other location - About 1 day to fix
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 246..282

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

    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 test_e_invoice_wt_inps_0(self):
            self.set_sequences(17, '2019')
            invoice = self.invoice_model.create({
                'date_invoice': '2019-01-07',
                'partner_id': self.res_partner_fatturapa_2.id,
    Severity: Major
    Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py and 1 other location - About 1 day to fix
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 118..154

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

    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

            wt_vals = {
                'name': 'INPS',
                'code': 'INPS',
                'account_receivable_id': self.wt_account_receivable.id,
                'account_payable_id': self.wt_account_payable.id,
    Severity: Major
    Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py and 1 other location - About 3 hrs to fix
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 49..61

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

    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

            wt_vals = {
                'name': 'Enasarco',
                'code': 'Enasarco',
                'account_receivable_id': self.wt_account_receivable.id,
                'account_payable_id': self.wt_account_payable.id,
    Severity: Major
    Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py and 1 other location - About 3 hrs to fix
    l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 65..77

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

    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

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

    There are no issues that match your filters.

    Category
    Status