Trust-Code/odoo-brasil

View on GitHub

Showing 421 of 421 total issues

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

            for key, value in values.iteritems():
                if value and key in line._fields:
                    line.update({key: value})
Severity: Major
Found in br_point_sale/models/pos_order.py and 3 other locations - About 1 hr to fix
br_account/models/account_invoice_line.py on lines 515..517
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 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

        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

        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

Function _compute_update_boletos has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def _compute_update_boletos(self):
        for item in self:
            if item.state != 'open':
                item.update_boleto = False
            else:
Severity: Minor
Found in br_boleto/models/account_invoice.py - About 1 hr 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 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

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

                for key, value in vals.iteritems():
                    if value and key in line._fields:
                        line.update({key: value})
Severity: Major
Found in br_purchase/models/purchase.py and 3 other locations - About 1 hr to fix
br_account/models/account_invoice_line.py on lines 515..517
br_point_sale/models/pos_order.py on lines 63..65
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 2 locations. Consider refactoring.
Open

        for i in range(21):
            soma += int(composto[i]) * int(constante[i])
Severity: Major
Found in br_cnab/febraban/cnab_240/bancos/sicoob.py and 1 other location - About 1 hr to fix
br_cnab/febraban/cnab_240/bancos/sicredi.py on lines 92..93

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

        self.amount_total = self.total_bruto - self.total_desconto + \
            self.total_tax + self.total_frete + self.total_seguro + \
            self.total_despesas
Severity: Major
Found in br_stock_account/models/account_invoice.py and 1 other location - About 1 hr to fix
br_sale_stock/models/sale.py on lines 21..24

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

        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

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

            order.update({
                'amount_total': order.total_bruto - order.total_desconto +
                order.total_tax + order.total_frete + order.total_seguro +
                order.total_despesas,
Severity: Major
Found in br_sale_stock/models/sale.py and 1 other location - About 1 hr to fix
br_stock_account/models/account_invoice.py on lines 24..26

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

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

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

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

        for i in range(19):
            soma += int(composto[i]) * int(constante[i])
Severity: Major
Found in br_cnab/febraban/cnab_240/bancos/sicredi.py and 1 other location - About 1 hr to fix
br_cnab/febraban/cnab_240/bancos/sicoob.py on lines 47..48

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 2 locations. Consider refactoring.
Open

ORIGEM_PROD = [
    ('0', u'0 - Nacional'),
    ('1', u'1 - Estrangeira - Importação direta'),
    ('2', u'2 - Estrangeira - Adquirida no mercado interno'),
    ('3', u'3 - Nacional, mercadoria ou bem com Conteúdo de Importação superior a 40% e inferior ou igual a 70%'),  # noqa
Severity: Major
Found in br_account/models/cst.py and 1 other location - About 1 hr to fix
br_point_sale/models/account_journal.py on lines 9..18

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

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language