Trust-Code/odoo-brasil

View on GitHub

Showing 421 of 421 total issues

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

    @api.multi
    def _compute_total_edocs(self):
        for item in self:
            item.total_edocs = self.env['invoice.eletronic'].search_count(
                [('invoice_id', '=', item.id)])
Severity: Major
Found in br_account_einvoice/models/account_invoice.py and 1 other location - About 1 hr to fix
br_point_sale/models/pos_order.py on lines 178..182

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

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

CST_ICMS = [
    ('00', u'00 - Tributada Integralmente'),
    ('10', u'10 - Tributada e com cobrança do ICMS por substituição tributária'),  # noqa
    ('20', u'20 - Com redução de base de cálculo'),
    ('30', u'30 - Isenta ou não tributada e com cobrança do ICMS por substituição tributária'),  # noqa
Severity: Major
Found in br_account/models/cst.py and 1 other location - About 1 hr to fix
br_account/models/account_fiscal_position.py on lines 19..29

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

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

    state = fields.Selection(
        [('draft', u'Provisório'),
         ('edit', 'Editar'),
         ('error', 'Erro'),
         ('done', 'Enviado'),
Severity: Major
Found in br_account_einvoice/models/invoice_eletronic.py and 1 other location - About 1 hr to fix
br_boleto/models/payment_order.py on lines 49..53

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

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

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

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

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

Refactorings

Further Reading

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

    def _get_mandatory_shipping_fields(self):
        res = super(L10nBrWebsiteSale, self)._get_mandatory_shipping_fields()
        res.remove('city')
        return res + ["cnpj_cpf", "zip", "number", "district",
                      "state_id", "city_id"]
Severity: Major
Found in br_website_sale/controllers/main.py and 1 other location - About 1 hr to fix
br_website_sale/controllers/main.py on lines 16..20

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

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

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

class external_pdf(render):
    def __init__(self, pdf):
        render.__init__(self)
        self.pdf = pdf
        self.output_type = 'pdf'
Severity: Major
Found in br_account_einvoice/models/account_invoice.py and 2 other locations - About 1 hr to fix
br_boleto/reports/report.py on lines 16..23
br_nfe/reports/report.py on lines 29..36

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

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

    state = fields.Selection([("draft", "Provisório"),
                              ("open", "Confirmado"),
                              ("paid", "Pago"),
                              ("rejected", "Rejeitado"),
                              ("baixa", "Baixa")],
Severity: Major
Found in br_boleto/models/payment_order.py and 1 other location - About 1 hr to fix
br_account_einvoice/models/invoice_eletronic.py on lines 35..40

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

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 _prepare_eletronic_invoice_values has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def _prepare_eletronic_invoice_values(self):
        res = super(InvoiceEletronic, self)._prepare_eletronic_invoice_values()
        if self.model not in ('55', '65'):
            return res

Severity: Minor
Found in br_nfe/models/invoice_eletronic.py - About 1 hr to fix

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

        type_transportation = fields.Selection([
            ('1', u'1 - Marítima'),
            ('2', u'2 - Fluvial'),
            ('3', u'3 - Lacustre'),
            ('4', u'4 - Aérea'),
    Severity: Major
    Found in br_account/models/br_account.py and 1 other location - About 1 hr to fix
    br_nfse/models/invoice_eletronic.py on lines 42..52

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

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

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

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

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

    Refactorings

    Further Reading

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

                nfe_envio = self.env['ir.attachment'].search([
                    ('res_model', '=', 'invoice.eletronic'),
                    ('res_id', '=', self.id),
                    ('datas_fname', 'like', 'nfe-envio')],
    Severity: Major
    Found in br_nfe/models/invoice_eletronic.py and 2 other locations - About 1 hr to fix
    br_nfe/models/invoice_eletronic.py on lines 875..878
    br_nfe/models/invoice_eletronic.py on lines 880..884

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

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

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

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

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

    Refactorings

    Further Reading

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

                recibo = self.env['ir.attachment'].search([
                    ('res_model', '=', 'invoice.eletronic'),
                    ('res_id', '=', self.id),
                    ('datas_fname', 'like', 'rec-ret')],
    Severity: Major
    Found in br_nfe/models/invoice_eletronic.py and 2 other locations - About 1 hr to fix
    br_nfe/models/invoice_eletronic.py on lines 880..884
    br_nfe/models/invoice_eletronic.py on lines 886..889

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

    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

        operation = fields.Selection(
            [('T', u"Tributado em São Paulo"),
             ('F', u"Tributado Fora de São Paulo"),
             ('A', u"Tributado em São Paulo, porém isento"),
             ('B', u"Tributado Fora de São Paulo, porém isento"),
    Severity: Major
    Found in br_nfse/models/invoice_eletronic.py and 1 other location - About 1 hr to fix
    br_account/models/br_account.py on lines 188..199

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

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

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

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

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

    Refactorings

    Further Reading

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

                if not recibo:
                    recibo = self.env['ir.attachment'].search([
                        ('res_model', '=', 'invoice.eletronic'),
                        ('res_id', '=', self.id),
                        ('datas_fname', 'like', 'nfe-ret')],
    Severity: Major
    Found in br_nfe/models/invoice_eletronic.py and 2 other locations - About 1 hr to fix
    br_nfe/models/invoice_eletronic.py on lines 875..878
    br_nfe/models/invoice_eletronic.py on lines 886..889

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

    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_tax_id has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def _compute_tax_id(self):
            res = super(SaleOrderLine, self)._compute_tax_id()
            for line in self:
                line._update_tax_from_ncm()
                fpos = line.order_id.fiscal_position_id or \
    Severity: Minor
    Found in br_sale/models/sale.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

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

    def validate_ie_sp(inscr_est):
        def gera_digito_sp(nova_ie, prod):
            r = sum([x * y for (x, y) in zip(nova_ie, prod)]) % 11
            if r < 10:
                return r
    Severity: Minor
    Found in br_base/tools/fiscal.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

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

    def validate_ie_pe(inscr_est):
        inscr_est = re.sub('[^0-9]', '', inscr_est)
    
        # verificando o tamanho da inscrição estadual
        if (len(inscr_est) != 9) and (len(inscr_est) != 14):
    Severity: Minor
    Found in br_base/tools/fiscal.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

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

        def _compute_difal(self, price_base, ipi_value):
            icms_inter = self.filtered(lambda x: x.domain == 'icms_inter')
            icms_intra = self.filtered(lambda x: x.domain == 'icms_intra')
            icms_fcp = self.filtered(lambda x: x.domain == 'fcp')
            if not icms_inter or not icms_intra:
    Severity: Minor
    Found in br_account/models/account_tax.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_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

            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

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

    Severity
    Category
    Status
    Source
    Language