pasosdeJesus/sivel2_gen

View on GitHub

Showing 228 of 380 total issues

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))
        puts "No se pudo usar modelorango"
        return -1
Severity: Minor
Found in app/helpers/sivel2_gen/rangoedad_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 principal= has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def principal=(v)
            if self.id && self.caso
              if v.to_i == 1
                self.caso.update_attribute('ubicacion_id', self.id)
              elsif self.caso.ubicacion_id == self.id
Severity: Minor
Found in lib/sivel2_gen/concerns/models/ubicacion.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 procesa_un_filtrom has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def procesa_un_filtrom(where1, r, ids)
            if r[:nomfiltro] == :aniosnac
              where1 += (where1 != '' ? ' AND ' : '') + 
                "(persona.anionac IS NULL OR persona.anionac IN ('" +
                ids.sort.join("', '") + "'))"
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/graficar_conteo_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

Function presentarMapaOsm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  presentarMapaOsm(usuario_autenticado) {
    var usuario_aut_global = usuario_autenticado;
    // Borrar clase container y ocultar pie de página
    document.querySelector('.navbar').classList.add('navbarosm');
    document.querySelector('.card-body').classList.add('cardbodyosm');
Severity: Minor
Found in app/javascript/controllers/mapaosm_controller.js - 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 genvic has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def genvic
            authorize! :contar, Sivel2Gen::Caso

            where1 = '';
            @fechaini = '';
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/conteos_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 remplazar_sivel2_gen has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def remplazar_sivel2_gen
            @persona = Msip::Persona.find(params[:persona_id].to_i)
            @caso = Sivel2Gen::Caso.find(params[:caso_id].to_i)
            @caso.current_usuario = current_usuario
            @vic_position = params[:vic_position].to_i
Severity: Minor
Found in lib/sivel2_gen/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

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

          def remplazarfamiliar
            @caso = Sivel2Gen::Caso.find(params[:caso_id])
            @caso.current_usuario = current_usuario
            @personados = Msip::Persona.find(params[:persona_id].to_i)
            @vic_position = params[:vic_position].to_i
Severity: Minor
Found in lib/sivel2_gen/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

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

          def nuevo
            if !params[:caso_id].nil?
              @presponsable = CasoPresponsable.new
              @presponsable.caso_id = params[:caso_id]
              @presponsable.presponsable_id = 35
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/presponsables_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
Severity: Major
Found in lib/sivel2_gen/concerns/controllers/actos_controller.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                      return
    Severity: Major
    Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return true
      Severity: Major
      Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                          return
        Severity: Major
        Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                            return
          Severity: Major
          Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                              return
            Severity: Major
            Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                return
              Severity: Major
              Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                  return
                Severity: Major
                Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                    return
                  Severity: Major
                  Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                  return
                    Severity: Major
                    Found in lib/sivel2_gen/concerns/controllers/actos_controller.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                    return
                      Severity: Major
                      Found in lib/sivel2_gen/concerns/controllers/actoscolectivos_controller.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return mi + ai + " - " + mf + af
                        Severity: Major
                        Found in lib/sivel2_gen/concerns/controllers/mapadep_controller.rb - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language