Trust-Code/odoo-brasil

View on GitHub
br_account/models/account_invoice_line.py

Summary

Maintainability
F
1 wk
Test Coverage

File account_invoice_line.py has 555 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
# © 2009 Renato Lima - Akretion
# © 2016 Danimar Ribeiro, Trustcode
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

Severity: Major
Found in br_account/models/account_invoice_line.py - About 1 day to fix

    Function _compute_price has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        def _compute_price(self):
            currency = self.invoice_id and self.invoice_id.currency_id or None
            price = self.price_unit * (1 - (self.discount or 0.0) / 100.0)
    
            valor_bruto = self.price_unit * self.quantity
    Severity: Minor
    Found in br_account/models/account_invoice_line.py - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    AccountInvoiceLine has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class AccountInvoiceLine(models.Model):
        _inherit = 'account.invoice.line'
    
        @api.model
        def _default_company_fiscal_type(self):
    Severity: Minor
    Found in br_account/models/account_invoice_line.py - About 2 hrs to fix

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

          def _compute_price(self):
              currency = self.invoice_id and self.invoice_id.currency_id or None
              price = self.price_unit * (1 - (self.discount or 0.0) / 100.0)
      
              valor_bruto = self.price_unit * self.quantity
      Severity: Minor
      Found in br_account/models/account_invoice_line.py - About 1 hr to fix

        Function _set_taxes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def _set_taxes(self):
                super(AccountInvoiceLine, self)._set_taxes()
                self._update_tax_from_ncm()
                fpos = self.invoice_id.fiscal_position_id
                if fpos:
        Severity: Minor
        Found in br_account/models/account_invoice_line.py - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

                self.invoice_line_tax_ids = other_taxes | self.tax_icms_id | \
                    self.tax_icms_st_id | self.tax_icms_inter_id | \
                    self.tax_icms_intra_id | self.tax_icms_fcp_id | \
                    self.tax_simples_id | self.tax_ipi_id | self.tax_pis_id | \
                    self.tax_cofins_id | self.tax_issqn_id | self.tax_ii_id | \
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 1 other location - About 5 hrs to fix
        br_account/models/account_invoice.py on lines 381..385

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

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

                irrf = ([x for x in taxes['taxes']
                         if x['id'] == self.tax_irrf_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 85..86
        br_account/models/account_invoice_line.py on lines 87..88
        br_account/models/account_invoice_line.py on lines 89..91
        br_account/models/account_invoice_line.py on lines 92..94
        br_account/models/account_invoice_line.py on lines 95..96
        br_account/models/account_invoice_line.py on lines 97..98
        br_account/models/account_invoice_line.py on lines 99..100
        br_account/models/account_invoice_line.py on lines 101..102
        br_account/models/account_invoice_line.py on lines 103..104
        br_account/models/account_invoice_line.py on lines 105..106
        br_account/models/account_invoice_line.py on lines 107..108
        br_account/models/account_invoice_line.py on lines 109..110
        br_account/models/account_invoice_line.py on lines 113..114

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

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

                inss = ([x for x in taxes['taxes']
                         if x['id'] == self.tax_inss_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 85..86
        br_account/models/account_invoice_line.py on lines 87..88
        br_account/models/account_invoice_line.py on lines 89..91
        br_account/models/account_invoice_line.py on lines 92..94
        br_account/models/account_invoice_line.py on lines 95..96
        br_account/models/account_invoice_line.py on lines 97..98
        br_account/models/account_invoice_line.py on lines 99..100
        br_account/models/account_invoice_line.py on lines 101..102
        br_account/models/account_invoice_line.py on lines 103..104
        br_account/models/account_invoice_line.py on lines 105..106
        br_account/models/account_invoice_line.py on lines 107..108
        br_account/models/account_invoice_line.py on lines 109..110
        br_account/models/account_invoice_line.py on lines 111..112

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

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

                cofins = ([x for x in taxes['taxes']
                           if x['id'] == self.tax_cofins_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 85..86
        br_account/models/account_invoice_line.py on lines 87..88
        br_account/models/account_invoice_line.py on lines 89..91
        br_account/models/account_invoice_line.py on lines 92..94
        br_account/models/account_invoice_line.py on lines 95..96
        br_account/models/account_invoice_line.py on lines 97..98
        br_account/models/account_invoice_line.py on lines 99..100
        br_account/models/account_invoice_line.py on lines 101..102
        br_account/models/account_invoice_line.py on lines 105..106
        br_account/models/account_invoice_line.py on lines 107..108
        br_account/models/account_invoice_line.py on lines 109..110
        br_account/models/account_invoice_line.py on lines 111..112
        br_account/models/account_invoice_line.py on lines 113..114

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

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

                ii = ([x for x in taxes['taxes']
                       if x['id'] == self.tax_ii_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 85..86
        br_account/models/account_invoice_line.py on lines 87..88
        br_account/models/account_invoice_line.py on lines 89..91
        br_account/models/account_invoice_line.py on lines 92..94
        br_account/models/account_invoice_line.py on lines 95..96
        br_account/models/account_invoice_line.py on lines 97..98
        br_account/models/account_invoice_line.py on lines 99..100
        br_account/models/account_invoice_line.py on lines 101..102
        br_account/models/account_invoice_line.py on lines 103..104
        br_account/models/account_invoice_line.py on lines 105..106
        br_account/models/account_invoice_line.py on lines 109..110
        br_account/models/account_invoice_line.py on lines 111..112
        br_account/models/account_invoice_line.py on lines 113..114

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

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

                icms_inter = (
                    [x for x in taxes['taxes']
                     if x['id'] == self.tax_icms_inter_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 85..86
        br_account/models/account_invoice_line.py on lines 87..88
        br_account/models/account_invoice_line.py on lines 92..94
        br_account/models/account_invoice_line.py on lines 95..96
        br_account/models/account_invoice_line.py on lines 97..98
        br_account/models/account_invoice_line.py on lines 99..100
        br_account/models/account_invoice_line.py on lines 101..102
        br_account/models/account_invoice_line.py on lines 103..104
        br_account/models/account_invoice_line.py on lines 105..106
        br_account/models/account_invoice_line.py on lines 107..108
        br_account/models/account_invoice_line.py on lines 109..110
        br_account/models/account_invoice_line.py on lines 111..112
        br_account/models/account_invoice_line.py on lines 113..114

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

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

                icms_fcp = ([x for x in taxes['taxes']
                             if x['id'] == self.tax_icms_fcp_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 85..86
        br_account/models/account_invoice_line.py on lines 87..88
        br_account/models/account_invoice_line.py on lines 89..91
        br_account/models/account_invoice_line.py on lines 92..94
        br_account/models/account_invoice_line.py on lines 97..98
        br_account/models/account_invoice_line.py on lines 99..100
        br_account/models/account_invoice_line.py on lines 101..102
        br_account/models/account_invoice_line.py on lines 103..104
        br_account/models/account_invoice_line.py on lines 105..106
        br_account/models/account_invoice_line.py on lines 107..108
        br_account/models/account_invoice_line.py on lines 109..110
        br_account/models/account_invoice_line.py on lines 111..112
        br_account/models/account_invoice_line.py on lines 113..114

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

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

                csll = ([x for x in taxes['taxes']
                         if x['id'] == self.tax_csll_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 85..86
        br_account/models/account_invoice_line.py on lines 87..88
        br_account/models/account_invoice_line.py on lines 89..91
        br_account/models/account_invoice_line.py on lines 92..94
        br_account/models/account_invoice_line.py on lines 95..96
        br_account/models/account_invoice_line.py on lines 97..98
        br_account/models/account_invoice_line.py on lines 99..100
        br_account/models/account_invoice_line.py on lines 101..102
        br_account/models/account_invoice_line.py on lines 103..104
        br_account/models/account_invoice_line.py on lines 105..106
        br_account/models/account_invoice_line.py on lines 107..108
        br_account/models/account_invoice_line.py on lines 111..112
        br_account/models/account_invoice_line.py on lines 113..114

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

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

                issqn = ([x for x in taxes['taxes']
                          if x['id'] == self.tax_issqn_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 85..86
        br_account/models/account_invoice_line.py on lines 87..88
        br_account/models/account_invoice_line.py on lines 89..91
        br_account/models/account_invoice_line.py on lines 92..94
        br_account/models/account_invoice_line.py on lines 95..96
        br_account/models/account_invoice_line.py on lines 97..98
        br_account/models/account_invoice_line.py on lines 99..100
        br_account/models/account_invoice_line.py on lines 101..102
        br_account/models/account_invoice_line.py on lines 103..104
        br_account/models/account_invoice_line.py on lines 107..108
        br_account/models/account_invoice_line.py on lines 109..110
        br_account/models/account_invoice_line.py on lines 111..112
        br_account/models/account_invoice_line.py on lines 113..114

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

        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

                    for key, value in vals.iteritems():
                        if value and key in self._fields:
                            self.update({key: value})
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 3 other locations - About 1 hr to fix
        br_point_sale/models/pos_order.py on lines 63..65
        br_purchase/models/purchase.py on lines 191..193
        br_sale/models/sale.py on lines 206..208

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

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

                icmsst = ([x for x in taxes['taxes']
                           if x['id'] == self.tax_icms_st_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 85..86
        br_account/models/account_invoice_line.py on lines 89..91
        br_account/models/account_invoice_line.py on lines 92..94
        br_account/models/account_invoice_line.py on lines 95..96
        br_account/models/account_invoice_line.py on lines 97..98
        br_account/models/account_invoice_line.py on lines 99..100
        br_account/models/account_invoice_line.py on lines 101..102
        br_account/models/account_invoice_line.py on lines 103..104
        br_account/models/account_invoice_line.py on lines 105..106
        br_account/models/account_invoice_line.py on lines 107..108
        br_account/models/account_invoice_line.py on lines 109..110
        br_account/models/account_invoice_line.py on lines 111..112
        br_account/models/account_invoice_line.py on lines 113..114

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

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

                ipi = ([x for x in taxes['taxes']
                        if x['id'] == self.tax_ipi_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 85..86
        br_account/models/account_invoice_line.py on lines 87..88
        br_account/models/account_invoice_line.py on lines 89..91
        br_account/models/account_invoice_line.py on lines 92..94
        br_account/models/account_invoice_line.py on lines 95..96
        br_account/models/account_invoice_line.py on lines 97..98
        br_account/models/account_invoice_line.py on lines 101..102
        br_account/models/account_invoice_line.py on lines 103..104
        br_account/models/account_invoice_line.py on lines 105..106
        br_account/models/account_invoice_line.py on lines 107..108
        br_account/models/account_invoice_line.py on lines 109..110
        br_account/models/account_invoice_line.py on lines 111..112
        br_account/models/account_invoice_line.py on lines 113..114

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

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

                simples = ([x for x in taxes['taxes']
                            if x['id'] == self.tax_simples_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 85..86
        br_account/models/account_invoice_line.py on lines 87..88
        br_account/models/account_invoice_line.py on lines 89..91
        br_account/models/account_invoice_line.py on lines 92..94
        br_account/models/account_invoice_line.py on lines 95..96
        br_account/models/account_invoice_line.py on lines 99..100
        br_account/models/account_invoice_line.py on lines 101..102
        br_account/models/account_invoice_line.py on lines 103..104
        br_account/models/account_invoice_line.py on lines 105..106
        br_account/models/account_invoice_line.py on lines 107..108
        br_account/models/account_invoice_line.py on lines 109..110
        br_account/models/account_invoice_line.py on lines 111..112
        br_account/models/account_invoice_line.py on lines 113..114

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

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

                pis = ([x for x in taxes['taxes']
                        if x['id'] == self.tax_pis_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 85..86
        br_account/models/account_invoice_line.py on lines 87..88
        br_account/models/account_invoice_line.py on lines 89..91
        br_account/models/account_invoice_line.py on lines 92..94
        br_account/models/account_invoice_line.py on lines 95..96
        br_account/models/account_invoice_line.py on lines 97..98
        br_account/models/account_invoice_line.py on lines 99..100
        br_account/models/account_invoice_line.py on lines 103..104
        br_account/models/account_invoice_line.py on lines 105..106
        br_account/models/account_invoice_line.py on lines 107..108
        br_account/models/account_invoice_line.py on lines 109..110
        br_account/models/account_invoice_line.py on lines 111..112
        br_account/models/account_invoice_line.py on lines 113..114

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

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

                icms = ([x for x in taxes['taxes']
                         if x['id'] == self.tax_icms_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 87..88
        br_account/models/account_invoice_line.py on lines 89..91
        br_account/models/account_invoice_line.py on lines 92..94
        br_account/models/account_invoice_line.py on lines 95..96
        br_account/models/account_invoice_line.py on lines 97..98
        br_account/models/account_invoice_line.py on lines 99..100
        br_account/models/account_invoice_line.py on lines 101..102
        br_account/models/account_invoice_line.py on lines 103..104
        br_account/models/account_invoice_line.py on lines 105..106
        br_account/models/account_invoice_line.py on lines 107..108
        br_account/models/account_invoice_line.py on lines 109..110
        br_account/models/account_invoice_line.py on lines 111..112
        br_account/models/account_invoice_line.py on lines 113..114

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

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

                icms_intra = (
                    [x for x in taxes['taxes']
                     if x['id'] == self.tax_icms_intra_id.id]) if taxes else []
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 13 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 85..86
        br_account/models/account_invoice_line.py on lines 87..88
        br_account/models/account_invoice_line.py on lines 89..91
        br_account/models/account_invoice_line.py on lines 95..96
        br_account/models/account_invoice_line.py on lines 97..98
        br_account/models/account_invoice_line.py on lines 99..100
        br_account/models/account_invoice_line.py on lines 101..102
        br_account/models/account_invoice_line.py on lines 103..104
        br_account/models/account_invoice_line.py on lines 105..106
        br_account/models/account_invoice_line.py on lines 107..108
        br_account/models/account_invoice_line.py on lines 109..110
        br_account/models/account_invoice_line.py on lines 111..112
        br_account/models/account_invoice_line.py on lines 113..114

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

        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

            @api.onchange('tax_icms_st_id')
            def _onchange_tax_icms_st_id(self):
                if self.tax_icms_st_id:
                    self.icms_st_aliquota = self.tax_icms_st_id.amount
                self._update_invoice_line_ids()
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 9 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 576..580
        br_account/models/account_invoice_line.py on lines 604..608
        br_account/models/account_invoice_line.py on lines 610..614
        br_account/models/account_invoice_line.py on lines 616..620
        br_account/models/account_invoice_line.py on lines 622..626
        br_account/models/account_invoice_line.py on lines 628..632
        br_account/models/account_invoice_line.py on lines 634..638
        br_account/models/account_invoice_line.py on lines 640..644
        br_account/models/account_invoice_line.py on lines 646..650

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 38.

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

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

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

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

        Refactorings

        Further Reading

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

            @api.onchange('tax_irrf_id')
            def _onchange_tax_irrf_id(self):
                if self.tax_irrf_id:
                    self.irrf_aliquota = self.tax_irrf_id.amount
                self._update_invoice_line_ids()
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 9 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 576..580
        br_account/models/account_invoice_line.py on lines 582..586
        br_account/models/account_invoice_line.py on lines 604..608
        br_account/models/account_invoice_line.py on lines 610..614
        br_account/models/account_invoice_line.py on lines 616..620
        br_account/models/account_invoice_line.py on lines 622..626
        br_account/models/account_invoice_line.py on lines 628..632
        br_account/models/account_invoice_line.py on lines 634..638
        br_account/models/account_invoice_line.py on lines 646..650

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 38.

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

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

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

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

        Refactorings

        Further Reading

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

            @api.onchange('tax_icms_id')
            def _onchange_tax_icms_id(self):
                if self.tax_icms_id:
                    self.icms_aliquota = self.tax_icms_id.amount
                self._update_invoice_line_ids()
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 9 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 582..586
        br_account/models/account_invoice_line.py on lines 604..608
        br_account/models/account_invoice_line.py on lines 610..614
        br_account/models/account_invoice_line.py on lines 616..620
        br_account/models/account_invoice_line.py on lines 622..626
        br_account/models/account_invoice_line.py on lines 628..632
        br_account/models/account_invoice_line.py on lines 634..638
        br_account/models/account_invoice_line.py on lines 640..644
        br_account/models/account_invoice_line.py on lines 646..650

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 38.

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

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

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

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

        Refactorings

        Further Reading

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

            @api.onchange('tax_csll_id')
            def _onchange_tax_csll_id(self):
                if self.tax_csll_id:
                    self.csll_aliquota = self.tax_csll_id.amount
                self._update_invoice_line_ids()
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 9 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 576..580
        br_account/models/account_invoice_line.py on lines 582..586
        br_account/models/account_invoice_line.py on lines 604..608
        br_account/models/account_invoice_line.py on lines 610..614
        br_account/models/account_invoice_line.py on lines 616..620
        br_account/models/account_invoice_line.py on lines 622..626
        br_account/models/account_invoice_line.py on lines 628..632
        br_account/models/account_invoice_line.py on lines 640..644
        br_account/models/account_invoice_line.py on lines 646..650

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 38.

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

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

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

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

        Refactorings

        Further Reading

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

            @api.onchange('tax_cofins_id')
            def _onchange_tax_cofins_id(self):
                if self.tax_cofins_id:
                    self.cofins_aliquota = self.tax_cofins_id.amount
                self._update_invoice_line_ids()
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 9 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 576..580
        br_account/models/account_invoice_line.py on lines 582..586
        br_account/models/account_invoice_line.py on lines 604..608
        br_account/models/account_invoice_line.py on lines 616..620
        br_account/models/account_invoice_line.py on lines 622..626
        br_account/models/account_invoice_line.py on lines 628..632
        br_account/models/account_invoice_line.py on lines 634..638
        br_account/models/account_invoice_line.py on lines 640..644
        br_account/models/account_invoice_line.py on lines 646..650

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 38.

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

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

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

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

        Refactorings

        Further Reading

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

            @api.onchange('tax_ii_id')
            def _onchange_tax_ii_id(self):
                if self.tax_ii_id:
                    self.ii_aliquota = self.tax_ii_id.amount
                self._update_invoice_line_ids()
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 9 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 576..580
        br_account/models/account_invoice_line.py on lines 582..586
        br_account/models/account_invoice_line.py on lines 604..608
        br_account/models/account_invoice_line.py on lines 610..614
        br_account/models/account_invoice_line.py on lines 616..620
        br_account/models/account_invoice_line.py on lines 628..632
        br_account/models/account_invoice_line.py on lines 634..638
        br_account/models/account_invoice_line.py on lines 640..644
        br_account/models/account_invoice_line.py on lines 646..650

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 38.

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

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

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

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

        Refactorings

        Further Reading

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

            @api.onchange('tax_issqn_id')
            def _onchange_tax_issqn_id(self):
                if self.tax_issqn_id:
                    self.issqn_aliquota = self.tax_issqn_id.amount
                self._update_invoice_line_ids()
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 9 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 576..580
        br_account/models/account_invoice_line.py on lines 582..586
        br_account/models/account_invoice_line.py on lines 604..608
        br_account/models/account_invoice_line.py on lines 610..614
        br_account/models/account_invoice_line.py on lines 616..620
        br_account/models/account_invoice_line.py on lines 622..626
        br_account/models/account_invoice_line.py on lines 634..638
        br_account/models/account_invoice_line.py on lines 640..644
        br_account/models/account_invoice_line.py on lines 646..650

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 38.

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

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

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

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

        Refactorings

        Further Reading

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

            @api.onchange('tax_ipi_id')
            def _onchange_tax_ipi_id(self):
                if self.tax_ipi_id:
                    self.ipi_aliquota = self.tax_ipi_id.amount
                self._update_invoice_line_ids()
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 9 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 576..580
        br_account/models/account_invoice_line.py on lines 582..586
        br_account/models/account_invoice_line.py on lines 604..608
        br_account/models/account_invoice_line.py on lines 610..614
        br_account/models/account_invoice_line.py on lines 622..626
        br_account/models/account_invoice_line.py on lines 628..632
        br_account/models/account_invoice_line.py on lines 634..638
        br_account/models/account_invoice_line.py on lines 640..644
        br_account/models/account_invoice_line.py on lines 646..650

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 38.

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

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

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

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

        Refactorings

        Further Reading

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

            @api.onchange('tax_pis_id')
            def _onchange_tax_pis_id(self):
                if self.tax_pis_id:
                    self.pis_aliquota = self.tax_pis_id.amount
                self._update_invoice_line_ids()
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 9 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 576..580
        br_account/models/account_invoice_line.py on lines 582..586
        br_account/models/account_invoice_line.py on lines 610..614
        br_account/models/account_invoice_line.py on lines 616..620
        br_account/models/account_invoice_line.py on lines 622..626
        br_account/models/account_invoice_line.py on lines 628..632
        br_account/models/account_invoice_line.py on lines 634..638
        br_account/models/account_invoice_line.py on lines 640..644
        br_account/models/account_invoice_line.py on lines 646..650

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 38.

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

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

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

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

        Refactorings

        Further Reading

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

            @api.onchange('tax_inss_id')
            def _onchange_tax_inss_id(self):
                if self.tax_inss_id:
                    self.inss_aliquota = self.tax_inss_id.amount
                self._update_invoice_line_ids()
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 9 other locations - About 1 hr to fix
        br_account/models/account_invoice_line.py on lines 576..580
        br_account/models/account_invoice_line.py on lines 582..586
        br_account/models/account_invoice_line.py on lines 604..608
        br_account/models/account_invoice_line.py on lines 610..614
        br_account/models/account_invoice_line.py on lines 616..620
        br_account/models/account_invoice_line.py on lines 622..626
        br_account/models/account_invoice_line.py on lines 628..632
        br_account/models/account_invoice_line.py on lines 634..638
        br_account/models/account_invoice_line.py on lines 640..644

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 38.

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

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

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

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

        Refactorings

        Further Reading

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

            inss_valor = fields.Float(
                u'Valor INSS', required=True, digits=dp.get_precision('Account'),
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 10 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 346..347
        br_account/models/account_invoice_line.py on lines 359..360
        br_account/models/account_invoice_line.py on lines 365..366
        br_account/models/account_invoice_line.py on lines 388..389
        br_account/models/account_invoice_line.py on lines 431..432
        br_account/models/account_invoice_line.py on lines 450..451
        br_account/models/account_invoice_line.py on lines 453..454
        br_account/models/account_invoice_line.py on lines 466..467
        br_account/models/account_invoice_line.py on lines 469..470
        br_account/models/account_invoice_line.py on lines 482..483

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

            ipi_base_calculo = fields.Float(
                'Base IPI', required=True, digits=dp.get_precision('Account'),
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 10 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 346..347
        br_account/models/account_invoice_line.py on lines 365..366
        br_account/models/account_invoice_line.py on lines 388..389
        br_account/models/account_invoice_line.py on lines 431..432
        br_account/models/account_invoice_line.py on lines 450..451
        br_account/models/account_invoice_line.py on lines 453..454
        br_account/models/account_invoice_line.py on lines 466..467
        br_account/models/account_invoice_line.py on lines 469..470
        br_account/models/account_invoice_line.py on lines 482..483
        br_account/models/account_invoice_line.py on lines 485..486

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

            csll_base_calculo = fields.Float(
                'Base CSLL', required=True, digits=dp.get_precision('Account'),
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 10 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 346..347
        br_account/models/account_invoice_line.py on lines 359..360
        br_account/models/account_invoice_line.py on lines 365..366
        br_account/models/account_invoice_line.py on lines 388..389
        br_account/models/account_invoice_line.py on lines 431..432
        br_account/models/account_invoice_line.py on lines 453..454
        br_account/models/account_invoice_line.py on lines 466..467
        br_account/models/account_invoice_line.py on lines 469..470
        br_account/models/account_invoice_line.py on lines 482..483
        br_account/models/account_invoice_line.py on lines 485..486

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

            inss_base_calculo = fields.Float(
                u'Base INSS', required=True, digits=dp.get_precision('Account'),
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 10 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 346..347
        br_account/models/account_invoice_line.py on lines 359..360
        br_account/models/account_invoice_line.py on lines 365..366
        br_account/models/account_invoice_line.py on lines 388..389
        br_account/models/account_invoice_line.py on lines 431..432
        br_account/models/account_invoice_line.py on lines 450..451
        br_account/models/account_invoice_line.py on lines 453..454
        br_account/models/account_invoice_line.py on lines 466..467
        br_account/models/account_invoice_line.py on lines 469..470
        br_account/models/account_invoice_line.py on lines 485..486

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

            ii_valor = fields.Float(
                'Valor II', required=True, digits=dp.get_precision('Account'),
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 10 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 346..347
        br_account/models/account_invoice_line.py on lines 359..360
        br_account/models/account_invoice_line.py on lines 365..366
        br_account/models/account_invoice_line.py on lines 388..389
        br_account/models/account_invoice_line.py on lines 450..451
        br_account/models/account_invoice_line.py on lines 453..454
        br_account/models/account_invoice_line.py on lines 466..467
        br_account/models/account_invoice_line.py on lines 469..470
        br_account/models/account_invoice_line.py on lines 482..483
        br_account/models/account_invoice_line.py on lines 485..486

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

            csll_valor = fields.Float(
                'Valor CSLL', required=True, digits=dp.get_precision('Account'),
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 10 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 346..347
        br_account/models/account_invoice_line.py on lines 359..360
        br_account/models/account_invoice_line.py on lines 365..366
        br_account/models/account_invoice_line.py on lines 388..389
        br_account/models/account_invoice_line.py on lines 431..432
        br_account/models/account_invoice_line.py on lines 450..451
        br_account/models/account_invoice_line.py on lines 466..467
        br_account/models/account_invoice_line.py on lines 469..470
        br_account/models/account_invoice_line.py on lines 482..483
        br_account/models/account_invoice_line.py on lines 485..486

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

            irrf_base_calculo = fields.Float(
                'Base IRRF', required=True, digits=dp.get_precision('Account'),
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 10 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 346..347
        br_account/models/account_invoice_line.py on lines 359..360
        br_account/models/account_invoice_line.py on lines 365..366
        br_account/models/account_invoice_line.py on lines 388..389
        br_account/models/account_invoice_line.py on lines 431..432
        br_account/models/account_invoice_line.py on lines 450..451
        br_account/models/account_invoice_line.py on lines 453..454
        br_account/models/account_invoice_line.py on lines 469..470
        br_account/models/account_invoice_line.py on lines 482..483
        br_account/models/account_invoice_line.py on lines 485..486

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

            irrf_valor = fields.Float(
                'Valor IRFF', required=True, digits=dp.get_precision('Account'),
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 10 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 346..347
        br_account/models/account_invoice_line.py on lines 359..360
        br_account/models/account_invoice_line.py on lines 365..366
        br_account/models/account_invoice_line.py on lines 388..389
        br_account/models/account_invoice_line.py on lines 431..432
        br_account/models/account_invoice_line.py on lines 450..451
        br_account/models/account_invoice_line.py on lines 453..454
        br_account/models/account_invoice_line.py on lines 466..467
        br_account/models/account_invoice_line.py on lines 482..483
        br_account/models/account_invoice_line.py on lines 485..486

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

            pis_valor = fields.Float(
                'Valor PIS', required=True, digits=dp.get_precision('Account'),
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 10 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 346..347
        br_account/models/account_invoice_line.py on lines 359..360
        br_account/models/account_invoice_line.py on lines 365..366
        br_account/models/account_invoice_line.py on lines 431..432
        br_account/models/account_invoice_line.py on lines 450..451
        br_account/models/account_invoice_line.py on lines 453..454
        br_account/models/account_invoice_line.py on lines 466..467
        br_account/models/account_invoice_line.py on lines 469..470
        br_account/models/account_invoice_line.py on lines 482..483
        br_account/models/account_invoice_line.py on lines 485..486

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

            ipi_valor = fields.Float(
                'Valor IPI', required=True, digits=dp.get_precision('Account'),
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 10 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 346..347
        br_account/models/account_invoice_line.py on lines 359..360
        br_account/models/account_invoice_line.py on lines 388..389
        br_account/models/account_invoice_line.py on lines 431..432
        br_account/models/account_invoice_line.py on lines 450..451
        br_account/models/account_invoice_line.py on lines 453..454
        br_account/models/account_invoice_line.py on lines 466..467
        br_account/models/account_invoice_line.py on lines 469..470
        br_account/models/account_invoice_line.py on lines 482..483
        br_account/models/account_invoice_line.py on lines 485..486

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

            issqn_valor = fields.Float(
                'Valor ISSQN', required=True, digits=dp.get_precision('Account'),
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 10 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 359..360
        br_account/models/account_invoice_line.py on lines 365..366
        br_account/models/account_invoice_line.py on lines 388..389
        br_account/models/account_invoice_line.py on lines 431..432
        br_account/models/account_invoice_line.py on lines 450..451
        br_account/models/account_invoice_line.py on lines 453..454
        br_account/models/account_invoice_line.py on lines 466..467
        br_account/models/account_invoice_line.py on lines 469..470
        br_account/models/account_invoice_line.py on lines 482..483
        br_account/models/account_invoice_line.py on lines 485..486

        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

            icms_st_valor = fields.Float(
                'Valor ICMS ST', required=True, compute='_compute_price', store=True,
                digits=dp.get_precision('Account'), default=0.00)
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 4 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 224..226
        br_account/models/account_invoice_line.py on lines 227..229
        br_account/models/account_invoice_line.py on lines 254..256
        br_account/models/account_invoice_line.py on lines 385..387

        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

            pis_base_calculo = fields.Float(
                'Base PIS', required=True, compute='_compute_price', store=True,
                digits=dp.get_precision('Account'), default=0.00)
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 4 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 224..226
        br_account/models/account_invoice_line.py on lines 227..229
        br_account/models/account_invoice_line.py on lines 251..253
        br_account/models/account_invoice_line.py on lines 254..256

        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

            icms_base_calculo = fields.Float(
                'Base ICMS', required=True, compute='_compute_price', store=True,
                digits=dp.get_precision('Account'), default=0.00)
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 4 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 227..229
        br_account/models/account_invoice_line.py on lines 251..253
        br_account/models/account_invoice_line.py on lines 254..256
        br_account/models/account_invoice_line.py on lines 385..387

        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

            icms_st_base_calculo = fields.Float(
                'Base ICMS ST', required=True, compute='_compute_price', store=True,
                digits=dp.get_precision('Account'), default=0.00)
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 4 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 224..226
        br_account/models/account_invoice_line.py on lines 227..229
        br_account/models/account_invoice_line.py on lines 251..253
        br_account/models/account_invoice_line.py on lines 385..387

        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

            icms_valor = fields.Float(
                'Valor ICMS', required=True, compute='_compute_price', store=True,
                digits=dp.get_precision('Account'), default=0.00)
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 4 other locations - About 35 mins to fix
        br_account/models/account_invoice_line.py on lines 224..226
        br_account/models/account_invoice_line.py on lines 251..253
        br_account/models/account_invoice_line.py on lines 254..256
        br_account/models/account_invoice_line.py on lines 385..387

        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

                price = self.price_unit * (1 - (self.discount or 0.0) / 100.0)
        Severity: Major
        Found in br_account/models/account_invoice_line.py and 6 other locations - About 30 mins to fix
        br_account/models/account_invoice.py on lines 337..338
        br_account/models/account_invoice.py on lines 390..390
        br_point_sale/models/pos_order.py on lines 216..216
        br_point_sale/models/pos_order.py on lines 287..287
        br_purchase/models/purchase.py on lines 79..79
        br_sale/models/sale.py on lines 84..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 32.

        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