pasosdeJesus/sivel2_gen

View on GitHub

Showing 241 of 410 total issues

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

          def personas_segun_tipico(tabla, nomtabla, que1, que3, tablas3, where3)
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                  if usuario.filtrodepartamento_ids.count > 0
                    dicc_filtro[:ubicacion]={ 
                      departamento_id: usuario.filtrodepartamento_ids
                    }
                  end
    Severity: Major
    Found in app/models/sivel2_gen/ability.rb - About 45 mins to fix

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

          def poblacion_por_rango_sexo(caso_id, anio, mes, dia, modelorango, 
                                       rangoedadsexo, totsexo)
            caso = Sivel2Gen::Caso.where(id: caso_id)
            if caso.count < 1 
              return false
      Severity: Minor
      Found in app/helpers/sivel2_gen/rangoedad_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

      Avoid deeply nested control flow statements.
      Open

                    fini = Sivel2Gen::Caso.all.minimum(:fecha) ?
                      Sivel2Gen::Caso.all.minimum(:fecha) : Date.new(1970,01,01)
      Severity: Major
      Found in app/models/sivel2_gen/ability.rb - About 45 mins to fix

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

                  def procesa_filtros_fechas(where1)
                    if (params[:filtro] && params[:filtro]['fechaini'] && 
                        params[:filtro]['fechaini'] != "") 
                      @pFechaini = fecha_local_estandar(params[:filtro]['fechaini'])
                    else
        Severity: Minor
        Found in lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.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

        Avoid deeply nested control flow statements.
        Open

                        if(opc.value == val){
                          opc.selected = true;
                        }
        Severity: Major
        Found in app/javascript/controllers/motor.js - About 45 mins to fix

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

            armarRutaConsulta(rutaSinPuntomontaje, usuarioAutenticado) {
              var ruta = window.puntoMontaje + rutaSinPuntomontaje;
              var desde = document.getElementById('campo-desde').value;
              var hasta = document.getElementById('campo-hasta').value;
              var departamento = document.getElementById('departamento').value;
          Severity: Minor
          Found in app/javascript/controllers/mapaosm_controller.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

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

              def poblacion_por_sexo_rango(caso_id, anio, mes, dia, modelorango, rangoedad, totsexo)
                caso = Sivel2Gen::Caso.where(id: caso_id)
                if caso.count < 1 
                  return false
                end
          Severity: Minor
          Found in app/helpers/sivel2_gen/rangoedad_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 procesa_desagregarpor_om has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                    def procesa_desagregarpor_om(que1, tablas1, where1, que3, tablas3, where3)

            Avoid deeply nested control flow statements.
            Open

                          if usuario.observadorffechaini
                            fini = usuario.observadorffechaini
                          end
            Severity: Major
            Found in app/models/sivel2_gen/ability.rb - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                            if usuario.observadorffechafin
                              ffin = usuario.observadorffechafin
                            end
              Severity: Major
              Found in app/models/sivel2_gen/ability.rb - About 45 mins to fix

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

                          def personas_procesa_filtros(que1, tablas1, where1, que3, 
                                                       tablas3, where3)
                Severity: Minor
                Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb - About 45 mins to fix

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

                            def personas_procesa_segun_om(que1, tablas1, where1, que3, tablas3, where3)
                  Severity: Minor
                  Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb - About 45 mins to fix

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

                              def personas_consulta_final(i, que3, tablas3, where3, qc, gb)
                    Severity: Minor
                    Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb - About 45 mins to fix

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

                          def embeber_mapacalordepcol_svg(titulo, subtitulo, titulorangos, fuente,
                                                          cantidadesdep, opciones = {})
                      Severity: Minor
                      Found in app/helpers/sivel2_gen/vista_helper.rb - About 45 mins to fix

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

                                  def presponsables_caso
                                    r = ''
                                    if self.caso && self.caso.presponsable
                                      r = self.caso.presponsable.inject("") { |memo, pr|
                                        (memo == '' ? '' : memo + '; ') + pr.nombre
                        Severity: Minor
                        Found in lib/sivel2_gen/concerns/models/victima.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 procesa_filtros has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                  def procesa_filtros(que1, tablas1, where1, que3, 
                                                      tablas3, where3)
                        Severity: Minor
                        Found in lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb - About 45 mins to fix

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

                                    def desagregarpor_tipico(tabla, nomtabla, que1, que3, tablas3, where3)
                          Severity: Minor
                          Found in lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb - About 45 mins to fix

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

                                      def personas_procesa_filtros_sivel2_gen(que1, tablas1, where1, que3, 
                                                                              tablas3, where3)
                            Severity: Minor
                            Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb - About 45 mins to fix

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

                                        def ajusta_titulos(pFini, pFfin, pTviolencia, pEtiqueta1,
                                                           pEtiqueta2, pColormax)
                              Severity: Minor
                              Found in lib/sivel2_gen/concerns/controllers/mapadep_controller.rb - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language