Trust-Code/odoo-brasil

View on GitHub

Showing 165 of 421 total issues

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

    def get_taxes_values(self):
        tax_grouped = {}
        for line in self.invoice_line_ids:
            other_taxes = line.invoice_line_tax_ids.filtered(
                lambda x: not x.domain)
Severity: Minor
Found in br_account/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

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

def validate_ie_ap(inscr_est):
    inscr_est = re.sub('[^0-9]', '', inscr_est)

    # verificando o tamanho da inscrição estadual
    if len(inscr_est) != 9:
Severity: Minor
Found in br_base/tools/fiscal.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_bank has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def get_bank(self):
        bank = self.journal_id.bank_id.bic

        if bank == '237':
            from cnab240.bancos import bradesco
Severity: Minor
Found in br_cnab/wizard/wizard_import_cnab.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 zip_search_multi has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

    def validate_ie_to(inscr_est):
        inscr_est = re.sub('[^0-9]', '', inscr_est)
    
        # verificando o tamanho da inscrição estadual
        if len(inscr_est) == 11:
    Severity: Minor
    Found in br_base/tools/fiscal.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 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_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 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 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 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 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 _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 _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

              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 _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 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
                    Severity
                    Category
                    Status
                    Source
                    Language