pasosdeJesus/msip

View on GitHub

Showing 214 of 272 total issues

Avoid too many return statements within this method.
Open

      return p.to_s + "PB"
Severity: Major
Found in app/helpers/msip/procesos_helper.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                  return Msip::Ubicacionpre.where(nombre: w[:nombre]).first.id
    Severity: Major
    Found in lib/msip/concerns/models/ubicacionpre.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                    return nil
      Severity: Major
      Found in lib/msip/concerns/models/ubicacionpre.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                      return nil
        Severity: Major
        Found in lib/msip/concerns/models/ubicacionpre.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                        return Msip::Ubicacionpre.where(w).take.id
          Severity: Major
          Found in lib/msip/concerns/models/ubicacionpre.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                              return ubi[0].id
            Severity: Major
            Found in lib/msip/concerns/models/ubicacionpre.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return t.to_s + "TB"
              Severity: Major
              Found in app/helpers/msip/procesos_helper.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                              return Msip::Ubicacionpre.where(w).take.id
                Severity: Major
                Found in lib/msip/concerns/models/ubicacionpre.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                    return ubi[0].id
                  Severity: Major
                  Found in lib/msip/concerns/models/ubicacionpre.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                      return nil
                    Severity: Major
                    Found in lib/msip/concerns/models/ubicacionpre.rb - About 30 mins to fix

                      Method index has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                                def index
                                  c = nil
                                  if params[:pais_id]
                                    idpais = params[:pais_id] != "" ? params[:pais_id].to_i : nil
                                    c = Msip::Departamento.where(
                      Severity: Minor
                      Found in lib/msip/concerns/controllers/departamentos_controller.rb - 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

                      Method despliega_abajo_prosidebar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def despliega_abajo_prosidebar(
                            opcionmenu, iconomenu = nil, iconoexp = nil, &bloque
                          )
                            ia = "".html_safe
                            if iconomenu
                      Severity: Minor
                      Found in app/helpers/msip/bootstrap_helper.rb - 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

                      Method par_municipio_vereda has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                                def par_municipio_vereda
                                  if municipio_id && vereda_id
                                    if Msip::Vereda.where(municipio_id: municipio_id, 
                                        id: vereda_id).count != 1
                                      errors.add(
                      Severity: Minor
                      Found in lib/msip/concerns/models/ubicacionpre.rb - 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

                      Method capitaliza_titulo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def capitaliza_titulo(t)
                            r = ""
                            n = t.split(/\s+/)
                            unless n.empty?
                              r = n[0].titleize
                      Severity: Minor
                      Found in app/helpers/msip/localiza_helper.rb - 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

                      Method which has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def which(cmd)
                            exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""]
                            ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
                              exts.each do |ext|
                                exe = File.join(path, "#{cmd}#{ext}")
                      Severity: Minor
                      Found in app/helpers/msip/tareasrake_helper.rb - 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

                      Method vformatonumdoc has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                                def vformatonumdoc
                                  if tdocumento && tdocumento.formatoregex != "" &&
                                      !(numerodocumento =~ Regexp.new("^#{tdocumento.formatoregex}$"))
                                    menserr = "Número de documento con formato errado."
                                    if tdocumento.ayuda
                      Severity: Minor
                      Found in lib/msip/concerns/models/persona.rb - 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 ponerTemaUsuarioAjax has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                        static async ponerTemaUsuarioAjax(){
                          var root = window
                          var ruta = 'temausuario'
                          var datos = {}
                          var t = Date.now();
                      Severity: Minor
                      Found in app/javascript/controllers/motor.js - 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

                      Method par_pais_departamento has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                                def par_pais_departamento
                                  if pais_id && departamento_id
                                    if Msip::Departamento.where(pais_id: pais_id, 
                                        id: departamento_id).count != 1
                                      errors.add(
                      Severity: Minor
                      Found in lib/msip/concerns/models/ubicacionpre.rb - 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

                      Method presenta_base has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                                def self.presenta_base(registro, atr)
                                  case atr.to_s
                                  when "actualizacion"
                                    registro.updated_at
                                  when "condensado_de_clave"
                      Severity: Minor
                      Found in lib/msip/concerns/models/usuario.rb - 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

                      Method tema_usuario has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def tema_usuario(current_usuario)
                            t = if !current_usuario || !current_usuario.tema_id
                              if Msip::Tema.where(id: 1).count == 1
                                Msip::Tema.find(1)
                              else
                      Severity: Minor
                      Found in app/helpers/msip/temas_helper.rb - 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