pasosdeJesus/msip

View on GitHub

Showing 214 of 272 total issues

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

          def identificacionsd
            pid = nil
            if params && params[:persona_id] && params[:persona_id] != ""
              pid = params[:persona_id].to_i
            end
Severity: Minor
Found in lib/msip/concerns/controllers/personas_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 index has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def index
            c = nil
            if params[:departamento_id]
              iddep = params[:departamento_id].to_i > 0 ? 
                params[:departamento_id].to_i : nil
Severity: Minor
Found in lib/msip/concerns/controllers/municipios_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 index has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def index
            c = nil
            if params[:municipio_id] 
              idmun = params[:municipio_id].to_i > 0 ?
                params[:municipio_id].to_i : nil
Severity: Minor
Found in lib/msip/concerns/controllers/centrospoblados_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 validar_conjunto_veredas_biyeccion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def validar_conjunto_veredas_biyeccion(validaciones)
            if Msip::Vereda.all.count != Msip::Ubicacionpre.
                where(lugar: nil).where.not(vereda_id: nil).
                where(centropoblado_id: nil).count
              validaciones << {
Severity: Minor
Found in lib/msip/concerns/controllers/ubicacionespre_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 validar_conjunto_municipios_biyeccion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def validar_conjunto_municipios_biyeccion(validaciones)
            if Msip::Municipio.all.count != Msip::Ubicacionpre.
                where(lugar: nil).where.not(municipio_id: nil).
                where(centropoblado_id: nil).where(vereda_id: nil).count
              validaciones << {
Severity: Minor
Found in lib/msip/concerns/controllers/ubicacionespre_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 mundep has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def mundep
            if params[:term]
              term = Msip::Ubicacion.connection.quote_string(params[:term])
              consNomubi = term.downcase.strip # sin_tildes
              consNomubi.gsub!(/ +/, ":* & ")
Severity: Minor
Found in lib/msip/concerns/controllers/ubicacionespre_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 a_decimal_localizado has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def a_decimal_localizado
    if !self || self == ""
      return ""
    end

Severity: Minor
Found in lib/ext/string.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 validar_conjunto_centrospoblados_biyeccion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def validar_conjunto_centrospoblados_biyeccion(validaciones)
            if Msip::Centropoblado.all.count != Msip::Ubicacionpre.
                where(lugar: nil).where.not(centropoblado_id: nil).
                where(vereda_id: nil).count
              validaciones << {
Severity: Minor
Found in lib/msip/concerns/controllers/ubicacionespre_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 nuevo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def nuevo
            authorize! :nuevo, Msip::Ubicacion
            if !params[:caso_id] || params[:caso_id] == ""
              respond_to do |format|
                format.html { render(inline: "Falta identificacion del caso") }
Severity: Minor
Found in lib/msip/concerns/controllers/ubicaciones_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 validar_conjunto_departamentos_biyeccion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def validar_conjunto_departamentos_biyeccion(validaciones)
            if Msip::Departamento.all.count != Msip::Ubicacionpre.
                where(lugar: nil).where.not(departamento_id: nil).
                where(municipio_id: nil).count
              validaciones << {
Severity: Minor
Found in lib/msip/concerns/controllers/ubicacionespre_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 show_msip has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def show_msip
            @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 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 validar_conjunto_paises_biyeccion has a Cognitive Complexity of 6 (exceeds 5 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 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 genera_tablabasica has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def genera_tablabasica
      if ENV["DISABLE_SPRING"].to_i != 1
        # http://makandracards.com/makandra/24525-disabling-spring-when-debugging
        puts "Ejecutar con DISABLE_SPRING=1"
        exit(1)
Severity: Minor
Found in lib/generators/msip/tablabasica_generator.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 index has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def index
            c = nil
            if params[:municipio_id]
              idmun = params[:municipio_id].to_i > 0 ? 
                params[:municipio_id].to_i : nil
Severity: Minor
Found in lib/msip/concerns/controllers/veredas_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

Severity
Category
Status
Source
Language