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

class ContattiTrasmittenteType (pyxb.binding.basis.complexTypeDefinition):
    """Complex type {http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2}ContattiTrasmittenteType with content type ELEMENT_ONLY"""
    _TypeDefinition = None
    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
    _Abstract = False
Severity: Major
Found in l10n_it_fatturapa/bindings/binding.py and 9 other locations - About 2 days to fix
l10n_it_fatturapa/bindings/_ds.py on lines 725..753
l10n_it_fatturapa/bindings/_ds.py on lines 1062..1090
l10n_it_fatturapa/bindings/binding.py on lines 1313..1341
l10n_it_fatturapa/bindings/binding.py on lines 1655..1683
l10n_it_fatturapa/bindings/binding.py on lines 2159..2187
l10n_it_fatturapa/bindings/binding.py on lines 2783..2811
l10n_it_fatturapa/bindings/binding.py on lines 2819..2848
l10n_it_fatturapa/bindings/binding.py on lines 2856..2884
l10n_it_fatturapa/bindings/binding.py on lines 3360..3388

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

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

class CodiceArticoloType (pyxb.binding.basis.complexTypeDefinition):
    """Complex type {http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2}CodiceArticoloType with content type ELEMENT_ONLY"""
    _TypeDefinition = None
    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
    _Abstract = False
Severity: Major
Found in l10n_it_fatturapa/bindings/binding.py and 9 other locations - About 2 days to fix
l10n_it_fatturapa/bindings/_ds.py on lines 725..753
l10n_it_fatturapa/bindings/_ds.py on lines 1062..1090
l10n_it_fatturapa/bindings/binding.py on lines 1313..1341
l10n_it_fatturapa/bindings/binding.py on lines 1349..1377
l10n_it_fatturapa/bindings/binding.py on lines 1655..1683
l10n_it_fatturapa/bindings/binding.py on lines 2159..2187
l10n_it_fatturapa/bindings/binding.py on lines 2783..2811
l10n_it_fatturapa/bindings/binding.py on lines 2819..2848
l10n_it_fatturapa/bindings/binding.py on lines 2856..2884

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

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

class DatiBeniServiziType (pyxb.binding.basis.complexTypeDefinition):
    """Blocco relativo ai dati di Beni Servizi della Fattura    Elettronica"""
    _TypeDefinition = None
    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
    _Abstract = False
