bmya/odoo-bmya-cl

View on GitHub

Showing 30 of 71 total issues

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

    def get_document_class_default(self, document_classes):
        if self.turn_issuer.vat_affected not in ['SI']:
            exempt_ids = [
                self.env.ref('l10n_cl_invoice.dc_y_f_dtn').id,
                self.env.ref('l10n_cl_invoice.dc_y_f_dte').id]
Severity: Minor
Found in l10n_cl_invoice/models/invoice.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 _printed_prices has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _printed_prices(self, cr, uid, ids, name, args, context=None):
Severity: Minor
Found in l10n_cl_invoice/models/invoice_line.py - About 45 mins to fix

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

        def create_sequence(self, cr, uid, name, journal, context=None):
    Severity: Minor
    Found in l10n_cl_invoice/wizard/journal_config_wizard.py - About 35 mins to fix

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

          def get_worked_days(self, form, emp_id, emp_salary, mes, ano):
      Severity: Minor
      Found in l10n_cl_hr_payroll/report/report_hr_salary_book.py - About 35 mins to fix

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

            def create_journals(self, cr, uid, journal_ids, wz, context=None):
        Severity: Minor
        Found in l10n_cl_invoice/wizard/journal_config_wizard.py - About 35 mins to fix

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

              def get_salary(self, emp_id, emp_salary, cod_id, mes, ano):
          Severity: Minor
          Found in l10n_cl_hr_payroll/report/report_hr_salary_book.py - About 35 mins to fix

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

                def download_document(self, model, field, id, filename=None, **kw):
            Severity: Minor
            Found in l10n_cl_dte/controllers/downloader.py - About 35 mins to fix

              Function send_dte has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def send_dte(self):
                      self.ensure_one()
              
                      _logger.info('Entering Send XML Function')
                      _logger.info(
              Severity: Minor
              Found in l10n_cl_dte/models/invoice.py - About 35 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 check_vat_cl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def check_vat_cl (self, vat):
                      body, vdig = '', ''
                      if len(vat) > 9:
                          vat = vat.replace('-','',1).replace('.','',2)
                      if len(vat) != 9:
              Severity: Minor
              Found in l10n_cl_base_rut/base_vat.py - About 25 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 action_enable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def action_enable(self):
                      result = xmltodict.parse(
                          base64.b64decode(self.caf_file).replace(
                              '<?xml version="1.0"?>','',1))['AUTORIZACION']['CAF']['DA']
              
              
              Severity: Minor
              Found in l10n_cl_dte_caf/models/caf.py - About 25 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

              Severity
              Category
              Status
              Source
              Language