Trust-Code/odoo-brasil

View on GitHub

Showing 165 of 421 total issues

Avoid too many return statements within this function.
Open

            return sicredi
Severity: Major
Found in br_cnab/wizard/wizard_import_cnab.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return Cef240
    Severity: Major
    Found in br_cnab/febraban/cnab_240/cnab_240.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return nosso_numero
      Severity: Major
      Found in br_cnab/wizard/wizard_import_cnab.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return itau
        Severity: Major
        Found in br_cnab/wizard/wizard_import_cnab.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return Itau240
          Severity: Major
          Found in br_cnab/febraban/cnab_240/cnab_240.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return Cnab240
            Severity: Major
            Found in br_cnab/febraban/cnab_240/cnab_240.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return rule_points
              Severity: Major
              Found in br_account/models/account_fiscal_position.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return nova_ie == inscr_est_ints
                Severity: Major
                Found in br_base/tools/fiscal.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return santander
                  Severity: Major
                  Found in br_cnab/wizard/wizard_import_cnab.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return Santander240
                    Severity: Major
                    Found in br_cnab/febraban/cnab_240/cnab_240.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return -1
                      Severity: Major
                      Found in br_account/models/account_fiscal_position.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return int(nosso_numero[10:])
                        Severity: Major
                        Found in br_cnab/wizard/wizard_import_cnab.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return {
                          Severity: Major
                          Found in br_nfse/models/account_invoice.py - About 30 mins to fix

                            Function send_letter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def send_letter(self):
                                    self.valida_carta_correcao_eletronica()
                            
                                    tz = pytz.timezone(self.env.user.partner_id.tz) or pytz.utc
                                    dt_evento = datetime.utcnow()
                            Severity: Minor
                            Found in br_nfe/wizard/carta_correcao_eletronica.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 _filter_rules has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def _filter_rules(self, fpos_id, type_tax, partner, product, state):
                                    rule_obj = self.env['account.fiscal.position.tax.rule']
                                    domain = [('fiscal_position_id', '=', fpos_id),
                                              ('domain', '=', type_tax)]
                                    rules = rule_obj.search(domain)
                            Severity: Minor
                            Found in br_account/models/account_fiscal_position.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_invoice_draft has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def action_invoice_draft(self):
                                    for item in self:
                                        docs = self.env['invoice.eletronic'].search(
                                            [('invoice_id', '=', item.id)])
                                        for doc in docs:
                            Severity: Minor
                            Found in br_nfe/models/account_invoice.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_get_status has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def action_get_status(self):
                                    cert = self.company_id.with_context({'bin_size': False}).nfe_a1_file
                                    cert_pfx = base64.decodestring(cert)
                                    certificado = Certificado(cert_pfx, self.company_id.nfe_a1_password)
                                    consulta = {
                            Severity: Minor
                            Found in br_nfe/models/invoice_eletronic.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_number has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def action_number(self):
                                    for invoice in self:
                                        if invoice.is_eletronic:
                                            if not invoice.document_serie_id.internal_sequence_id.id:
                                                raise UserError(
                            Severity: Minor
                            Found in br_account_einvoice/models/account_invoice.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 _onchange_cnpj_cpf has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def _onchange_cnpj_cpf(self):
                                    country_code = self.country_id.code or ''
                                    if self.cnpj_cpf and country_code.upper() == 'BR':
                                        val = re.sub('[^0-9]', '', self.cnpj_cpf)
                                        if len(val) == 14:
                            Severity: Minor
                            Found in br_base/models/res_partner.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 _find_attachment_ids_email has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def _find_attachment_ids_email(self):
                                    atts = super(InvoiceEletronic, self)._find_attachment_ids_email()
                                    if self.model not in ('55'):
                                        return atts
                            
                            
                            Severity: Minor
                            Found in br_nfe/models/invoice_eletronic.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