pasosdeJesus/sivel2_gen

View on GitHub

Showing 228 of 380 total issues

Method importa has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          def importa
            authorize! :create, Sivel2Gen::Caso
            arc = params[:arc]
            doc = nil
            begin
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 2 hrs to fix

    Method victimizaciones has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def victimizaciones
                authorize! :contar, Sivel2Gen::Caso
    
                # Filtros
                pFini = escapar_param(params, [:filtro, 'fechaini'])
    Severity: Minor
    Found in lib/sivel2_gen/concerns/controllers/mapadep_controller.rb - About 2 hrs to fix

      Method asegura_camposdinamicos has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                def self.asegura_camposdinamicos(caso, current_usuario_id, pestanas)
                  if caso.nil?  || caso.id.nil?
                    return
                  end
      
      
      Severity: Minor
      Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 1 hr to fix

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

                  def personas
                    authorize! :contar, Sivel2Gen::Caso
        
                    @pSegun = escapar_param(params, [:filtro, 'segun'])
                    @pMunicipio = escapar_param(params, [:filtro, 'municipio'])
        Severity: Minor
        Found in lib/sivel2_gen/concerns/controllers/conteos_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 victimizaciones has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

                  def victimizaciones
                    authorize! :contar, Sivel2Gen::Caso
        
                    # Filtros
                    pFini = escapar_param(params, [:filtro, 'fechaini'])
        Severity: Minor
        Found in lib/sivel2_gen/concerns/controllers/mapadep_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 show_sivel2_gen has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

                  def show_sivel2_gen
                    if !Rails.configuration.x.sivel2_consulta_web_publica
                      authorize! :read, Sivel2Gen::Caso
                    end
        
        
        Severity: Minor
        Found in lib/sivel2_gen/concerns/controllers/casos_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

        Function connect has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          connect() {
            console.log("Conexion de controlador Mapa osm");
            const usuarioAutenticado = this.data.get("usuarioAutenticado") === 'true';
            if (!this.constructor.marcadores) {
              this.constructor.marcadores = L.markerClusterGroup();
        Severity: Minor
        Found in app/javascript/controllers/mapaosm_controller.js - About 1 hr to fix

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

                def actos_individuales
                  authorize! :contar, Sivel2Gen::Caso
          
                  @rutadircsv = File.join(
                    Rails.root, "public#{Rails.configuration.relative_url_root}" +
          Severity: Minor
          Found in app/controllers/sivel2_gen/fil23_gen/graficar_plotly_controller.rb - About 1 hr to fix

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

                function clicMarcadorCaso() {
                  self.mostrarCargador();
                  msip_arregla_puntomontaje(window);
                  var ruta = window.puntomontaje + 'casos/';
                  var urlSolicitud = ruta + codigo + ".json";  
            Severity: Minor
            Found in app/javascript/controllers/mapaosm_controller.js - About 1 hr to fix

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

                        def nuevo
                          if params[:caso_id]
                            @persona = Msip::Persona.new
                            @victima = Victima.new
                            @persona.nombres = 'N'
              Severity: Minor
              Found in lib/sivel2_gen/concerns/controllers/victimas_controller.rb - About 1 hr to fix

                Method valida_categoria_presponsable has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          def valida_categoria_presponsable
                            consl= "WITH RECURSIVE cteRecursion AS (
                               SELECT id, 1 AS Level
                                   FROM public.sivel2_gen_presponsable
                                   WHERE id = 42
                Severity: Minor
                Found in lib/sivel2_gen/concerns/models/actocolectivo.rb - About 1 hr to fix

                  Method valida_categoria_presponsable has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                            def valida_categoria_presponsable
                              consl= "WITH RECURSIVE cteRecursion AS (
                                 SELECT id, 1 AS Level
                                     FROM public.sivel2_gen_presponsable
                                     WHERE id = 42
                  Severity: Minor
                  Found in lib/sivel2_gen/concerns/models/acto.rb - About 1 hr to fix

                    Method categoria_presponsable has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                              def categoria_presponsable
                                consl= "WITH RECURSIVE cteRecursion AS (
                                   SELECT id, 1 AS Level
                                       FROM public.sivel2_gen_presponsable
                                       WHERE id = 42
                    Severity: Minor
                    Found in lib/sivel2_gen/concerns/models/caso.rb - About 1 hr to fix

                      Function filtrar_categoria has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                        filtrar_categoria(e){
                          if (e.target && e.target.id === 'filtro_categoria_id') {
                            var categoria_id = e.target.value;
                            var select = e.target;
                            var url = window.puntomontaje + 'admin/categorias/filtratviolencia';
                      Severity: Minor
                      Found in app/javascript/controllers/filtro_avanzado_controller.js - 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 filtrar_tviolencia has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                        filtrar_tviolencia(e){
                          if (e.target && e.target.id === 'filtro_tviolencia_id') {
                            var tviolencia_id = e.target.value;
                            var select = e.target;
                      
                      
                      Severity: Minor
                      Found in app/javascript/controllers/filtro_avanzado_controller.js - 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 procesa_filtrosm has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                                def procesa_filtrosm(que1, tablas1, where1, que3, 
                                                        tablas3, where3)
                                  @estfiltrosm.each do |e, r|
                                    if (params[:filtro] && params[:filtro][r[:nomfiltro]] && 
                                        params[:filtro][r[:nomfiltro]] != '') 
                      Severity: Minor
                      Found in lib/sivel2_gen/concerns/controllers/graficar_conteo_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 filtro_avanzado has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                                def filtro_avanzado(conscaso, params_filtro)
                                  for i in campos_filtro1_gen do
                                    if params_filtro[i] && params_filtro[i] != '' &&
                                      params_filtro[i] != [''] &&
                                      conscaso.respond_to?('filtro_' + i.to_s)
                      Severity: Minor
                      Found in lib/sivel2_gen/concerns/controllers/casos_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 create has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                                def create
                                  @caso.current_usuario = current_usuario
                                  @caso.memo = ''
                                  @caso.titulo = ''
                      
                      
                      Severity: Minor
                      Found in lib/sivel2_gen/concerns/controllers/casos_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 procesa_desagregarpor_om has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                def procesa_desagregarpor_om(que1, tablas1, where1, que3, tablas3, where3)
                      
                                  case @pDesagregarpor
                                  when ''
                                    que1 = agregar_tabla(que1, 'cast(\'total\' as text) as total')
                      Severity: Minor
                      Found in lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb - About 1 hr to fix

                        Method create has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                  def create
                                    @caso.current_usuario = current_usuario
                                    @caso.memo = ''
                                    @caso.titulo = ''
                        
                        
                        Severity: Minor
                        Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language