OCA/l10n-italy

View on GitHub

Showing 1,161 of 1,161 total issues

Function _BuildAutomaton_24 has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

            if not invoice.fiscal_document_type_id:
                dt = self._get_document_fiscal_type(
                    invoice.type, invoice.partner_id, invoice.fiscal_position,
                    invoice.journal_id)
                if dt:
    Severity: Major
    Found in l10n_it_fiscal_document_type/models/account_invoice.py and 1 other location - About 1 hr to fix
    l10n_it_fiscal_document_type/models/account_invoice.py on lines 36..41

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

    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 not att.datas or not att.datas_fname:
                    raise UserError(
                        _("Attachment %s does not have XML file")
                        % att.display_name)
    Severity: Major
    Found in l10n_it_fatturapa_export_zip/wizard/export_fatturapa.py and 1 other location - About 1 hr to fix
    l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py on lines 386..389

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

    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

                " 40" + str(self._progressivo).rjust(7, '0') +
                indirizzo_debitore.ljust(30)[0:30] +
    Severity: Major
    Found in l10n_it_ricevute_bancarie/wizard/wizard_riba_file_export.py and 1 other location - About 1 hr to fix
    l10n_it_ricevute_bancarie/wizard/wizard_riba_file_export.py on lines 135..136

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

    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 not journal_ids:
                journal_ids = self.pool.get('account.journal').search(cr, uid, [
                                ('company_id', '=', False),
                                ('code', '=', 'GRAL'),
    Severity: Major
    Found in account_fiscal_year_closing/fyc.py and 1 other location - About 1 hr to fix
    account_fiscal_year_closing/fyc.py on lines 286..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 40.

    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 not journal_ids:
                journal_ids = self.pool.get('account.journal').search(cr, uid, [
                                ('company_id', '=', False),
                                ('name', 'ilike', 'General'),
    Severity: Major
    Found in account_fiscal_year_closing/fyc.py and 1 other location - About 1 hr to fix
    account_fiscal_year_closing/fyc.py on lines 276..279

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

    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 not partner.lastname or not partner.firstname:
                    raise UserError(
                        _("Partner %s must have name and surname.") %
                        partner.name)
    Severity: Major
    Found in l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py and 1 other location - About 1 hr to fix
    l10n_it_fatturapa_export_zip/wizard/export_fatturapa.py on lines 32..35

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

    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 not invoices_partner.cessionario_IdFiscaleIVA_IdPaese and \
                        invoices_partner.cessionario_IdFiscaleIVA_IdCodice:
                    errors.append(_(
                        u'Define a country ID for assignee %s'
                    ) % invoices_partner.partner_id.display_name)
    Severity: Major
    Found in l10n_it_invoices_data_communication/models/communication.py and 1 other location - About 1 hr to fix
    l10n_it_invoices_data_communication/models/communication.py on lines 1121..1125

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

    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

                " 30" + str(self._progressivo).rjust(7, '0') +
                nome_debitore.ljust(60)[0:60] +
    Severity: Major
    Found in l10n_it_ricevute_bancarie/wizard/wizard_riba_file_export.py and 1 other location - About 1 hr to fix
    l10n_it_ricevute_bancarie/wizard/wizard_riba_file_export.py on lines 146..147

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

    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 not invoices_partner.cedente_IdFiscaleIVA_IdPaese and \
                        invoices_partner.cedente_IdFiscaleIVA_IdCodice:
                    errors.append(_(
                        u'Define a country ID for seller %s'
                    ) % invoices_partner.partner_id.display_name)
    Severity: Major
    Found in l10n_it_invoices_data_communication/models/communication.py and 1 other location - About 1 hr to fix
    l10n_it_invoices_data_communication/models/communication.py on lines 911..915

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

    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 not invoice.dati_fattura_iva_ids:
                        errors.append(_(
                            u'No VAT data defined for invoice %s of partner %s'
                        ) % (
                            invoice.invoice_id.number,
    Severity: Major
    Found in l10n_it_invoices_data_communication/models/communication.py and 1 other location - About 1 hr to fix
    l10n_it_invoices_data_communication/models/communication.py on lines 966..972

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

    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 _set_document_fiscal_type(self):
            dt = self._get_document_fiscal_type(
                self.type, self.partner_id, self.fiscal_position,
                self.journal_id)
            if dt:
    Severity: Major
    Found in l10n_it_fiscal_document_type/models/account_invoice.py and 1 other location - About 1 hr to fix
    l10n_it_fiscal_document_type/models/account_invoice.py on lines 46..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 40.

    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

                for invoice in invoices_partner.fatture_emesse_body_ids:
                    if not invoice.dati_fattura_iva_ids:
                        errors.append(_(
                            u'No VAT data defined for invoice %s of partner %s'
                        ) % (
    Severity: Major
    Found in l10n_it_invoices_data_communication/models/communication.py and 1 other location - About 1 hr to fix
    l10n_it_invoices_data_communication/models/communication.py on lines 1175..1180

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

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

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

      Function _Record14 has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _Record14(
      Severity: Major
      Found in l10n_it_ricevute_bancarie/wizard/wizard_riba_file_export.py - About 1 hr to fix

        Function test_invoice_multi_ddt has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def test_invoice_multi_ddt(self):
                picking1 = self._create_picking()
                self._create_move(picking1, self.product1, quantity=2)
                picking2 = self._create_picking()
                self._create_move(picking2, self.product1, quantity=3)
        Severity: Minor
        Found in l10n_it_ddt/tests/test_ddt.py - About 1 hr to fix

          Function action_cancel has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def action_cancel(self, cr, uid, ids, context=None):
                  """
                  Called when the user clicks the cancel button.
                  """
                  if context is None:
          Severity: Minor
          Found in account_fiscal_year_closing/fyc.py - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function onchange_partner_id has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def onchange_partner_id(self):
                  for fattura in self:
                      if fattura.partner_id:
                          fattura.cedente_IdFiscaleIVA_IdPaese = \
                              fattura.partner_id.country_id.code or ''
          Severity: Minor
          Found in l10n_it_invoices_data_communication/models/communication.py - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function action_move_create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def action_move_create(self):
                  res = super(AccountInvoice, self).action_move_create()
                  for inv in self:
                      if inv.tax_stamp and not inv.is_tax_stamp_line_present():
                          if inv.move_id.state == 'posted':
          Severity: Minor
          Found in l10n_it_account_stamp/models/invoice.py - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function set_payments_data has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def set_payments_data(self, FatturaBody, invoice_id, partner_id):
                  PaymentsData = FatturaBody.DatiPagamento
                  if PaymentsData:
                      PaymentDataModel = self.env['fatturapa.payment.data']
                      PaymentTermsModel = self.env['fatturapa.payment_term']
          Severity: Minor
          Found in l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

          Severity
          Category
          Status
          Source
          Language