ingadhoc/odoo-argentina

View on GitHub

Showing 180 of 180 total issues

Function _get_signed_amount has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_signed_amount(self):
        if self.voucher_id.type == 'payment':
            if self.type == 'cr':
                # negative for credits
                sign = -1.0
Severity: Minor
Found in l10n_ar_aeroo_voucher/account_voucher.py - About 45 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 get_afip_ws_url has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def get_afip_ws_url(self, afip_ws, environment_type):
        """
        Function to be inherited on each module that add a new webservice
        """
        _logger.info('Getting URL for afip ws %s on %s' % (
Severity: Minor
Found in l10n_ar_afipws/models/afipws_connection.py - About 45 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 _payment_earliest_date_search has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _payment_earliest_date_search(self, cr, uid, obj, name, args, context=None):
Severity: Minor
Found in l10n_ar_account_followup/account_followup.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if not obj_inv.journal_document_class_id.sequence_id:
                                raise Warning(
                                    _('Error!. Please define sequence on the journal related documents to this invoice.'))
                            afip_document_number = obj_sequence.next_by_id(
    Severity: Major
    Found in l10n_ar_invoice/models/invoice.py - About 45 mins to fix

      Function _get_formated_vat has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _get_formated_vat(self, cr, uid, ids, name, args, context=None):
      Severity: Minor
      Found in l10n_ar_base_vat/base_vat.py - About 45 mins to fix

        Function GenerarImagen has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        Severity: Minor
        Found in l10n_ar_afipws_fe/models/pyi25.py - About 45 mins to fix

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

          Severity: Minor
          Found in l10n_ar_bank_cbu/l10n_ar_bank_cbu.py and 1 other location - About 45 mins to fix
          l10n_ar_invoice_sale/res_config.py on lines 0..13

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

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

              def _create_journals(self):
                  self.ensure_one()
                  if self.type in ('sale', 'purchase'):
                      if self.invoice_subtype == 'invoice_and_refund':
                          invoice_subtypes = ['invoice', 'refund']
          Severity: Minor
          Found in l10n_ar_invoice/wizard/account_journal_create_wizard.py - About 45 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

          Avoid deeply nested control flow statements.
          Open

                                  if not line.product_id.uom_id.afip_code:
                                      raise Warning(_('Not afip code con producto UOM %s' % (
                                          line.product_id.uom_id.name)))
                                  u_mtx = line.product_id.uom_id.afip_code or line.uos_id.afip_code
          Severity: Major
          Found in l10n_ar_afipws_fe/models/invoice.py - About 45 mins to fix

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

                    invoices = self.env['account.invoice'].search(
                        domain + [('type', 'in', ['in_invoice', 'out_invoice'])])
            Severity: Major
            Found in l10n_ar_account_vat_ledger/account.py and 3 other locations - About 40 mins to fix
            l10n_ar_account_vat_ledger/account.py on lines 121..123
            l10n_ar_account_vat_ledger/account.py on lines 124..126
            l10n_ar_account_vat_ledger/account.py on lines 193..194

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

            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

                    refund_invoice_taxes = self.env['account.invoice.tax'].search(
                        taxes_domain +
                        [('invoice_id.type', 'in', ['in_refund', 'out_refund'])])
            Severity: Major
            Found in l10n_ar_account_vat_ledger/account.py and 3 other locations - About 40 mins to fix
            l10n_ar_account_vat_ledger/account.py on lines 121..123
            l10n_ar_account_vat_ledger/account.py on lines 191..192
            l10n_ar_account_vat_ledger/account.py on lines 193..194

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

            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

                    refund_invoices = self.env['account.invoice'].search(
                        domain + [('type', 'in', ['in_refund', 'out_refund'])])
            Severity: Major
            Found in l10n_ar_account_vat_ledger/account.py and 3 other locations - About 40 mins to fix
            l10n_ar_account_vat_ledger/account.py on lines 121..123
            l10n_ar_account_vat_ledger/account.py on lines 124..126
            l10n_ar_account_vat_ledger/account.py on lines 191..192

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

            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

                    having_where_clause = ' AND '.join(map(lambda x: '(SUM(bal2) %s %%s)' % (x[1]), args))
            Severity: Minor
            Found in l10n_ar_account_followup/account_followup.py and 1 other location - About 40 mins to fix
            l10n_ar_account_followup/account_followup.py on lines 59..59

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

            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

                    having_where_clause = ' AND '.join(map(lambda x: '(MIN(l.date_maturity) %s %%s)' % (x[1]), args))
            Severity: Minor
            Found in l10n_ar_account_followup/account_followup.py and 1 other location - About 40 mins to fix
            l10n_ar_account_followup/account_followup.py on lines 32..32

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

            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

                    invoice_taxes = self.env['account.invoice.tax'].search(
                        taxes_domain +
                        [('invoice_id.type', 'in', ['in_invoice', 'out_invoice'])])
            Severity: Major
            Found in l10n_ar_account_vat_ledger/account.py and 3 other locations - About 40 mins to fix
            l10n_ar_account_vat_ledger/account.py on lines 124..126
            l10n_ar_account_vat_ledger/account.py on lines 191..192
            l10n_ar_account_vat_ledger/account.py on lines 193..194

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

            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 do_button_print has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def do_button_print(self, cr, uid, ids, company_id=False, context=None):
            Severity: Minor
            Found in l10n_ar_account_followup/account_followup.py - About 35 mins to fix

              Function generate_tax_code has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def generate_tax_code(self, cr, uid, tax_code_root_id, company_id, context=None):
              Severity: Minor
              Found in l10n_ar_invoice/models/account.py - About 35 mins to fix

                Function _get_followup_overdue_query has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def _get_followup_overdue_query(self, cr, uid, args, overdue_only=False, context=None):
                Severity: Minor
                Found in l10n_ar_account_followup/account_followup.py - About 35 mins to fix

                  Function configure_chart has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def configure_chart(
                  Severity: Minor
                  Found in l10n_ar_invoice/models/account_chart_wizard.py - About 35 mins to fix

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

                        afip_ws = fields.Selection([
                            ('ws_sr_padron_a4', 'Servicio de Consulta de Padrón Alcance 4'),
                            ('ws_sr_padron_a5', 'Servicio de Consulta de Padrón Alcance 5'),
                            ('ws_sr_padron_a10', 'Servicio de Consulta de Padrón Alcance 10'),
                            ('ws_sr_padron_a100', 'Servicio de Consulta de Padrón Alcance 100'),
                    Severity: Minor
                    Found in l10n_ar_afipws/models/afipws_connection.py and 2 other locations - About 35 mins to fix
                    l10n_ar_invoice/report/invoice_analysis.py on lines 60..65
                    l10n_ar_invoice/wizard/account_journal_create_wizard.py on lines 61..74

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

                    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