Trust-Code/odoo-brasil

View on GitHub

Showing 165 of 421 total issues

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

    def set_domain(self, country_id=False, state_id=False,
Severity: Minor
Found in br_zip/models/br_zip.py - About 45 mins to fix

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

        def compute_all(self, price_unit, currency=None, quantity=1.0,
                        product=None, partner=None):
    
            exists_br_tax = len(self.filtered(lambda x: x.domain)) > 0
            if not exists_br_tax:
    Severity: Minor
    Found in br_account/models/account_tax.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 _invoice_total has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def _invoice_total(self):
            account_invoice_report = self.env['account.invoice.report']
            if not self.ids:
                self.total_invoiced = 0.0
                return True
    Severity: Minor
    Found in br_account/models/res_partner.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_worked_day_lines has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_worked_day_lines(self, contract_ids, date_from, date_to):
            res = super(HrPayslip, self).get_worked_day_lines(
                contract_ids, date_from, date_to)
            for contract in contract_ids:
                leaves = self.env['hr.holidays'].search(
    Severity: Minor
    Found in br_hr_payroll/model/hr_payslip.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 _process_order has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def _process_order(self, pos_order):
            num_controle = int(''.join([str(SystemRandom().randrange(9))
                                        for i in range(8)]))
            res = super(PosOrder, self)._process_order(pos_order)
            res.numero_controle = str(num_controle)
    Severity: Minor
    Found in br_point_sale/models/pos_order.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 seach_by_address has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def seach_by_address(self, obj, country_id=False, state_id=False,
    Severity: Minor
    Found in br_zip/models/br_zip.py - About 45 mins to fix

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

          def _compute_ipi(self, price_base):
              ipi_tax = self.filtered(lambda x: x.domain == 'ipi')
              if not ipi_tax:
                  return []
              vals = self._tax_vals(ipi_tax)
      Severity: Minor
      Found in br_account/models/account_tax.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 modulo11 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def modulo11(num, base=9, r=0):
              if not isinstance(num, basestring):
                  raise TypeError
              soma = 0
              fator = 2
      Severity: Minor
      Found in br_cnab/febraban/cnab_240/bancos/santander.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 modulo11 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def modulo11(self, num, base=9, r=0):
              if not isinstance(num, basestring):
                  raise TypeError
              soma = 0
              fator = 2
      Severity: Minor
      Found in br_cnab/febraban/cnab_240/bancos/bradesco.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 _check_cnpj_cpf has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def _check_cnpj_cpf(self):
              check_cnpj_cpf = True
              if self.cnpj_cpf:
                  if self.cpfcnpj_type == 'cnpj':
                      if not fiscal.validate_cnpj(self.cnpj_cpf):
      Severity: Minor
      Found in br_account/models/br_account.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 onchange_invoice_related_id has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def onchange_invoice_related_id(self):
              if not self.invoice_related_id:
                  return
              inv_id = self.invoice_related_id
              if not inv_id.fiscal_document_id:
      Severity: Minor
      Found in br_account/models/br_account.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 _check_cnpj_cpf has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def _check_cnpj_cpf(self):
              country_code = self.country_id.code or ''
              if self.cnpj_cpf and country_code.upper() == 'BR':
                  if self.is_company:
                      if not fiscal.validate_cnpj(self.cnpj_cpf):
      Severity: Minor
      Found in br_base/models/res_partner.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 invoice_validate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def invoice_validate(self):
              res = super(AccountInvoice, self).invoice_validate()
              self.action_number()
              for item in self:
                  if item.is_eletronic and\
      Severity: Minor
      Found in br_account_einvoice/models/account_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

      Consider simplifying this complex logical expression.
      Open

                  if bank_account.bank_id:
                      acc_number_format = bank_account.bank_id.acc_number_format \
                          or '%(acc_number)s'
                      args = {
                          'bra_number': bank_account.bra_number or '',
      Severity: Major
      Found in br_base/models/res_bank.py - About 40 mins to fix

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

            def values_postprocess(self, order, mode, values, errors, error_msg):
        Severity: Minor
        Found in br_website_sale/controllers/main.py - About 35 mins to fix

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

              def compute_all(self, price_unit, currency=None, quantity=1.0,
          Severity: Minor
          Found in br_account/models/account_tax.py - About 35 mins to fix

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

                def create(self, cr, uid, ids, datas, context=False):
            Severity: Minor
            Found in br_nfe/reports/report.py - About 35 mins to fix

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

                  def _load_template(self, company, code_digits=None,
              Severity: Minor
              Found in br_account/models/account_tax.py - About 35 mins to fix

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

                    def _filter_rules(self, fpos_id, type_tax, partner, product, state):
                Severity: Minor
                Found in br_account/models/account_fiscal_position.py - About 35 mins to fix

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

                      def _prepare_refund(self, invoice, date_invoice=None, date=None,
                  Severity: Minor
                  Found in br_account/models/account_invoice.py - About 35 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language