OCA/l10n-italy

View on GitHub

Showing 1,161 of 1,161 total issues

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

    symbol = pyxb.binding.content.WildcardUse(pyxb.binding.content.Wildcard(process_contents=pyxb.binding.content.Wildcard.PC_lax, namespace_constraint=(pyxb.binding.content.Wildcard.NC_not, 'http://www.w3.org/2000/09/xmldsig#')), pyxb.utils.utility.Location('http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd', 214, 6))
Severity: Major
Found in l10n_it_fatturapa/bindings/_ds.py and 9 other locations - About 3 hrs to fix
l10n_it_fatturapa/bindings/_ds.py on lines 1325..1325
l10n_it_fatturapa/bindings/_ds.py on lines 1428..1428
l10n_it_fatturapa/bindings/_ds.py on lines 1466..1466
l10n_it_fatturapa/bindings/_ds.py on lines 1530..1530
l10n_it_fatturapa/bindings/_ds.py on lines 1704..1704
l10n_it_fatturapa/bindings/_ds.py on lines 1785..1785
l10n_it_fatturapa/bindings/_ds.py on lines 1948..1948
l10n_it_fatturapa/bindings/_ds.py on lines 1999..1999
l10n_it_fatturapa/bindings/_ds.py on lines 2102..2102

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

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

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

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

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

Refactorings

Further Reading

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

    symbol = pyxb.binding.content.WildcardUse(pyxb.binding.content.Wildcard(process_contents=pyxb.binding.content.Wildcard.PC_lax, namespace_constraint=(pyxb.binding.content.Wildcard.NC_not, 'http://www.w3.org/2000/09/xmldsig#')), pyxb.utils.utility.Location('http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd', 219, 6))
Severity: Major
Found in l10n_it_fatturapa/bindings/_ds.py and 9 other locations - About 3 hrs to fix
l10n_it_fatturapa/bindings/_ds.py on lines 1325..1325
l10n_it_fatturapa/bindings/_ds.py on lines 1428..1428
l10n_it_fatturapa/bindings/_ds.py on lines 1466..1466
l10n_it_fatturapa/bindings/_ds.py on lines 1530..1530
l10n_it_fatturapa/bindings/_ds.py on lines 1704..1704
l10n_it_fatturapa/bindings/_ds.py on lines 1785..1785
l10n_it_fatturapa/bindings/_ds.py on lines 1939..1939
l10n_it_fatturapa/bindings/_ds.py on lines 1999..1999
l10n_it_fatturapa/bindings/_ds.py on lines 2102..2102

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

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

    def run(self, cr, uid, ids, context=None):
        """
        Creates / removes FYC entries
        """

Severity: Minor
Found in account_fiscal_year_closing/wizard/wizard_run.py - About 2 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Function setDatiPagamento has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    def setDatiPagamento(self, invoice, body):
        if invoice.payment_term:
            payment_line_ids = invoice.move_line_id_payment_get()
            if not payment_line_ids:
                return True
Severity: Minor
Found in l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py - About 2 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

            if self.env.user.company_id.cassa_previdenziale_product_id:
                cassa_previdenziale_product = self.env.user.company_id \
                    .cassa_previdenziale_product_id
                line_vals['product_id'] = cassa_previdenziale_product.id
                line_vals['name'] = cassa_previdenziale_product.name
