pasosdeJesus/sivel2_gen

View on GitHub

Showing 241 of 410 total issues

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

          def remplazar_sivel2_gen
            @persona = Msip::Persona.find(params[:persona_id].to_i)
            @caso = Sivel2Gen::Caso.find(params[:caso_id].to_i)
            @caso.current_usuario = current_usuario
            @vic_position = params[:vic_position].to_i
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/personas_controller.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/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

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

      Avoid too many return statements within this method.
      Open

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

        Avoid too many return statements within this method.
        Open

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

          Avoid too many return statements within this method.
          Open

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

            Avoid too many return statements within this method.
            Open

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

              Avoid too many return statements within this method.
              Open

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

                Avoid too many return statements within this method.
                Open

                            return true
                Severity: Major
                Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

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

                    Avoid too many return statements within this method.
                    Open

                                return mi + ai + " - " + mf + af
                    Severity: Major
                    Found in lib/sivel2_gen/concerns/controllers/mapadep_controller.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

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

                        Avoid too many return statements within this method.
                        Open

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

                          Avoid too many return statements within this method.
                          Open

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

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

                                      def crea_consexpcaso(conscaso, ordenar_por = nil)
                                        if ARGV.include?("db:migrate")
                                          return
                                        end
                                        if !ActiveRecord::Base.connection.data_source_exists? 'sivel2_gen_conscaso'
                            Severity: Minor
                            Found in lib/sivel2_gen/concerns/models/consexpcaso.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

                            Function connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              connect() {
                                console.log("Conexion de controlador Mapa osm");
                                const usuarioAutenticado = this.data.get("usuarioAutenticado") === 'true';
                                if (!this.constructor.marcadores) {
                                  this.constructor.marcadores = L.markerClusterGroup();
                            Severity: Minor
                            Found in app/javascript/controllers/mapaosm_controller.js - 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 refresca_conscaso has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                      def refresca_conscaso
                                        if ARGV.include?("db:migrate")
                                          return 'Ejecutando migración'
                                        end
                                        if !ActiveRecord::Base.connection.data_source_exists? 'sivel2_gen_conscaso'
                            Severity: Minor
                            Found in lib/sivel2_gen/concerns/models/conscaso.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 reportar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                      def reportar
                                        authorize! :read, Sivel2Gen::Caso
                                        @rango_fechas = 'Fecha del hecho'
                                        @titulo = 'Reporte de casos repetidos'
                                        @repetidos = []
                            Severity: Minor
                            Found in lib/sivel2_gen/concerns/controllers/buscarrepetidos_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 gen_formato has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                      def gen_formato(formato)
                                        Consexpcaso.crea_consexpcaso(@conscaso, @campoord)
                                        if params[:filtro].nil? || params[:idplantilla].nil?
                                          head :no_content
                                        elsif params[:idplantilla].to_i <= 0
                            Severity: Minor
                            Found in lib/sivel2_gen/concerns/controllers/casos_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 error_plantilla_no_autenticado has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                      def error_plantilla_no_autenticado
                                        redirect_back fallback_location: Rails.configuration.relative_url_root, flash:{ 
                                          error: "La generación de este reporte permite máximo "\
                                          "#{Rails.configuration.x.sivel2_consweb_max ?
                                          Rails.configuration.x.sivel2_consweb_max.to_s : '0' }"\
                            Severity: Minor
                            Found in lib/sivel2_gen/concerns/controllers/casos_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