pasosdeJesus/cor1440_gen

View on GitHub

Showing 180 of 234 total issues

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

          def presenta(atr)
            ## 4 Primeros Indicadores de objetivo
            cindob = /indicadorobj(.*)$/.match(atr.to_s)
            if cindob
              indobs = indicadorobjetivo.where(resultadopf_id: nil).order(:id)
Severity: Minor
Found in lib/cor1440_gen/concerns/models/proyectofinanciero.rb - About 6 days 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

File actividades_controller.rb has 858 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Cor1440Gen
  module Concerns
    module Controllers
      module ActividadesController
        extend ActiveSupport::Concern
Severity: Major
Found in lib/cor1440_gen/concerns/controllers/actividades_controller.rb - About 2 days to fix

    Method presenta_cor1440_gen has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
    Open

              def presenta_cor1440_gen(atr)
                case atr.to_s
                when /anexo_[0-9]_desc/
                  i = atr[6].to_i
                  if anexo.count >= i
    Severity: Minor
    Found in lib/cor1440_gen/concerns/models/actividad.rb - About 1 day 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 eval has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
    Open

          def eval(contexto, menserror = "".dup)
            # args que siempre sea vector con argumentos
            args = argsp.class.to_s != "Array" ? [argsp] : argsp
            # argsev contendrá evaluaciónd de los argumentos necesarios
            argsev = []
    Severity: Minor
    Found in app/helpers/cor1440_gen/medicion_helper.rb - About 1 day 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 a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
    Open

              def show
                # @actividades = Cor1440Gen::Actividad.all
                @actividades = filtra_actividades
                @numactividades = @actividades.size
                @enctabla = []
    Severity: Minor
    Found in lib/cor1440_gen/concerns/controllers/informes_controller.rb - About 1 day 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

    File proyectosfinancieros_controller.rb has 584 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Cor1440Gen
      module Concerns
        module Controllers
          module ProyectosfinancierosController
            extend ActiveSupport::Concern

      Method importa has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
      Open

                def importa(datosent, datossal, menserror, opciones = {})
                  ndatosent = datosent.clone # Datos que falta analizar
                  respuestafor = {} # Respuestas a formularios, llave id de formu.
                  caracterizacion = {} # Caracterización, llave es id de formu.
                  valorcampo = {} # Valores llave 1 es id formu. llave 2 es id campo
      Severity: Minor
      Found in lib/cor1440_gen/concerns/models/persona.rb - About 1 day 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

      File mindicadorespf_controller.rb has 544 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module Cor1440Gen
        module Concerns
          module Controllers
            module MindicadorespfController
              extend ActiveSupport::Concern
      Severity: Major
      Found in lib/cor1440_gen/concerns/controllers/mindicadorespf_controller.rb - About 1 day to fix

        File actividad.rb has 534 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module Cor1440Gen
          module Concerns
            module Models
              module Actividad
                extend ActiveSupport::Concern
        Severity: Major
        Found in lib/cor1440_gen/concerns/models/actividad.rb - About 1 day to fix

          File proyectofinanciero.rb has 494 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module Cor1440Gen
            module Concerns
              module Models
                module Proyectofinanciero
                  extend ActiveSupport::Concern
          Severity: Minor
          Found in lib/cor1440_gen/concerns/models/proyectofinanciero.rb - About 7 hrs to fix

            Method update_cor1440_gen has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
            Open

                      def update_cor1440_gen
                        @pf_respaldo = {}
                        # para no perder proyectos financieros sin actividad de marco lógico
                        # en caso de errores de validación
                        if actividad_params &&
            Severity: Minor
            Found in lib/cor1440_gen/concerns/controllers/actividades_controller.rb - About 7 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

            File conteos_helper.rb has 485 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module Cor1440Gen
              module ConteosHelper
                # Da conteo de asistentes a un actividad como una tabla
                # por Rango de Edad y Sexo
                # @return diccionario primer índice es id de rango de edad,
            Severity: Minor
            Found in app/helpers/cor1440_gen/conteos_helper.rb - About 7 hrs to fix

              Method impreso has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
              Open

                        def impreso
                          @informe = Informe.find(@informe.id)
                          @actividades = filtra_actividades
              
                          # Ejemplo de https://github.com/sandrods/odf-report
              Severity: Minor
              Found in lib/cor1440_gen/concerns/controllers/informes_controller.rb - About 7 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 presenta has 162 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                        def presenta(atr)
                          ## 4 Primeros Indicadores de objetivo
                          cindob = /indicadorobj(.*)$/.match(atr.to_s)
                          if cindob
                            indobs = indicadorobjetivo.where(resultadopf_id: nil).order(:id)
              Severity: Major
              Found in lib/cor1440_gen/concerns/models/proyectofinanciero.rb - About 6 hrs to fix

                Method complementa_importa has a Cognitive Complexity of 42 (exceeds 5 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: Minor
                Found in lib/cor1440_gen/concerns/models/persona.rb - About 6 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 a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                Open

                          def copia
                            if !params || !params[:proyectofinanciero_id]
                              render(inline: "Falta parámetro proyectofinanciero_id")
                              return
                            end

                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 proyectofinanciero_params_cor1440_gen has 154 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          def proyectofinanciero_params_cor1440_gen
                            [
                              :id,
                              :nombre,
                              :titulo,

                  Method valor_campo_compuesto has a Cognitive Complexity of 37 (exceeds 5 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: Minor
                  Found in lib/cor1440_gen/concerns/controllers/personas_controller.rb - About 5 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 presenta_cor1440_gen has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                            def presenta_cor1440_gen(atr)
                              case atr.to_s
                              when /anexo_[0-9]_desc/
                                i = atr[6].to_i
                                if anexo.count >= i
                  Severity: Major
                  Found in lib/cor1440_gen/concerns/models/actividad.rb - About 5 hrs to fix

                    Method asegura_camposdinamicos has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                    Open

                              def asegura_camposdinamicos(actividad, current_usuario_id)
                                @listadoasistencia = false
                                vfid = []  # ids de formularios que deben presentarse
                                actividad.actividadpf.each do |apf|
                                  if apf.actividadtipo
                    Severity: Minor
                    Found in lib/cor1440_gen/concerns/controllers/actividades_controller.rb - About 4 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

                    Severity
                    Category
                    Status
                    Source
                    Language