Trust-Code/odoo-brasil

View on GitHub

Showing 421 of 421 total issues

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

    def _hook_validation(self):
        errors = super(InvoiceEletronic, self)._hook_validation()
        if self.model != '65':
            return errors
        if not self.company_id.partner_id.inscr_est:
Severity: Minor
Found in br_point_sale/models/invoice_eletronic.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

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

    def _checkout_form_save(self, mode, checkout, all_values):
        Partner = request.env['res.partner']
        if mode[0] == 'new':
            partner_id = Partner.sudo().create(checkout)
        elif mode[0] == 'edit':
Severity: Minor
Found in br_website_sale/controllers/main.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

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

    def _compute_state(self):
        for item in self:
            if any(line.state == 'rejected' for line in item.line_ids):
                item.state = 'pending'
            elif all(line.state == 'baixa' for line in item.line_ids):
Severity: Minor
Found in br_cnab/models/payment_order.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

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

    def _compute_amount(self):
        super(AccountInvoice, self)._compute_amount()
        lines = self.invoice_line_ids
        self.total_tax = sum(l.price_tax for l in lines)
        self.icms_base = sum(l.icms_base_calculo for l in lines)
Severity: Minor
Found in br_account/models/account_invoice.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

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

    def nfse_export(self):
        search_vals = []
        search_vals.append(('data_emissao', '>=', self.start_date))
        search_vals.append(('data_emissao', '<=', self.end_date))
        search_vals.append(('state', 'in', ['cancel', 'done', 'denied']))
Severity: Minor
Found in br_nfe/wizard/export_nfe.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

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

    def _prepare_statement_data(self, arquivo,
                                transactions, move_lines):
        inicio = final = datetime.now()
        valor_total = Decimal('0.0')
        if len(transactions):
Severity: Minor
Found in br_cnab/wizard/wizard_import_cnab.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

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

    def tax_line_move_line_get(self):
        res = super(AccountInvoice, self).tax_line_move_line_get()

        done_taxes = []
        for tax_line in sorted(self.tax_line_ids, key=lambda x: -x.sequence):
Severity: Minor
Found in br_account/models/account_invoice.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

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

    def action_confirm(self):
        for order in self:
            prec = order.currency_id.decimal_places
            itens = order.order_line
            frete = round(sum(x.valor_frete for x in itens), prec)
Severity: Minor
Found in br_sale_stock/models/sale.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 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

Severity
Category
Status
Source
Language