OCA/l10n-italy

View on GitHub
l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py

Summary

Maintainability
F
3 days
Test Coverage

Function test_20_partial_payment has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def test_20_partial_payment(self):
        self.assertEqual(self.invoice.amount_net_pay, 1164)
        # pay partially
        res = self.invoice.invoice_pay_customer()
        vals = {
Severity: Minor
Found in l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py - About 1 hr to fix

    Function test_10_withholding_tax has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def test_10_withholding_tax(self):
            domain = [('name', '=', 'Provision')]
            wts = self.env['withholding.tax'].search(domain)
            self.assertEqual(len(wts), 1, msg="Withholding tax was not created")
    
    
    Severity: Minor
    Found in l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py - About 1 hr to fix

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

              vals = {
                  'partner_id': res['context']['default_partner_id'],
                  'amount': res['context']['default_amount'],
                  'reference': res['context']['default_reference'],
                  'type': res['context']['default_type'],
      l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 205..211
      l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 254..260

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

      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

              vals = {
                  'partner_id': res['context']['default_partner_id'],
                  'amount': res['context']['default_amount'],
                  'reference': res['context']['default_reference'],
                  'type': res['context']['default_type'],
      l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 155..161
      l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 254..260

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

      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

              vals1 = {
                  'partner_id': res1['context']['default_partner_id'],
                  'amount': res1['context']['default_amount'],
                  'reference': res1['context']['default_reference'],
                  'type': res1['context']['default_type'],
      l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 155..161
      l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 205..211

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 77.

      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

              vals1.update(self.voucher_model.with_context(
                  res1['context']
              ).recompute_voucher_lines(
                  self.invoice.partner_id.id, self.bank_journal.id,
                  res1['context']['default_amount'] / 2, self.invoice.currency_id.id,
      Severity: Major
      Found in l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py and 1 other location - About 4 hrs to fix
      l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 213..218

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

      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

              vals.update(self.voucher_model.with_context(
                  res['context']
              ).recompute_voucher_lines(
                  self.invoice.partner_id.id, self.bank_journal.id,
                  res['context']['default_amount'] / 2, self.invoice.currency_id.id,
      Severity: Major
      Found in l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py and 1 other location - About 4 hrs to fix
      l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 262..267

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

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

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

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

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

      Refactorings

      Further Reading

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

              self.assertTrue(
                  set(payment_1.move_id.line_id.mapped('debit')) ==
                  set([0, 5, 1164, 23, 0])
      l10n_it_withholding_tax/tests/test_invoice_multi_line_tax.py on lines 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 39.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 39.

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

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

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

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

      Refactorings

      Further Reading

      Similar blocks of code found in 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.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 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 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

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

              self.wt_account_rec_enasarco = self.env['account.account'].create({
                  'name': 'Crediti per Enasarco',
                  'code': 'WT_004',
                  '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 29..33

      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