pasosdeJesus/msip

View on GitHub

Showing 272 of 272 total issues

Method despliega_abajo_dk has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def despliega_abajo_dk(opcionmenu, url, opciones = {}, &bloque)
      copiaop = opciones
      opab = opcionmenu.gsub(" ", "_")
      maticon = "home"
      if opciones[:maticon]
Severity: Minor
Found in app/helpers/msip/bootstrap_helper.rb - About 1 hr to fix

    Method filtra_contenido_params has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

              def filtra_contenido_params
                if !params || !params[:ubicacionpre] || 
                    !params[:ubicacionpre][:lugar] ||
                    !params[:ubicacionpre][:lugar].strip == '' ||
                    !params[:ubicacionpre][:pais_id] ||
    Severity: Minor
    Found in lib/msip/concerns/controllers/ubicacionespre_controller.rb - About 1 hr 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 validar_conjunto_paises_biyeccion has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def validar_conjunto_paises_biyeccion(validaciones)
                if Msip::Pais.all.count != Msip::Ubicacionpre.where(lugar: nil).
                    where(departamento_id: nil).count
                  validaciones << {
                    titulo: "Diferencia en paises y ubicacionespre dpa de paises",
    Severity: Minor
    Found in lib/msip/concerns/controllers/ubicacionespre_controller.rb - About 1 hr to fix

      Method initialize_msip has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def initialize_msip(usuario = nil)
            # El primer argumento para can es la acción a la que se da permiso,
            # el segundo es el recurso sobre el que puede realizar la acción,
            # el tercero opcional es un diccionario de condiciones para filtrar
            # más (e.g :publicado => true).
      Severity: Minor
      Found in app/models/msip/ability.rb - About 1 hr to fix

        Function enviarAutomaticoFormulario has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          static enviarAutomaticoFormulario(f, metodo = 'GET', tipo = 'script', alertaerror = true, vcommit = 'Enviar', agenviarautom = true) {
            const root = window;
            const t = Date.now();
            let d = -1;
            if (root.msip_enviarautomatico_t) {
        Severity: Minor
        Found in app/javascript/controllers/motor.js - About 1 hr to fix

          Method barra_navegacion has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              def barra_navegacion(opciones, &bloque)
                r = content_tag(
                  :nav,
                  class: "navbar navbar-expand-lg navbar-light bg-light",
                ) do
          Severity: Minor
          Found in app/helpers/msip/bootstrap_helper.rb - About 1 hr 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 reconoce_adivinando_locale has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              def reconoce_adivinando_locale(f, menserror = nil)
                if !f || (f.class != String && f.class != Date) ||
                    (f.class == String && f == "")
                  return nil
                end
          Severity: Minor
          Found in app/helpers/msip/formato_fecha_helper.rb - About 1 hr 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 dif_meses_dias has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              def dif_meses_dias(fechaini, fechafin)
                m = 0
                d = 0
                if fechaini && fechafin && fechaini < fechafin
                  if fechafin.month < fechaini.month
          Severity: Minor
          Found in app/helpers/msip/formato_fecha_helper.rb - About 1 hr 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 item_acordeon_bs has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              def item_acordeon_bs(
                acid, idit, titulo, expandido = false, opciones_ps = {}, &bloque
              )
                opciones = opciones_ps.stringify_keys
                content_tag(
          Severity: Minor
          Found in app/helpers/msip/bootstrap_helper.rb - About 1 hr 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 modelo_path has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              def modelo_path(o, posfijo_path = true)
                if o.nil?
                  return main_app.root_path
                end
          
          
          Severity: Minor
          Found in app/helpers/msip/modelo_helper.rb - About 1 hr 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 carga_semillas_sql has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

            def self.carga_semillas_sql(conexion, motor, tipoarchivo, patexcluye = nil)
              if tipoarchivo.to_s != "datos" && tipoarchivo.to_s != "cambios"
                raise "Las semillas solo pueden ser cambios o datos"
              end
          
          
          Severity: Minor
          Found in lib/msip.rb - About 1 hr 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 remplazarOpcionesSelect has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            static remplazarOpcionesSelect(
              idElemento, nuevasop, usatomselect = false, cid = 'id',
              cetiqueta = 'nombre', opvacia = false
            ) {
              let elemento = document.getElementById(idElemento)
          Severity: Minor
          Found in app/javascript/controllers/motor.js - About 1 hr to fix

            Function cambia_tdocumento has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              cambia_tdocumento(e) {
                var purl = window.puntomontaje;
                if (purl == "/") {
                  purl = "";
                }
            Severity: Minor
            Found in app/javascript/controllers/sindocaut_controller.js - About 1 hr to fix

              Method genera_modelo has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def genera_modelo
                    template(
                      "tablabasica.rb.erb",
                      "app/models/#{nom_arch}.rb",
                    )
              Severity: Minor
              Found in lib/generators/msip/asociabasica_generator.rb - About 1 hr to fix

                Method ruta_responde_0p has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    def ruta_responde_0p(n)
                      begin
                        r = send(n)
                        return [n, r]
                      rescue NoMethodError
                Severity: Minor
                Found in app/helpers/msip/modelo_helper.rb - About 1 hr 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 ruta_responde_1p has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    def ruta_responde_1p(n, p)
                      begin
                        r = send(n, p)
                        return [n, r]
                      rescue NoMethodError
                Severity: Minor
                Found in app/helpers/msip/modelo_helper.rb - About 1 hr 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 asociacion_combinada has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                      def self.asociacion_combinada(atr)
                        r = nil
                        if atr.is_a?(Hash) &&
                            (atr.first[0].to_s.ends_with?("_ids") ||
                             atr.first[0].to_s.ends_with?("_attributes"))
                Severity: Minor
                Found in app/models/msip/modelo.rb - About 1 hr 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 a has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          def self.a(ip, usuario_id, url, params,
                            modelo, modelo_id, operacion, detalle_json = "{}")
                            url = url ? url.to_s : ""
                            url = url[0..49] if url && url.length > 50
                            modelo = modelo ? modelo.to_s : ""
                Severity: Minor
                Found in lib/msip/concerns/models/bitacora.rb - About 1 hr to fix

                  Method index has 39 lines of code (exceeds 25 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 1 hr to fix

                    Method nomenclatura has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                              def nomenclatura(pais, departamento, municipio,
                                centropoblado, vereda, lugar, sitio)
                                if pais.to_s.strip == ""
                                  return ['', '']
                                end
                    Severity: Minor
                    Found in lib/msip/concerns/models/ubicacionpre.rb - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language