pasosdeJesus/msip

View on GitHub

Showing 214 of 272 total issues

Method item_nav_pestaña_bs has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def item_nav_pestaña_bs(idit, titulo, elegida = false,
      clase_boton = "", &bloque)
Severity: Minor
Found in app/helpers/msip/bootstrap_helper.rb - About 35 mins to fix

    Function msip_ubicacionpre_expandible_registra has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function msip_ubicacionpre_expandible_registra(iniid, campoubi, root, 
      fcamdep = null, fcammun = null) {
    Severity: Minor
    Found in app/assets/javascripts/msip/ubicacionpre.js - About 35 mins to fix

      Method poromision_con2p has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def poromision_con2p(params, p1,  p2, s, 
                                    valorsp = "")
      Severity: Minor
      Found in app/helpers/msip/modelo_helper.rb - About 35 mins to fix

        Method descarga_anexo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

                  def descarga_anexo
                    if !params[:id].nil?
                      @anexo = Anexo.find(params[:id].to_i)
                      ruta = @anexo.adjunto_file_name
                      if !ruta.nil?
        Severity: Minor
        Found in lib/msip/concerns/controllers/anexos_controller.rb - About 35 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 cambiar_convencion_sexo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def cambiar_convencion_sexo(convencion_final)
              unless Msip::Persona::CONVENCIONES_SEXO.keys.include?(convencion_final)
                Rails.logger.debug { "Conveción desconocida: #{convecion_final}" }
                exit(1)
              end
        Severity: Minor
        Found in app/helpers/msip/sql_helper.rb - About 35 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 fechanac has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

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

            def buscar_rango_edad(edad, modelorango)
              if !modelorango || !defined?(modelorango.constantize) ||
                  !defined?(!modelorango.constantize.habilitados)
                Rails.logger.debug("No se pudo usar modelorango")
                return -1
        Severity: Minor
        Found in app/helpers/msip/edad_sexo_helper.rb - About 35 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 barra_navegacion_prosidebar has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def barra_navegacion_prosidebar(opciones, &bloque)
              fondo = "".html_safe
              if opciones[:imagen_barra_lateral]
                fondo = content_tag(
                  :div, class: "image-wrapper"
        Severity: Minor
        Found in app/helpers/msip/bootstrap_helper.rb - About 35 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 abre_anexo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

                  def abre_anexo
                    if !params[:id].nil?
                      @anexo = Anexo.find(params[:id].to_i)
                      ruta = @anexo.adjunto_file_name
                      if !ruta.nil?
        Severity: Minor
        Found in lib/msip/concerns/controllers/anexos_controller.rb - About 35 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 genera_asociabasica has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def genera_asociabasica
              if ENV["DISABLE_SPRING"].to_i != 1
                # http://makandracards.com/makandra/24525-disabling-spring-when-debugging
                Rails.logger.debug("Ejecutar con DISABLE_SPRING=1")
                return
        Severity: Minor
        Found in lib/generators/msip/asociabasica_generator.rb - About 35 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 mundep has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

                  def mundep
                    if !params[:term]
                      respond_to do |format|
                        format.html { render(inline: "Falta variable term") }
                        format.json { render(inline: "Falta variable term") }
        Severity: Minor
        Found in lib/msip/concerns/controllers/municipios_controller.rb - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
        Open

                  def index
                    if !params[:term]
                      respond_to do |format|
                        format.html { render(inline: "Falta variable term") }
                        format.json { render(inline: "Falta variable term") }
        Severity: Minor
        Found in lib/msip/concerns/controllers/gruposper_controller.rb - About 35 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_ddMyyyy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

              def fecha_ddMyyyy(*fields)
                fields.each do |f|
                  define_method("#{f}_ddMyyyy") do
                    val = read_attribute(f)
                    unless val
        Severity: Minor
        Found in lib/ext/ActiveRecord/base.rb - About 35 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 mejora_nuevo_numerodocumento_sindoc has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

                  def mejora_nuevo_numerodocumento_sindoc(
                    numdoc, persona_id
                  )
                    numerodocumento = numdoc.to_s + rand(100).to_s
                    #% 2147483647 # Max. INTEGER de PostgreSQL
        Severity: Minor
        Found in lib/msip/concerns/controllers/personas_controller.rb - About 35 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 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 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 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
                    Severity
                    Category
                    Status
                    Source
                    Language