pasosdeJesus/cor1440_gen

View on GitHub

Showing 234 of 234 total issues

Method lista_params_cor1440_gen has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          def lista_params_cor1440_gen
            [
              :actividad,
              :fecha,
              :lugar,
Severity: Major
Found in lib/cor1440_gen/concerns/controllers/actividades_controller.rb - About 2 hrs to fix

    Method arregla_tabla_poblacion_de_asistentes_actividad has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        def arregla_tabla_poblacion_de_asistentes_actividad(a, resultado)
          d = genera_dicc_poblacion_de_asistentes(a)
    
          numdif = 0
    
    
    Severity: Minor
    Found in app/helpers/cor1440_gen/conteos_helper.rb - About 2 hrs 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 copia has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def copia
                if !params || !params[:actividad_id]
                  render(inline: "Falta parámetro actividad_id")
                  return
                end
    Severity: Major
    Found in lib/cor1440_gen/concerns/controllers/actividades_controller.rb - About 2 hrs to fix

      Method gen_descfiltro has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

                def gen_descfiltro
                  descfiltro = ""
                  if filtrofechaini && !filtrofechafin
                    descfiltro += "Después de " + filtrofechaini.to_s + ".  "
                  end
      Severity: Minor
      Found in lib/cor1440_gen/concerns/models/informe.rb - About 2 hrs 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 identificacion_no_repetida has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

                def identificacion_no_repetida
                  if self.asistencia
                    self.asistencia.each do |a|
                      next unless a.persona && a.persona.numerodocumento != nil
                      pr = Msip::Persona
      Severity: Minor
      Found in lib/cor1440_gen/concerns/models/actividad.rb - About 2 hrs 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 valor_campo_compuesto has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                def self.valor_campo_compuesto(registro, campo)
                  p = campo.split(".")
                  if Mr519Gen::Formulario.where(nombreinterno: p[0]).count == 0
                    return "No se encontró formulario con nombreinterno #{p[0]}"
                  end
      Severity: Major
      Found in lib/cor1440_gen/concerns/controllers/personas_controller.rb - About 2 hrs to fix

        Method arregla_tabla_poblacion_de_asistentes_actividad has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def arregla_tabla_poblacion_de_asistentes_actividad(a, resultado)
              d = genera_dicc_poblacion_de_asistentes(a)
        
              numdif = 0
        
        
        Severity: Major
        Found in app/helpers/cor1440_gen/conteos_helper.rb - About 2 hrs to fix

          Method complementa_importa has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                    def complementa_importa(ulteditor_id, datossal, menserror, opciones)
                      puts "OJO complementa_importa ulteditor_id=#{ulteditor_id}"
                      if !datossal[:respuestafor] ||
                          !datossal[:caracterizacion] ||
                          !datossal[:valorcampo]
          Severity: Major
          Found in lib/cor1440_gen/concerns/models/persona.rb - About 2 hrs to fix

            Method copia has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                      def copia
                        if !params || !params[:actividad_id]
                          render(inline: "Falta parámetro actividad_id")
                          return
                        end
            Severity: Minor
            Found in lib/cor1440_gen/concerns/controllers/actividades_controller.rb - About 2 hrs 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 medir_indicador_efecto has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                      def medir_indicador_efecto(mind, ind, fini, ffin, resf)
                        idefs = []
                        idefs = Cor1440Gen::MindicadorespfController.calcula_listado_ef(
                          mind.indicadorpf_id, fini, ffin
                        )
            Severity: Major
            Found in lib/cor1440_gen/concerns/controllers/mindicadorespf_controller.rb - About 2 hrs to fix

              Method medir_indicador_resultado has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                        def medir_indicador_resultado(mind, ind, fini, ffin, resf)
                          idacs = []
                          idacs = calcula_listado_ac(mind.actividadpf_ids, fini, ffin)
                          if mind.funcionresultado.to_s != "" # Medir con esp de medicionindicadorpf
                            contexto = {
              Severity: Minor
              Found in lib/cor1440_gen/concerns/controllers/mindicadorespf_controller.rb - About 2 hrs 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 medir_indicador_efecto has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                        def medir_indicador_efecto(mind, ind, fini, ffin, resf)
                          idefs = []
                          idefs = Cor1440Gen::MindicadorespfController.calcula_listado_ef(
                            mind.indicadorpf_id, fini, ffin
                          )
              Severity: Minor
              Found in lib/cor1440_gen/concerns/controllers/mindicadorespf_controller.rb - About 2 hrs 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 relacionadas has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                        def relacionadas
                          prob = "".dup
                          actividadpf_ids = []
                          proyectofinanciero_ids = []
                          if params[:proyectofinanciero_ids]
              Severity: Minor
              Found in lib/cor1440_gen/concerns/controllers/actividades_controller.rb - About 2 hrs 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 has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                        def show
                          # @actividades = Cor1440Gen::Actividad.all
                          @actividades = filtra_actividades
                          @numactividades = @actividades.size
                          @enctabla = []
              Severity: Major
              Found in lib/cor1440_gen/concerns/controllers/informes_controller.rb - About 2 hrs to fix

                Method contar has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          def contar
                            @contar_actividad = Cor1440Gen::Actividad.all
                            @contar_pf = Cor1440Gen::Proyectofinanciero.all
                            @contar_pfid = nil
                            @contar_ofi = nil
                Severity: Major
                Found in lib/cor1440_gen/concerns/controllers/actividades_controller.rb - About 2 hrs to fix

                  Method medir_indicador has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                            def medir_indicador
                              prob = ""
                              if params[:finicio] &&
                                  params[:finicio] != "" &&
                                  params[:ffin] &&
                  Severity: Major
                  Found in lib/cor1440_gen/concerns/controllers/mindicadorespf_controller.rb - About 2 hrs to fix

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

                              def asegura_camposdinamicos(efecto, current_usuario_id)
                                vfid = [] # ids de formularios que deben presentarse
                    
                                if efecto.indicadorpf && efecto.indicadorpf.tipoindicador &&
                                    efecto.indicadorpf.tipoindicador.formulario
                    Severity: Minor
                    Found in lib/cor1440_gen/concerns/controllers/efectos_controller.rb - About 2 hrs to fix

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

                                def medir_indicador_resultado(mind, ind, fini, ffin, resf)
                                  idacs = []
                                  idacs = calcula_listado_ac(mind.actividadpf_ids, fini, ffin)
                                  if mind.funcionresultado.to_s != "" # Medir con esp de medicionindicadorpf
                                    contexto = {
                      Severity: Minor
                      Found in lib/cor1440_gen/concerns/controllers/mindicadorespf_controller.rb - About 1 hr to fix

                        Method ini_asistencia_ram has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                  def ini_asistencia_ram(lids)
                                    "SELECT sub2.* FROM (SELECT sub.*,
                                       (SELECT nombre FROM cor1440_gen_rangoedadac AS red
                                        WHERE id=CASE
                                          WHEN (red.limiteinferior IS NULL OR
                        Severity: Minor
                        Found in lib/cor1440_gen/concerns/controllers/actividades_controller.rb - About 1 hr to fix

                          Method mindicadorpf_params has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                    def mindicadorpf_params
                                      params.require(:mindicadorpf).permit(
                                        atributos_form - [
                                          "pmindicadorpf",
                                          :actividadpf,
                          Severity: Minor
                          Found in lib/cor1440_gen/concerns/controllers/mindicadorespf_controller.rb - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language