pasosdeJesus/sivel2_gen

View on GitHub

Showing 241 of 410 total issues

Method lista has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          def lista
            if params[:tabla]
              r = nil
              if (params[:tabla] == "departamento" && params[:pais_id].to_i > 0)
                r = Msip::Departamento.where(fechadeshabilitacion: nil,
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 1 hr to fix

    Method embeber_mapacalormuncol_svg has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          depid, depcad, titulo, subtitulo, titulorangos, fuente, 
          cantidadesmun, opciones = {})
    Severity: Major
    Found in app/helpers/sivel2_gen/vista_helper.rb - About 1 hr to fix

      Method graficar_sexo has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

              def graficar_sexo
                series_gen= []
                if (@vic_dep.count == 0) || (@vic_categorias.count == 0)
                  flash.now[:info] = "Uno de los filros se encuentra vacío"
                else
      Severity: Minor
      Found in app/controllers/sivel2_gen/fil23_gen/graficar_apexcharts_controller.rb - About 55 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 sin_identificacion has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

                def sin_identificacion
                  if nombres == "N" && apellidos == "N"
                    caso = Sivel2Gen::Victima.where(persona_id: self.id)[0].caso_id
                    vics = Sivel2Gen::Victima.where(caso_id: caso)
                    hv = {}
      Severity: Minor
      Found in lib/sivel2_gen/concerns/models/persona.rb - About 55 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 pestanas_formulariocaso has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

                def pestanas_formulariocaso
                  #byebug
                  if current_usuario && can?(:solocambiaretiquetas, Sivel2Gen::Caso)
                    [
                      { titulo: 'Etiquetas', parcial: 'etiquetas'},
      Severity: Minor
      Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 55 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 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

                def remplazar
                  @grupoper = Msip::Grupoper.find(params[:grupoper_id].to_i)
                  @caso = Sivel2Gen::Caso.find(params[:caso_id].to_i)
                  @vicol_posicion = params[:vicol_posicion].to_i
                  @caso.current_usuario = current_usuario
      Severity: Minor
      Found in lib/sivel2_gen/concerns/controllers/gruposper_controller.rb - About 55 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_rango_sexo has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def poblacion_por_rango_sexo(caso_id, anio, mes, dia, modelorango, 
                                       rangoedadsexo, totsexo)
      Severity: Major
      Found in app/helpers/sivel2_gen/rangoedad_helper.rb - About 50 mins to fix

        Method poblacion_por_sexo_rango has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def poblacion_por_sexo_rango(caso_id, anio, mes, dia, modelorango, rangoedad, totsexo)
        Severity: Major
        Found in app/helpers/sivel2_gen/rangoedad_helper.rb - About 50 mins to fix

          Method importar_relato has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                    def self.importar_relato(doc, menserror, sintaxis_errores, mensexito, ids_importados,
                                             usuario_id, formato_sexo)
          Severity: Major
          Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 50 mins to fix

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

                def edad_de_fechanac_fecha(anionac, mesnac, dianac, 
                                              anio, mes, dia)
            Severity: Minor
            Found in app/helpers/sivel2_gen/rangoedad_helper.rb - About 45 mins to fix

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

                        def consulta_final(i, que3, tablas3, where3, qc, gb)

                Avoid deeply nested control flow statements.
                Open

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

                  Avoid deeply nested control flow statements.
                  Open

                              for (let i = 0; i < ruta.length; i++) {
                                if (i === ruta.length - 1) {
                                  actual[ruta[i]] = value;
                                } else {
                                  if (!actual[ruta[i]]) {
                  Severity: Major
                  Found in app/javascript/controllers/enviar_ficha_caso_controller.js - About 45 mins to fix

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

                              def presponsables_caso_ids
                                r = ''
                                if self.caso && self.caso.presponsable
                                  r = self.caso.presponsable.inject("") { |memo, pr|
                                    (memo == '' ? '' : memo + '; ') + pr.id.to_s
                    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 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/mapamun_controller.rb - About 45 mins to fix

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

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

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

                                  def procesa_filtrosm(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 procesa_desagregarpor has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                    def procesa_desagregarpor(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 procesa_desagregarpor_om has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                      def procesa_desagregarpor_om(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 consulta_final has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                        def consulta_final(i, que3, tablas3, where3, qc, gb)
                              Severity: Minor
                              Found in lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language