pasosdeJesus/sivel2_gen

View on GitHub

Showing 241 of 410 total issues

Method create_sivel2_gen has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          def create_sivel2_gen
            @merr = ""
            params2 = {}
            if (!params[:caso] && !params2['caso'])
              @merr = 'Faltan parámetros de caso'
Severity: Major
Found in lib/sivel2_gen/concerns/controllers/actos_controller.rb - About 2 hrs to fix

    Method categoria_presponsable has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

              def categoria_presponsable
                consl= "WITH RECURSIVE cteRecursion AS (
                   SELECT id, 1 AS Level
                       FROM public.sivel2_gen_presponsable
                       WHERE id = 39
    Severity: Minor
    Found in lib/sivel2_gen/concerns/models/caso.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 asegura_camposdinamicos has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

              def self.asegura_camposdinamicos(caso, current_usuario_id, pestanas)
                if caso.nil?  || caso.id.nil?
                  return
                end
    
    
    Severity: Minor
    Found in lib/sivel2_gen/concerns/controllers/casos_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 importa has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

              def importa
                authorize! :create, Sivel2Gen::Caso
                arc = params[:arc]
                doc = nil
                begin
    Severity: Minor
    Found in lib/sivel2_gen/concerns/controllers/casos_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 personas has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def personas
                authorize! :contar, Sivel2Gen::Caso
    
                @pSegun = escapar_param(params, [:filtro, 'segun'])
                @pMunicipio = escapar_param(params, [:filtro, 'municipio'])
    Severity: Major
    Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb - About 2 hrs to fix

      Method victimizaciones has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                def victimizaciones
                  authorize! :contar, Sivel2Gen::Caso
      
                  # Filtros
                  pFini = escapar_param(params, [:filtro, 'fechaini'])
      Severity: Major
      Found in lib/sivel2_gen/concerns/controllers/mapamun_controller.rb - About 2 hrs to fix

        Function crearCopiaDeVictima has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          static crearCopiaDeVictima(obj, fobj) {
            let div_victima = obj.parentElement.parentElement;
            let valores_input= []
            let valores_select= []
            div_victima.querySelectorAll('input').forEach(elem => {
        Severity: Major
        Found in app/javascript/controllers/motor.js - About 2 hrs to fix

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

                    def procesa_filtros_categoria(where1)
                      pTviolencia = escapar_param(params, [:filtro, 'tviolencia_id'])
                      @pDesagregarpor = escapar_param(params, [:filtro, 'segun'])
                      pExcluirCateRep = escapar_param(params, [:filtro, 'excluircaterep'])
                      lcat = Sivel2Gen::Categoria.habilitados.pluck(:id)
          Severity: Minor
          Found in lib/sivel2_gen/concerns/controllers/graficar_conteo_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 personas_procesa_segun_om has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                    def personas_procesa_segun_om(que1, tablas1, where1, que3, tablas3, where3)
                      ctablas1 = tablas1
                      tablas1 = agregar_tabla(tablas1, 'public.msip_persona AS persona')
                      if (ctablas1 != tablas1)
                        where1 = ampliar_where_sinap(
          Severity: Major
          Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb - About 2 hrs to fix

            Method asignar_id_personatrelacion has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                      def asignar_id_personatrelacion(
                        params, victima_indice, victima_params, victimas_por_borrar
                      )
                        if victima_params[:persona_attributes]
                          if victima_params[:persona_attributes][:persona_trelacion1_attributes]
            Severity: Major
            Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 2 hrs to fix

              Function actualizarTrazosPresentados has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                actualizarTrazosPresentados(etiquetas) {
                  var etiquetasP = []
                  var i = 0
                  trazosPresentados.forEach(function(t) {
                    etiquetasP.push(t.name)
              Severity: Major
              Found in app/javascript/controllers/plotly_actos_controller.js - About 2 hrs to fix

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

                          def show_sivel2_gen
                            if !Rails.configuration.x.sivel2_consulta_web_publica
                              authorize! :read, Sivel2Gen::Caso
                            end
                
                
                Severity: Major
                Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 2 hrs to fix

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

                            def municipio_caso
                              r = ''
                              if self.caso && self.caso.ubicacionprincipal
                                if self.caso.ubicacionprincipal.pais_id == 170 # COLOMBIA
                                  r += self.caso.ubicacionprincipal.municipio ?
                  Severity: Minor
                  Found in lib/sivel2_gen/concerns/models/victima.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

                  File validarcasos_controller.rb has 257 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module Sivel2Gen
                    module Concerns
                      module Controllers
                        module ValidarcasosController
                          extend ActiveSupport::Concern
                  Severity: Minor
                  Found in lib/sivel2_gen/concerns/controllers/validarcasos_controller.rb - About 2 hrs to fix

                    Method create_sivel2_gen has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                              def create_sivel2_gen
                                @merr = "" # Colchon para errores
                                if params[:caso][:id].nil?
                                  @merr = 'Falta identificacion del caso' 
                                  render inline: @merr, status: :unprocessable_entity
                    Severity: Major
                    Found in lib/sivel2_gen/concerns/controllers/actoscolectivos_controller.rb - About 2 hrs to fix

                      Function crearCopiaDeCombatiente has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        static crearCopiaDeCombatiente(obj, fobj){
                          let div_combatiente = obj.parentElement.parentElement;
                          let valores_input= []
                          let valores_select= []
                          div_combatiente.querySelectorAll('input').forEach(elem => {
                      Severity: Major
                      Found in app/javascript/controllers/motor.js - About 2 hrs to fix

                        Method consulta has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                  def consulta
                                    authorize! :contar, Sivel2Gen::Caso
                        
                                    arma_estructuras
                        
                        
                        Severity: Major
                        Found in lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb - About 2 hrs to fix

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

                                    def valida_categoria_presponsable
                                      consl= "WITH RECURSIVE cteRecursion AS (
                                         SELECT id, 1 AS Level
                                             FROM public.sivel2_gen_presponsable
                                             WHERE id = 39
                          Severity: Minor
                          Found in lib/sivel2_gen/concerns/models/acto.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 valida_categoria_presponsable has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                          Open

                                    def valida_categoria_presponsable
                                      consl= "WITH RECURSIVE cteRecursion AS (
                                         SELECT id, 1 AS Level
                                             FROM public.sivel2_gen_presponsable
                                             WHERE id = 39
                          Severity: Minor
                          Found in lib/sivel2_gen/concerns/models/actocolectivo.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 nomrango has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                          Open

                                    def self.nomrango(fechaini, fechafin)
                                      if !fechaini
                                        return "Sin fechaini"
                                      end
                                      if !fechafin
                          Severity: Minor
                          Found in lib/sivel2_gen/concerns/controllers/mapadep_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

                          Severity
                          Category
                          Status
                          Source
                          Language