Severity: Major
Found in l10n_it_fatturapa/bindings/binding.py and 9 other locations - About 2 days to fix
l10n_it_fatturapa/bindings/_ds.py on lines 725..753
l10n_it_fatturapa/bindings/_ds.py on lines 1062..1090
l10n_it_fatturapa/bindings/binding.py on lines 1313..1341
l10n_it_fatturapa/bindings/binding.py on lines 1349..1377
l10n_it_fatturapa/bindings/binding.py on lines 1655..1683
l10n_it_fatturapa/bindings/binding.py on lines 2159..2187
l10n_it_fatturapa/bindings/binding.py on lines 2819..2848
l10n_it_fatturapa/bindings/binding.py on lines 2856..2884
l10n_it_fatturapa/bindings/binding.py on lines 3360..3388

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

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 test_e_invoice_wt_enas_0(self):
        self.set_sequences(14, '2019')
        invoice = self.invoice_model.create({
            'date_invoice': '2019-01-07',
            'partner_id': self.res_partner_fatturapa_2.id,
Severity: Major
Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py and 1 other location - About 1 day to fix
l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 246..282

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

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 test_e_invoice_wt_inps_0(self):
        self.set_sequences(17, '2019')
        invoice = self.invoice_model.create({
            'date_invoice': '2019-01-07',
            'partner_id': self.res_partner_fatturapa_2.id,
Severity: Major
Found in l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py and 1 other location - About 1 day to fix
l10n_it_fatturapa_out_wt/tests/test_fatturapa_wt.py on lines 118..154

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

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

class DigestMethodType (pyxb.binding.basis.complexTypeDefinition):
    """Complex type {http://www.w3.org/2000/09/xmldsig#}DigestMethodType with content type MIXED"""
    _TypeDefinition = None
    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_MIXED
    _Abstract = False
Severity: Major
Found in l10n_it_fatturapa/bindings/_ds.py and 1 other location - About 1 day to fix
l10n_it_fatturapa/bindings/_ds.py on lines 265..288

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

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

class CanonicalizationMethodType (pyxb.binding.basis.complexTypeDefinition):
    """Complex type {http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethodType with content type MIXED"""
    _TypeDefinition = None
    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_MIXED
    _Abstract = False
Severity: Major
Found in l10n_it_fatturapa/bindings/_ds.py and 1 other location - About 1 day to fix
l10n_it_fatturapa/bindings/_ds.py on lines 467..490

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

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

    def action_move_create(self, cr, uid, ids, context=None):
        res = super(account_invoice,self).action_move_create(cr, uid, ids, context=context)
        move_obj = self.pool.get('account.move')
        move_line_obj = self.pool.get('account.move.line')
        period_obj = self.pool.get('account.period')
Severity: Minor
Found in l10n_it_bill_of_entry/account_invoice.py - About 1 day 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 _BuildAutomaton_31 has 335 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    File account.py has 718 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    #
    #
    #    OpenERP, Open Source Management Solution
    #    Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>).
    Severity: Major
    Found in account_vat_period_end_statement/models/account.py - About 1 day to fix

      File test_import_fatturapa_xml.py has 705 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      
      from openerp.exceptions import Warning as UserError
      from .fatturapa_common import FatturapaCommon
      
      
      Severity: Major
      Found in l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py - About 1 day to fix

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

            def _sum_debit_account(self, account):
                if account.type == 'view':
                    return account.debit
                move_state = ['draft','posted']
                if self.target_move == 'posted':
        Severity: Major
        Found in l10n_it_prima_nota_cassa/report/prima_nota_cassa.py and 2 other locations - About 1 day to fix
        l10n_it_prima_nota_cassa/report/prima_nota_cassa.py on lines 228..252
        l10n_it_prima_nota_cassa/report/prima_nota_cassa.py on lines 254..278

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

        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

            def _sum_balance_account(self, account):
                if account.type == 'view':
                    return account.balance
                move_state = ['draft','posted']
                if self.target_move == 'posted':
        Severity: Major
        Found in l10n_it_prima_nota_cassa/report/prima_nota_cassa.py and 2 other locations - About 1 day to fix
        l10n_it_prima_nota_cassa/report/prima_nota_cassa.py on lines 202..226
        l10n_it_prima_nota_cassa/report/prima_nota_cassa.py on lines 228..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 177.

        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

            def _sum_credit_account(self, account):
                if account.type == 'view':
                    return account.credit
                move_state = ['draft','posted']
                if self.target_move == 'posted':
        Severity: Major
        Found in l10n_it_prima_nota_cassa/report/prima_nota_cassa.py and 2 other locations - About 1 day to fix
        l10n_it_prima_nota_cassa/report/prima_nota_cassa.py on lines 202..226
        l10n_it_prima_nota_cassa/report/prima_nota_cassa.py on lines 254..278

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

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

            def parse_pec_response(self, message_dict):
                message_dict['model'] = self._name
                message_dict['res_id'] = 0
        
                regex = re.compile(RESPONSE_MAIL_REGEX)
        Severity: Minor
        Found in l10n_it_fatturapa_pec/models/fatturapa_attachment_out.py - About 1 day 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

            def get_account_tax_by_base_code(self, tax_code):
                if tax_code.base_tax_ids:
                    if not self._have_same_rate(tax_code.base_tax_ids):
                        raise osv.except_osv(_('Error'),
                            _('The taxes %s have different rates') % str(tax_code.base_tax_ids))
        Severity: Major
        Found in l10n_it_partially_deductible_vat/account.py and 1 other location - About 1 day to fix
        l10n_it_partially_deductible_vat/account.py on lines 50..62

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

        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_account_tax_by_tax_code(self, tax_code):
                if tax_code.tax_ids:
                    if not self._have_same_rate(tax_code.tax_ids):
                        raise osv.except_osv(_('Error'),
                            _('The taxes %s have different rates') % str(tax_code.tax_ids))
        Severity: Major
        Found in l10n_it_partially_deductible_vat/account.py and 1 other location - About 1 day to fix
        l10n_it_partially_deductible_vat/account.py on lines 64..76

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

        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

        class ComunicazioneDatiIvaFattureEmesseIva(models.Model):
            _name = 'comunicazione.dati.iva.fatture.emesse.iva'
            _description = 'Invoices data communication - Customer invoices VAT'
        
            fattura_emessa_body_id = fields.Many2one(
        Severity: Major
        Found in l10n_it_invoices_data_communication/models/communication.py and 1 other location - About 1 day to fix
        l10n_it_invoices_data_communication/models/communication.py on lines 2533..2559

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

        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

        def CreateFromDocument (xml_text, default_namespace=None, location_base=None):
            """Parse the given XML and use the document element to create a
            Python instance.
        
            @param xml_text An XML document.  This should be data (Python 2
        Severity: Major
        Found in l10n_it_fatturapa/bindings/binding.py and 1 other location - About 1 day to fix
        l10n_it_fatturapa/bindings/_ds.py on lines 44..75

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

        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

        def CreateFromDocument (xml_text, default_namespace=None, location_base=None):
            """Parse the given XML and use the document element to create a
            Python instance.
        
            @param xml_text An XML document.  This should be data (Python 2
        Severity: Major
        Found in l10n_it_fatturapa/bindings/_ds.py and 1 other location - About 1 day to fix
        l10n_it_fatturapa/bindings/binding.py on lines 48..79

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

        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