pasosdeJesus/msip

View on GitHub

Showing 214 of 272 total issues

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

          def index(c = nil)
            if c.nil?
              c = Msip::Orgsocial.all
            end
            if params[:term]
Severity: Minor
Found in lib/msip/concerns/controllers/orgsociales_controller.rb - About 55 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 separa_apellidos_nombres has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def separa_apellidos_nombres(nombre, menserror)
      apellidos = "N"
      nombres = "N"
      n = nombre.to_s.gsub(/  */, " ").gsub(/^ /, "").gsub(/ $/, "")
      p = n.split(" ")
Severity: Minor
Found in app/helpers/msip/importa_helper.rb - About 55 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 update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

          def update
            if params && params[:orgsocial] &&
                params[:orgsocial][:orgsocial_persona_attributes]
              op_params = params[:orgsocial][:orgsocial_persona_attributes]
              op_params.each do |_clave, valor|
Severity: Minor
Found in lib/msip/concerns/controllers/orgsociales_controller.rb - About 55 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 formato_ubicacion has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def formato_ubicacion(u, con_centropoblado = true, con_pais = true)
      if u.nil?
        return ""
      end

Severity: Minor
Found in app/helpers/msip/ubicacion_helper.rb - About 55 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_departamento_municipio has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

          def par_departamento_municipio
            if (centropoblado_id || vereda_id || municipio_id) && 
                !departamento_id
                errors.add(
                  :departamento_id, "Falta departamento"
Severity: Minor
Found in lib/msip/concerns/models/ubicacionpre.rb - About 55 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_centropoblado has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

          def par_municipio_centropoblado
            if (centropoblado_id || vereda_id ) && !municipio_id
                errors.add(
                  :municipio_id, "Falta municipio"
                )
Severity: Minor
Found in lib/msip/concerns/models/ubicacionpre.rb - About 55 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 fecha_estandar_local has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def fecha_estandar_local(f)
      if !f || (f.class != String && f.class != Date &&
          f.class != ActiveSupport::TimeWithZone) ||
          (f.class == String && f == "")
        return nil
Severity: Minor
Found in app/helpers/msip/formato_fecha_helper.rb - About 55 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_fechanac has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

          def presenta_fechanac
            r = ""
            r += dianac.to_s if dianac
            r += "/"
            r += FormatoFechaHelper::ABMESES[mesnac] if mesnac &&
Severity: Minor
Found in lib/msip/concerns/models/persona.rb - About 55 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 edit_gen has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

          def edit_gen
            @registro = clase.constantize.find(params[:id])
            if @registro.respond_to?("current_usuario=")
              @registro.current_usuario = current_usuario
            end
Severity: Minor
Found in lib/msip/concerns/controllers/modelos_controller.rb - About 55 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 index has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

          def index(c = nil)
            if c.nil?
              c = Msip::Ubicacionpre.all
            end
            if params[:term]
Severity: Minor
Found in lib/msip/concerns/controllers/ubicacionespre_controller.rb - About 55 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 nomenclatura has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

          def nomenclatura(pais, departamento, municipio,
            centropoblado, vereda, lugar, sitio)
Severity: Major
Found in lib/msip/concerns/models/ubicacionpre.rb - About 50 mins to fix

    Method agregar_actualizar has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

                request, indparam1, indparam2, usuario_id, params,
                modelo, registro_id
    Severity: Major
    Found in lib/msip/concerns/models/bitacora.rb - About 50 mins to fix

      Avoid deeply nested control flow statements.
      Open

                if send(atr.to_s).to_s.include?("ActiveRecord_Associations_CollectionProxy")
                  e = send(atr.to_s)
                  e.inject("") do |memo, i|
                    (memo == "" ? "" : memo + "; ") +
                      (i.respond_to?("presenta_nombre") ? i.presenta_nombre.to_s : i.to_s)
      Severity: Major
      Found in app/models/msip/modelo.rb - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                        if(typeof el.tomselect === 'undefined' &&
                          (el.tagName == "INPUT" || el.tagName == "SELECT")) {
                            new TomSelect(el, window.configuracionTomSelect);
                        }
        Severity: Major
        Found in app/javascript/controllers/motor.js - About 45 mins to fix

          Method coleccion_basica has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def self.coleccion_basica(basica, ultimos_ids = nil)
                h = basica.habilitados
                unless ultimos_ids.nil?
                  idsh = h.map(&:id)
                  lu = ultimos_ids
          Severity: Minor
          Found in app/helpers/msip/modelo_helper.rb - 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

          Method edad_de_fechanac_fecha has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def edad_de_fechanac_fecha(anionac, mesnac, dianac,
                anio, mes, dia)
          Severity: Minor
          Found in app/helpers/msip/edad_sexo_helper.rb - About 45 mins to fix

            Method item_nav_pestaña_bs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def item_nav_pestaña_bs(idit, titulo, elegida = false,
                  clase_boton = "", &bloque)
                  content_tag(
                    :li,
                    class: "nav-item",
            Severity: Minor
            Found in app/helpers/msip/bootstrap_helper.rb - 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

            Method formato_ubicacion_partes has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def formato_ubicacion_partes(pais_id, departamento_id, municipio_id,
                  centropoblado_id, con_centropoblado, con_pais)
            Severity: Minor
            Found in app/helpers/msip/ubicacion_helper.rb - About 45 mins to fix

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

              function msip_ubicacionpre_expandible_busca_lugar(s, ubi) {
                root = window
                msip_arregla_puntomontaje(root)
                cnom = s.attr('id')
                v = $("#" + cnom).data('autocompleta')
              Severity: Minor
              Found in app/assets/javascripts/msip/ubicacionpre.js - 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

              Avoid deeply nested control flow statements.
              Open

                        elsif respond_to?(atr)
                          r = send(atr)
                          if r
                            r.presenta_nombre
                          else
              Severity: Major
              Found in app/models/msip/modelo.rb - About 45 mins to fix
                Severity
                Category
                Status
                Source
                Language