ingadhoc/odoo-argentina

View on GitHub

Showing 73 of 180 total issues

Function do_pyafipws_request_cae has a Cognitive Complexity of 111 (exceeds 5 allowed). Consider refactoring.
Open

    def do_pyafipws_request_cae(self):
        "Request to AFIP the invoices' Authorization Electronic Code (CAE)"
        for inv in self:
            # Ignore invoices with cae
            if inv.afip_auth_code and inv.afip_auth_code_due:
Severity: Minor
Found in l10n_ar_afipws_fe/models/invoice.py - About 2 days 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

File invoice.py has 764 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
Severity: Major
Found in l10n_ar_invoice/models/invoice.py - About 1 day to fix

    File invoice.py has 522 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    ##############################################################################
    # For copyright and license notices, see __openerp__.py file in module root
    # directory
    ##############################################################################
    Severity: Major
    Found in l10n_ar_afipws_fe/models/invoice.py - About 1 day to fix

      Function get_REGINFO_CV_CBTE has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_REGINFO_CV_CBTE(self):
              res = []
              invoices = self.get_citi_invoices()
              invoices.check_argentinian_invoice_taxes()
              if self.type == 'purchase':
      Severity: Minor
      Found in l10n_ar_account_vat_ledger_city/models/account_vat_report.py - About 5 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 verify_on_afip has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

          def verify_on_afip(self):
              """
      cbte_modo = "CAE"                    # modalidad de emision: CAI, CAE,
      CAEA
      cuit_emisor = "20267565393"          # proveedor
      Severity: Minor
      Found in l10n_ar_afipws_fe/models/invoice.py - About 4 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

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

      # -*- coding: utf-8 -*-
      ##############################################################################
      # For copyright and license notices, see __openerp__.py file in module root
      # directory
      ##############################################################################
      Severity: Minor
      Found in l10n_ar_invoice/models/account.py - About 4 hrs to fix

        Function get_withholding_vals has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_withholding_vals(self, voucher):
                vals = super(AccountTaxWithholding, self).get_withholding_vals(
                    voucher)
                base_amount = vals['withholdable_base_amount']
                if self.type == 'arba_ws':
        Severity: Minor
        Found in l10n_ar_account_withholding/models/account_tax_withholding.py - About 3 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 refres_currency_with_afip_ws has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            def refres_currency_with_afip_ws(self):
                """
                TODO: no reescribir este metodo si no que heredar de una mejor manera
                el original
                """
        Severity: Minor
        Found in l10n_ar_currency_update/models/currency_rate_update.py - About 3 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 _get_vals has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            def _get_vals(self, invoice_subtype=False):
                vals = {}
                domain = [
                    ('company_id', '=', self.company_id.id),
                    ]
        Severity: Minor
        Found in l10n_ar_invoice/wizard/account_journal_create_wizard.py - About 3 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 unify_geo_data has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

        def unify_geo_data(input_string):
            """
            Return unified geographic data
        
            >>> data = unify_geo_data("Av. rivadavia 9858, buenos aires, argentina")
        Severity: Minor
        Found in l10n_ar_bank/wizard/geosearch.py - About 3 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 ar_banks_iterator has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

        def ar_banks_iterator(
            url_bank_list='http://www.bcra.gov.ar/sisfin/sf010100.asp',
            url_bank_info='http://www.bcra.gov.ar/sisfin/sf010100.asp?bco=%s',
            country='Argentina'):
            """
        Severity: Minor
        Found in l10n_ar_bank/wizard/banks_def.py - About 3 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

        File account_vat_report.py has 295 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        ##############################################################################
        # For copyright and license notices, see __openerp__.py file in module root
        # directory
        ##############################################################################
        Severity: Minor
        Found in l10n_ar_account_vat_ledger_city/models/account_vat_report.py - About 3 hrs to fix

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

              def get_data_from_padron_afip(self):
                  self.ensure_one()
                  cuit = self.document_number
                  # GET COMPANY
                  # if there is certificate for user company, use that one, if not
          Severity: Minor
          Found in l10n_ar_padron_afip/models/res_partner.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 change_partner has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              def change_partner(self):
                  self.ensure_one()
                  self.field_ids.unlink()
                  partner = self.partner_id
                  fields_names = self.field_to_update_ids.mapped('name')
          Severity: Minor
          Found in l10n_ar_padron_afip/wizard/res_partner_update_from_padron_wizard.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 check_argentinian_invoice_taxes has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              def check_argentinian_invoice_taxes(self):
                  """
                  We make theis function to be used as a constraint but also to be called
                  from other models like vat citi
                  """
          Severity: Minor
          Found in l10n_ar_invoice/models/invoice.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 get_followup_table_html has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              def get_followup_table_html(self, cr, uid, ids, context=None):
                  """ Build the html tables to be included in emails send to partners,
                      when reminding them their overdue invoices.
                      :param ids: [id] of the partner for whom we are building the tables
                      :rtype: string
          Severity: Minor
          Found in l10n_ar_account_followup/account_followup.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 partner_address has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              def partner_address(self, partner, context=None):
                  ret = ''
                  if partner.street:
                      ret += partner.street
                  if partner.street2:
          Severity: Minor
          Found in l10n_ar_aeroo_base/parser.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

          account_invoice has 22 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class account_invoice(models.Model):
              _inherit = "account.invoice"
              _order = "afip_document_number desc, number desc, id desc"
          
              state_id = fields.Many2one(
          Severity: Minor
          Found in l10n_ar_invoice/models/invoice.py - About 2 hrs to fix

            Function _get_available_journal_document_class has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                def _get_available_journal_document_class(self):
                    invoice_type = self.type
                    document_class_ids = []
                    document_class_id = False
            
            
            Severity: Minor
            Found in l10n_ar_invoice/models/invoice.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 action_number has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                def action_number(self):
                    """
                    A partir de este metodo no debería haber errores porque el modulo de
                    factura electronica ya habria pedido el cae. Lo ideal sería hacer todo
                    esto antes que se pida el cae pero tampoco se pueden volver a atras los
            Severity: Minor
            Found in l10n_ar_invoice/models/invoice.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

            Severity
            Category
            Status
            Source
            Language