pasosdeJesus/heb412_gen

View on GitHub

Showing 51 of 73 total issues

Method fichaimp has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def fichaimp
      establece_registro
      unless @registro
        return
      end
Severity: Minor
Found in app/controllers/heb412_gen/modelos_controller.rb - About 1 hr to fix

    Method llena_plantilla_multiple_fd has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def self.llena_plantilla_multiple_fd(plantillahcm, fd,
                nomcontrolador = nil)
                ruta = File.join(
                  Rails.application.config.x.heb412_ruta,
                  plantillahcm.ruta,
    Severity: Minor
    Found in lib/heb412_gen/concerns/controllers/plantillahcm_controller.rb - About 1 hr to fix

      Method update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                def update
                  authorize!(:edit, Heb412Gen::Plantillahcr)
                  @vista = @plantillahcr.vista
                  respond_to do |format|
                    if @plantillahcr.update(plantillahcr_params)
      Severity: Minor
      Found in lib/heb412_gen/concerns/controllers/plantillahcr_controller.rb - About 1 hr to fix

        Method perform has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def perform(idplantilla, cmodelo, ccontrolador, ids, narch, parsimp,
              extension, campoid = :id, params = nil)
        Severity: Major
        Found in app/jobs/heb412_gen/generalistado_job.rb - About 1 hr to fix

          Method vista_listado has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def self.vista_listado(plant, ids, modelo, narch, parsimp, extension,
                campoid = :id, params = nil, controlador = nil)
          Severity: Major
          Found in app/controllers/heb412_gen/modelos_controller.rb - About 1 hr to fix

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

                def programa_generacion_listado(params, extension, campoid = :id)
                  if params[:idplantilla].nil? or params[:idplantilla].to_i <= 0 or
                      @registros == []
                    flash[:error] = "No hay registros por generar"
                  elsif Heb412Gen::Plantillahcm.where(
            Severity: Minor
            Found in app/controllers/heb412_gen/modelos_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 convierte_a_extension_esperada has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                      def self.convierte_a_extension_esperada(nfuente, ndest, extension)
                        if extension == ".ods"
                          FileUtils.mv(nfuente, "#{ndest}#{extension}")
                        elsif extension == ".pdf"
                          if File.exist?("#{nfuente}.pdf")
            Severity: Minor
            Found in lib/heb412_gen/concerns/controllers/plantillahcm_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 pintacampos has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                      def pintacampos
                        @plantillahcr = Heb412Gen::Plantillahcr.new
                        if params[:vista]
                          vista = Msip::Ubicacion.connection.quote_string(
                            params[:vista],
            Severity: Minor
            Found in lib/heb412_gen/concerns/controllers/plantillahcr_controller.rb - About 1 hr to fix

              Method pintacampos has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                        def pintacampos
                          @plantillahcm = Heb412Gen::Plantillahcm.new
                          if params[:vista]
                            vista = Msip::Ubicacion.connection.quote_string(
                              params[:vista],
              Severity: Minor
              Found in lib/heb412_gen/concerns/controllers/plantillahcm_controller.rb - About 1 hr to fix

                Method fichapdf has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def fichapdf
                      establece_registro
                      unless @registro
                        return
                      end
                Severity: Minor
                Found in app/controllers/heb412_gen/modelos_controller.rb - About 1 hr to fix

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

                            def create_gen(plantillahcr)
                              respond_to do |format|
                                if plantillahcr.save
                                  ordena_plantillahcr
                                  format.html do
                  Severity: Minor
                  Found in lib/heb412_gen/concerns/controllers/plantillahcr_controller.rb - About 1 hr to fix

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

                        def perform(idplantilla, nomcontrolador, narchent, narcherr, extension, ulteditor_id)
                          puts "Inicio de generación de plantilla #{idplantilla} con nomcontrolador #{nomcontrolador}, importando de #{narchent} escribiendo errores en #{narcherr} con extensión #{extension} ulteditor_id es #{ulteditor_id}"
                          plant = Heb412Gen::Plantillahcm.find(idplantilla)
                          controlador = nomcontrolador.constantize.new
                          modelo = controlador.clase
                    Severity: Minor
                    Found in app/jobs/heb412_gen/importalistado_job.rb - About 1 hr to fix

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

                                def create_gen(plantillahcm)
                                  respond_to do |format|
                                    if plantillahcm.save
                                      ordena_plantillahcm
                                      format.html do
                      Severity: Minor
                      Found in lib/heb412_gen/concerns/controllers/plantillahcm_controller.rb - About 1 hr to fix

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

                            def self.cons_a_fd(cons, colvista = [])
                              l = []
                              cons.each do |r|
                                f = {}
                                colvista.each do |c|
                        Severity: Minor
                        Found in app/controllers/heb412_gen/modelos_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 perform has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def perform(idplantilla, nomcontrolador, narchent, narcherr, extension, ulteditor_id)
                        Severity: Minor
                        Found in app/jobs/heb412_gen/importalistado_job.rb - About 45 mins to fix

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

                              def compara_columnas(col1, col2)
                                if col1.length < col2.length
                                  return -1
                                end
                                if col2.length < col1.length
                          Severity: Minor
                          Found in app/helpers/heb412_gen/plantilla_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 fichapdf has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def fichapdf
                                establece_registro
                                unless @registro
                                  return
                                end
                          Severity: Minor
                          Found in app/controllers/heb412_gen/modelos_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

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

                              def antcol(col)
                                if col == ""
                                  raise "No puede calcular antcol(nil)"
                                end
                          
                          
                          Severity: Minor
                          Found in app/helpers/heb412_gen/plantilla_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 fichaimp has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def fichaimp
                                establece_registro
                                unless @registro
                                  return
                                end
                          Severity: Minor
                          Found in app/controllers/heb412_gen/modelos_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

                          Method llena_plantilla_multiple_importadatos has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                      plantillahcm, controlador, modelo, narchent, ulteditor_id
                          Severity: Minor
                          Found in lib/heb412_gen/concerns/controllers/plantillahcm_controller.rb - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language