OCA/l10n-italy

View on GitHub

Showing 1,161 of 1,161 total issues

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

        'authority_vat_account_id': fields.many2one(
            'account.account', 'Tax Authority VAT Account', required=True,
            states={
                'confirmed': [('readonly', True)],
                'paid': [('readonly', True)],
Severity: Major
Found in account_vat_period_end_statement/models/account.py and 1 other location - About 1 hr to fix
account_vat_period_end_statement/models/account.py on lines 330..335

Duplicated Code

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

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

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

Tuning

This issue has a mass of 38.

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

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

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

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

Refactorings

Further Reading

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

            elif (ct.notes == 'AGP' and
                    (not dtcostvar or not ct.var_date or
                        dtcostvar < ct.var_date)):
Severity: Major
Found in l10n_it_fiscalcode/wizard/compute_fc.py and 3 other locations - About 1 hr to fix
l10n_it_fiscalcode/wizard/compute_fc.py on lines 120..122
l10n_it_fiscalcode/wizard/compute_fc.py on lines 129..131
l10n_it_fiscalcode/wizard/compute_fc.py on lines 144..146

Duplicated Code

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

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

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

Tuning

This issue has a mass of 38.

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

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

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

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

Refactorings

Further Reading

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

        'previous_credit_vat_account_id': fields.many2one(
            'account.account', 'Previous Credits VAT',
            help='Credit VAT from previous periods',
            states={
                'confirmed': [('readonly', True)],
Severity: Major
Found in account_vat_period_end_statement/models/account.py and 1 other location - About 1 hr to fix
account_vat_period_end_statement/models/account.py on lines 283..289

Duplicated Code

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

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

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

Tuning

This issue has a mass of 38.

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

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

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

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

Refactorings

Further Reading

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

        'journal_id': fields.many2one(
            'account.journal', 'Journal', required=True,
            states={
                'confirmed': [('readonly', True)],
                'paid': [('readonly', True)],
Severity: Major
Found in account_vat_period_end_statement/models/account.py and 1 other location - About 1 hr to fix
account_vat_period_end_statement/models/account.py on lines 314..319

Duplicated Code

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

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

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

Tuning

This issue has a mass of 38.

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

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

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

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

Refactorings

Further Reading

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

        'previous_debit_vat_account_id': fields.many2one(
            'account.account', 'Previous Debits VAT',
            help='Debit VAT from previous periods',
            states={
                'confirmed': [('readonly', True)],
Severity: Major
Found in account_vat_period_end_statement/models/account.py and 1 other location - About 1 hr to fix
account_vat_period_end_statement/models/account.py on lines 266..272

Duplicated Code

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

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

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

Tuning

This issue has a mass of 38.

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

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

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

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

Refactorings

Further Reading

Function _check_unbalanced_moves has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _check_unbalanced_moves(self, cr, uid, fyc, context):
        """
        Checks for unbalanced moves on the fiscal year that is being closed
        """
        pool = self.pool
Severity: Minor
Found in account_fiscal_year_closing/wizard/wizard_run.py - About 55 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 _setSedeCessionario has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _setSedeCessionario(self, partner, fatturapa):

        if not partner.street:
            raise UserError(
                _('Customer street is not set.'))
Severity: Minor
Found in l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py - About 55 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 on_change_partner has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def on_change_partner(self):
        if self.ddt_type_id:
            addr = self.partner_id.address_get(['delivery', 'invoice'])
            self.partner_invoice_id = addr['invoice']
            self.partner_shipping_id = addr['delivery']
Severity: Minor
Found in l10n_it_ddt/models/stock_picking_package_preparation.py - About 55 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 _check_stamp_apply_tax has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _check_stamp_apply_tax(self):
        for template in self:
            if template.stamp_apply_tax_ids and not template.is_stamp:
                raise exceptions.ValidationError(
                    _("The product %s must be a stamp to set apply taxes!")
Severity: Minor
Found in l10n_it_account_stamp/models/product.py - About 55 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_tax_amount has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _compute_tax_amount(self, tax, tax_code, base_code):
        '''
        The Tax is child of another main tax.
        The main tax has more childs:
        - Child with tax_code_id are deductible
Severity: Minor
Found in l10n_it_account/models/account_tax.py - About 55 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_view_ddt has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def action_view_ddt(self, cr, uid, ids, context=None):
        mod_obj = self.pool.get('ir.model.data')
        act_obj = self.pool.get('ir.actions.act_window')

        result = mod_obj.get_object_reference(
Severity: Minor
Found in l10n_it_ddt/models/sale.py - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    def action_confirm(self, cr, uid, ids, context=None):
        """
        Called when the user clicks the confirm button.
        """
        if context is None:
Severity: Minor
Found in account_fiscal_year_closing/fyc.py - About 55 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 _setCodiceDestinatario has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _setCodiceDestinatario(self, partner, fatturapa):
        pec_destinatario = None
        if partner.is_pa:
            if not partner.ipa_code:
                raise UserError(_(
Severity: Minor
Found in l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py - About 55 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 _amount_withholding_tax has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _amount_withholding_tax(self):
        dp_obj = self.env['decimal.precision']
        for invoice in self:
            withholding_tax_amount = 0.0
            for wt_line in invoice.withholding_tax_line:
Severity: Minor
Found in l10n_it_withholding_tax/models/account.py - About 55 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_difference has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def tax_difference(self, cr, uid, cur, tax_grouped):
        real_total = 0
        invoice_total = 0
        cur_obj = self.pool.get('res.currency')
        tax_obj = self.pool.get('account.tax')
Severity: Minor
Found in l10n_it_partially_deductible_vat/account.py - About 55 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_fc has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def compute_fc(self):
        active_id = self._context.get('active_id')
        partner = self.env['res.partner'].browse(active_id)
        for f in self:
            if (not f.fiscalcode_surname or not f.fiscalcode_firstname or
Severity: Minor
Found in l10n_it_fiscalcode/wizard/compute_fc.py - About 55 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 confirm has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def confirm(self):
        move_pool = self.pool['account.move']
        move_line_pool = self.pool['account.move.line']
        for line in self:
            journal = line.distinta_id.config_id.acceptance_journal_id
Severity: Minor
Found in l10n_it_ricevute_bancarie/models/riba.py - About 55 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 24 locations. Consider refactoring.
Open

            if not check_normalized_string(
                invoices_partner.cedente_sede_Indirizzo
            ):
                errors.append(_(
                    u'Remove empty characters around headquarters address of '
Severity: Major
Found in l10n_it_invoices_data_communication/models/communication.py and 23 other locations - About 55 mins to fix
l10n_it_invoices_data_communication/models/communication.py on lines 829..835
l10n_it_invoices_data_communication/models/communication.py on lines 836..840
l10n_it_invoices_data_communication/models/communication.py on lines 841..847
l10n_it_invoices_data_communication/models/communication.py on lines 848..854
l10n_it_invoices_data_communication/models/communication.py on lines 855..861
l10n_it_invoices_data_communication/models/communication.py on lines 862..868
l10n_it_invoices_data_communication/models/communication.py on lines 869..875
l10n_it_invoices_data_communication/models/communication.py on lines 876..882
l10n_it_invoices_data_communication/models/communication.py on lines 883..889
l10n_it_invoices_data_communication/models/communication.py on lines 890..895
l10n_it_invoices_data_communication/models/communication.py on lines 896..902
l10n_it_invoices_data_communication/models/communication.py on lines 903..909
l10n_it_invoices_data_communication/models/communication.py on lines 1045..1051
l10n_it_invoices_data_communication/models/communication.py on lines 1052..1056
l10n_it_invoices_data_communication/models/communication.py on lines 1057..1061
l10n_it_invoices_data_communication/models/communication.py on lines 1069..1075
l10n_it_invoices_data_communication/models/communication.py on lines 1076..1082
l10n_it_invoices_data_communication/models/communication.py on lines 1083..1089
l10n_it_invoices_data_communication/models/communication.py on lines 1090..1096
l10n_it_invoices_data_communication/models/communication.py on lines 1097..1101
l10n_it_invoices_data_communication/models/communication.py on lines 1102..1107
l10n_it_invoices_data_communication/models/communication.py on lines 1108..1112
l10n_it_invoices_data_communication/models/communication.py on lines 1113..1119

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

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

            if not check_normalized_string(
                invoices_partner.cedente_Denominazione
            ):
                errors.append(_(
                    u'Remove empty characters around denomination of seller '
Severity: Major
Found in l10n_it_invoices_data_communication/models/communication.py and 23 other locations - About 55 mins to fix
l10n_it_invoices_data_communication/models/communication.py on lines 829..835
l10n_it_invoices_data_communication/models/communication.py on lines 836..840
l10n_it_invoices_data_communication/models/communication.py on lines 841..847
l10n_it_invoices_data_communication/models/communication.py on lines 848..854
l10n_it_invoices_data_communication/models/communication.py on lines 855..861
l10n_it_invoices_data_communication/models/communication.py on lines 862..868
l10n_it_invoices_data_communication/models/communication.py on lines 869..875
l10n_it_invoices_data_communication/models/communication.py on lines 876..882
l10n_it_invoices_data_communication/models/communication.py on lines 883..889
l10n_it_invoices_data_communication/models/communication.py on lines 890..895
l10n_it_invoices_data_communication/models/communication.py on lines 896..902
l10n_it_invoices_data_communication/models/communication.py on lines 903..909
l10n_it_invoices_data_communication/models/communication.py on lines 1052..1056
l10n_it_invoices_data_communication/models/communication.py on lines 1057..1061
l10n_it_invoices_data_communication/models/communication.py on lines 1062..1068
l10n_it_invoices_data_communication/models/communication.py on lines 1069..1075
l10n_it_invoices_data_communication/models/communication.py on lines 1076..1082
l10n_it_invoices_data_communication/models/communication.py on lines 1083..1089
l10n_it_invoices_data_communication/models/communication.py on lines 1090..1096
l10n_it_invoices_data_communication/models/communication.py on lines 1097..1101
l10n_it_invoices_data_communication/models/communication.py on lines 1102..1107
l10n_it_invoices_data_communication/models/communication.py on lines 1108..1112
l10n_it_invoices_data_communication/models/communication.py on lines 1113..1119

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

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

            if not check_normalized_string(invoices_partner.cessionario_Nome):
                errors.append(_(
                    u'Remove empty characters around name of assignee '
                    u'%s'
                ) % invoices_partner.partner_id.display_name)
Severity: Major
Found in l10n_it_invoices_data_communication/models/communication.py and 23 other locations - About 55 mins to fix
l10n_it_invoices_data_communication/models/communication.py on lines 829..835
l10n_it_invoices_data_communication/models/communication.py on lines 841..847
l10n_it_invoices_data_communication/models/communication.py on lines 848..854
l10n_it_invoices_data_communication/models/communication.py on lines 855..861
l10n_it_invoices_data_communication/models/communication.py on lines 862..868
l10n_it_invoices_data_communication/models/communication.py on lines 869..875
l10n_it_invoices_data_communication/models/communication.py on lines 876..882
l10n_it_invoices_data_communication/models/communication.py on lines 883..889
l10n_it_invoices_data_communication/models/communication.py on lines 890..895
l10n_it_invoices_data_communication/models/communication.py on lines 896..902
l10n_it_invoices_data_communication/models/communication.py on lines 903..909
l10n_it_invoices_data_communication/models/communication.py on lines 1045..1051
l10n_it_invoices_data_communication/models/communication.py on lines 1052..1056
l10n_it_invoices_data_communication/models/communication.py on lines 1057..1061
l10n_it_invoices_data_communication/models/communication.py on lines 1062..1068
l10n_it_invoices_data_communication/models/communication.py on lines 1069..1075
l10n_it_invoices_data_communication/models/communication.py on lines 1076..1082
l10n_it_invoices_data_communication/models/communication.py on lines 1083..1089
l10n_it_invoices_data_communication/models/communication.py on lines 1090..1096
l10n_it_invoices_data_communication/models/communication.py on lines 1097..1101
l10n_it_invoices_data_communication/models/communication.py on lines 1102..1107
l10n_it_invoices_data_communication/models/communication.py on lines 1108..1112
l10n_it_invoices_data_communication/models/communication.py on lines 1113..1119

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

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