Severity: Major
Found in l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py and 1 other location - About 2 hrs to fix
l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py on lines 631..637

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

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

        if len(move_lines):
            move_id = pool.get('account.move').create(cr, uid, {
                            'ref': description,
                            'date': date,
                            'period_id': period_id,
Severity: Major
Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 2 hrs to fix
account_fiscal_year_closing/wizard/wizard_run.py on lines 540..550

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

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

        if len(move_lines):
            move_id = pool.get('account.move').create(cr, uid, {
                            'ref': description,
                            'date': date,
                            'period_id': period_id,
Severity: Major
Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 2 hrs to fix
account_fiscal_year_closing/wizard/wizard_run.py on lines 448..458

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

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

            if self.env.user.company_id.sconto_maggiorazione_product_id:
                sconto_maggiorazione_product = (
                    self.env.user.company_id.sconto_maggiorazione_product_id)
                line_vals['product_id'] = sconto_maggiorazione_product.id
                line_vals['name'] = sconto_maggiorazione_product.name
Severity: Major
Found in l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py and 1 other location - About 2 hrs to fix
l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py on lines 1262..1268

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

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

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

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

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

Refactorings

Further Reading

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

        self.account_user = self.res_user_model.with_context(
            {'no_reset_password': True}).create(dict(
                name="Accountant",
                company_id=self.company.id,
                login="acc",
Severity: Major
Found in l10n_it_fatturapa_out/tests/fatturapa_common.py and 1 other location - About 2 hrs to fix
l10n_it_fatturapa_out/tests/fatturapa_common.py on lines 44..51

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

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

            elif (ct.notes == 'ORA' and
                    (not dtcostvar or not ct.var_date or
                        dtcostvar < ct.var_date)):
                if (not ct.var_date or ct.var_date <= birth_date):
                    nc = ct.national_code_var
Severity: Major
Found in l10n_it_fiscalcode/wizard/compute_fc.py and 1 other location - About 2 hrs to fix
l10n_it_fiscalcode/wizard/compute_fc.py on lines 129..137

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

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

            elif (ct.notes == 'AGG' and
                    (not dtcostvar or not ct.var_date or
                        dtcostvar < ct.var_date)):
                if (not ct.var_date or ct.var_date <= birth_date):
                    nc = ct.national_code_var
Severity: Major
Found in l10n_it_fiscalcode/wizard/compute_fc.py and 1 other location - About 2 hrs to fix
l10n_it_fiscalcode/wizard/compute_fc.py on lines 120..128

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

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

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

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

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

Refactorings

Further Reading

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

        self.account_manager = self.res_user_model.with_context(
            {'no_reset_password': True}).create(dict(
                name="Adviser",
                company_id=self.company.id,
                login="fm",
Severity: Major
Found in l10n_it_fatturapa_out/tests/fatturapa_common.py and 1 other location - About 2 hrs to fix
l10n_it_fatturapa_out/tests/fatturapa_common.py on lines 35..42

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

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

def _BuildAutomaton_19 ():
    # Remove this helper function from the namespace after it is invoked
    global _BuildAutomaton_19
    del _BuildAutomaton_19
    import pyxb.utils.fac as fac
Severity: Major
Found in l10n_it_fatturapa/bindings/_ds.py - About 2 hrs to fix

    Function _BuildAutomaton_17 has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def _BuildAutomaton_17 ():
        # Remove this helper function from the namespace after it is invoked
        global _BuildAutomaton_17
        del _BuildAutomaton_17
        import pyxb.utils.fac as fac
    Severity: Major
    Found in l10n_it_fatturapa/bindings/binding.py - About 2 hrs to fix

      Function _addGlobalDiscount has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def _addGlobalDiscount(self, invoice_id, DatiGeneraliDocumento):
              discount = 0.0
              if (
                  DatiGeneraliDocumento.ScontoMaggiorazione and
                  self.e_invoice_detail_level == '2'
      Severity: Minor
      Found in l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function _compute_e_invoice_validation_error has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def _compute_e_invoice_validation_error(self):
              bills_to_check = self.filtered(
                  lambda inv:
                      inv.type in ['in_invoice', 'in_refund'] and
                      inv.state in ['draft', 'open', 'paid'] and
      Severity: Minor
      Found in l10n_it_fatturapa_in/models/account.py - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function CreateFromDocument has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      def CreateFromDocument(xml_string):
          try:
              root = etree.fromstring(xml_string)
          except Exception as e:
              _logger.warn('lxml was unable to parse xml: %s' % e)
      Severity: Minor
      Found in l10n_it_fatturapa/bindings/fatturapa.py - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function _tax_amounts_by_tax_id has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def _tax_amounts_by_tax_id(self, move):
              res = {}
              tax_obj = self.pool.get('account.tax')
              for move_line in move.line_id:
                  if (
      Severity: Minor
      Found in l10n_it_vat_registries/vat_registry.py - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

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

              if pain_flavor in pain_03_to_05:
                  nb_of_transactions_1_6.text = str(transactions_count_1_6)
                  control_sum_1_7.text = '%.2f' % amount_control_sum_1_7
              else:
                  nb_of_transactions_1_6.text = str(transactions_count_1_6)
      Severity: Major
      Found in l10n_it_sepa_bonifici/wizard/export_sepa_cbi.py and 1 other location - About 2 hrs to fix
      l10n_it_sepa_bonifici/wizard/export_sepa_cbi_estero.py on lines 343..348

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

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

              if pain_flavor in pain_03_to_05:
                  nb_of_transactions_1_6.text = str(transactions_count_1_6)
                  control_sum_1_7.text = '%.2f' % amount_control_sum_1_7
              else:
                  nb_of_transactions_1_6.text = str(transactions_count_1_6)
      Severity: Major
      Found in l10n_it_sepa_bonifici/wizard/export_sepa_cbi_estero.py and 1 other location - About 2 hrs to fix
      l10n_it_sepa_bonifici/wizard/export_sepa_cbi.py on lines 247..252

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

      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