pasosdeJesus/siaddhh

View on GitHub

Showing 21 of 43 total issues

Method eliminar_casos has 146 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def eliminar_casos(subconsulta_ids_por_eliminar)
  ejecutar_sql("
  DELETE FROM sivel2_gen_caso_fuenteprensa WHERE 
    caso_id in (#{subconsulta_ids_por_eliminar});
              ")
Severity: Major
Found in scripts/auxiliar_eliminar.rb - About 5 hrs to fix

    Function exports has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function(api) {
      var validEnv = ['development', 'test', 'production']
      var currentEnv = api.env()
      var isDevelopmentEnv = api.env('development')
      var isProductionEnv = api.env('production')
    Severity: Major
    Found in babel.config.js - About 2 hrs to fix

      Method arranca_ap_shiny has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def arranca_ap_shiny
            # Como una aplicación shiny puede responder a diversos usuarios
            # lo que hacemos por ahora es lanzar una que atienda a todos sobre
            # un proceso nuevo que no bloquee la aplicación rails.
            # Solo vuelve a iniciarse si un usuario solicita la gráfica
      Severity: Major
      Found in app/controllers/fil23_gen/graficar_r_controller.rb - About 2 hrs to fix

        Function actualizarTrazosPresentados has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function actualizarTrazosPresentados(etiquetas) {
          var etiquetasP = []
          var i = 0
          trazosPresentados.forEach(function(t) {
            etiquetasP.push(t.name)
        Severity: Major
        Found in app/javascript/plotly_actos.js - About 2 hrs to fix

          Function actualizarTrazosPresentados has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function actualizarTrazosPresentados(etiquetas) {
            var etiquetasP = []
            var i = 0
            trazosPresentados.forEach(function(t) {
              etiquetasP.push(t.name)
          Severity: Major
          Found in app/packs/plotly_actos.js - About 2 hrs to fix

            Function procesar_datos has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function procesar_datos(filas, variable) {
            
              var contenedorFiltros = document.querySelector('.filtros'),
                selectorCategoria= contenedorFiltros.querySelector('#presponsable'),
                campoFechaini = contenedorFiltros.querySelector('#fechaini'),
            Severity: Major
            Found in app/javascript/plotly_actos.js - About 2 hrs to fix

              Function procesar_datos has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function procesar_datos(filas, variable) {
              
                var contenedorFiltros = document.querySelector('.filtros'),
                  selectorCategoria= contenedorFiltros.querySelector('#presponsable'),
                  campoFechaini = contenedorFiltros.querySelector('#fechaini'),
              Severity: Major
              Found in app/packs/plotly_actos.js - About 2 hrs to fix

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

                    def victimizaciones_individuales
                      authorize! :contar, Sivel2Gen::Caso
                
                      @rutacsv = File.join(Rails.root, 'public/somosdefensores/siaddhh/csv/victimizaciones_individuales.csv').to_s
                
                
                Severity: Minor
                Found in app/controllers/fil23_gen/graficar_r_controller.rb - About 1 hr to fix

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

                      def actos_individuales
                        authorize! :contar, Sivel2Gen::Caso
                  
                        @rutacsv = File.join(Rails.root, 'public/somosdefensores/siaddhh/csv/actos_individuales.csv').to_s
                  
                  
                  Severity: Minor
                  Found in app/controllers/fil23_gen/graficar_plotly_controller.rb - About 1 hr to fix

                    Method nuevo has 48 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 app/controllers/sivel2_gen/victimas_controller.rb - About 1 hr to fix

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

                          def arranca_ap_shiny
                            # Como una aplicación shiny puede responder a diversos usuarios
                            # lo que hacemos por ahora es lanzar una que atienda a todos sobre
                            # un proceso nuevo que no bloquee la aplicación rails.
                            # Solo vuelve a iniciarse si un usuario solicita la gráfica
                      Severity: Minor
                      Found in app/controllers/fil23_gen/graficar_r_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 nuevo has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def nuevo
                            if params[:caso_id]
                              @grupoper = Msip::Grupoper.new
                              @victimacolectiva = Victimacolectiva.new
                              @grupoper.nombre = 'N'
                      Severity: Minor
                      Found in app/controllers/sivel2_gen/victimascolectivas_controller.rb - About 1 hr to fix

                        Method update has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def update
                              if params[:caso] && params[:caso][:victimacolectiva_attributes]
                                params[:caso][:victimacolectiva_attributes].each { |i,v|
                                  if v[:orgsocial_attributes] && 
                                    v[:orgsocial_attributes][:grupoper_id] &&
                        Severity: Minor
                        Found in app/controllers/sivel2_gen/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 campos_plantillas has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def campos_plantillas
                              n = Heb412Gen::Ability::CAMPOS_PLANTILLAS_PROPIAS.
                                clone.merge(Sivel2Gen::Ability::CAMPOS_PLANTILLAS_PROPIAS.clone)
                              c= n['Victima'][:campos] 
                              if c.index(:profesion)
                        Severity: Minor
                        Found in app/models/ability.rb - About 1 hr to fix

                          Method presenta has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def presenta(atr)
                                case atr.to_s
                                when 'perfilliderazgo'
                                  self.profesion ? self.profesion.nombre : ''
                                when 'colectivohumano'
                          Severity: Minor
                          Found in app/models/sivel2_gen/victima.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 obtener_info_victimas has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function obtener_info_victimas(victimas, prresp, caso){
                            ruta_foto = caso.fotos_victimas;
                            var victimasCont = '<div class="text-center">'
                            if(ruta_foto){
                              primera = jQuery.map(ruta_foto, function(n, i ){return n })[0]
                          Severity: Minor
                          Found in app/assets/javascripts/mapasiaddhh.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 ajusta_titulos has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

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

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

                            function actualizarTrazosPresentados(etiquetas) {
                              var etiquetasP = []
                              var i = 0
                              trazosPresentados.forEach(function(t) {
                                etiquetasP.push(t.name)
                            Severity: Minor
                            Found in app/javascript/plotly_actos.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

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

                            function actualizarTrazosPresentados(etiquetas) {
                              var etiquetasP = []
                              var i = 0
                              trazosPresentados.forEach(function(t) {
                                etiquetasP.push(t.name)
                            Severity: Minor
                            Found in app/packs/plotly_actos.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 nuevo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def nuevo
                                  if params[:caso_id]
                                    @persona = Msip::Persona.new
                                    @victima = Victima.new
                                    @persona.nombres = 'N'
                            Severity: Minor
                            Found in app/controllers/sivel2_gen/victimas_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

                            Severity
                            Category
                            Status
                            Source
                            Language