pasosdeJesus/heb412_gen

View on GitHub

Showing 56 of 82 total issues

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 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 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

    Consider simplifying this complex logical expression.
    Open

          if (p[1] != 'html' && p[1] != 'ods' && p[1] != 'odt' && p[1] != 'xrlat' && p[1] != 'json' && p[1] != 'csv') {
            nplantilla = ''
          } else {
            formato = p[1]
            if (formato == 'html' || formato == 'odt' || formato == 'xrlat' || formato == 'json' || formato == 'csv') {
    Severity: Major
    Found in app/javascript/controllers/motor.js - About 40 mins to fix

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

          def importa_dato(datosent, datossal, menserror, registro = nil, opciones = {})
      Severity: Minor
      Found in app/controllers/heb412_gen/modelos_controller.rb - About 35 mins to fix

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

            def importa_dato_gen(datosent, datossal, menserror, registro = nil, opciones = {})
        Severity: Minor
        Found in app/controllers/heb412_gen/modelos_controller.rb - About 35 mins to fix

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

              def complementa_importa_dato(registro, ulteditor_id, datossal,
                menserror, opciones = {})
          Severity: Minor
          Found in app/controllers/heb412_gen/modelos_controller.rb - About 35 mins to fix

            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

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

                  def programa_generacion_listado_int(params, extension, campoid, pl, narch)
              Severity: Minor
              Found in app/controllers/heb412_gen/modelos_controller.rb - About 35 mins to fix

                Method sigcol has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def sigcol(col)
                      res = ""
                      i = col.length - 1
                      lleva = 1
                      while i >= 0
                Severity: Minor
                Found in app/helpers/heb412_gen/plantilla_helper.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

                Method permiso_ver_leer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def permiso_ver_leer(ruta, carpeta, usuario)
                      if usuario.rol == Ability::ROLADMIN || usuario.rol == Ability::ROLDIR ||
                          ruta == "/"
                        return true
                      end
                Severity: Minor
                Found in app/helpers/heb412_gen/permisos_helper.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

                Avoid too many return statements within this method.
                Open

                                return
                Severity: Major
                Found in lib/heb412_gen/concerns/controllers/sisarch_controller.rb - About 30 mins to fix

                  Method elimina_columna has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def elimina_columna(plantillahcm_id, id)
                        pore = Heb412Gen::Campoplantillahcm
                          .where(plantillahcm_id: plantillahcm_id).where(id: id).take
                        unless pore
                          raise "No se encontró columna con id #{id} en "\
                  Severity: Minor
                  Found in app/helpers/heb412_gen/plantilla_helper.rb - About 25 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 a Cognitive Complexity of 6 (exceeds 5 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 25 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 programa_generacion_listado_int has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def programa_generacion_listado_int(params, extension, campoid, pl, narch)
                        ids = @registros.map(&campoid)
                  
                        parsimp = {}
                        parsimp[:busfechainicio_ini] = nil
                  Severity: Minor
                  Found in app/controllers/heb412_gen/modelos_controller.rb - About 25 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 create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                            def create
                              authorize!(:edit, Heb412Gen::Doc)
                              @doc = Heb412Gen::Doc.new(doc_params)
                              if !@doc.nombre && @doc.adjunto_file_name
                                @doc.nombre = @doc.adjunto_file_name
                  Severity: Minor
                  Found in lib/heb412_gen/concerns/controllers/docs_controller.rb - About 25 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