pasosdeJesus/msip

View on GitHub

Showing 214 of 272 total issues

Method buscar_o_agregar has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
Open

          def buscar_o_agregar(pais_id, departamento_id, municipio_id,
            centropoblado_id, lugar, sitio, tsitio_id,
            latitud, longitud,
            usa_latlon = true)

Severity: Minor
Found in lib/msip/concerns/models/ubicacionpre.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 importa_msip has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
Open

          def importa_msip(datosent, datossal, menserror, opciones = {})
            unless datosent.key?(:sexo)
              self.sexo = "S"
            end

Severity: Minor
Found in lib/msip/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

Method presenta_gen_msip has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
Open

      def presenta_gen_msip(atr)
        clf = self.class.clase_llave_foranea(atr)
        if self.class.columns_hash && self.class.columns_hash[atr.to_s] &&
            self.class.columns_hash[atr.to_s].type == :boolean
          if self[atr.to_s]
Severity: Minor
Found in app/models/msip/modelo.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 modelos_controller.rb has 586 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Msip
  module Concerns
    module Controllers
      module ModelosController
        extend ActiveSupport::Concern
Severity: Major
Found in lib/msip/concerns/controllers/modelos_controller.rb - About 1 day to fix

    Method buscar_o_agregar has 199 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def buscar_o_agregar(pais_id, departamento_id, municipio_id,
                centropoblado_id, lugar, sitio, tsitio_id,
                latitud, longitud,
                usa_latlon = true)
    
    
    Severity: Major
    Found in lib/msip/concerns/models/ubicacionpre.rb - About 7 hrs to fix

      File persona.rb has 481 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module Msip
        module Concerns
          module Models
            module Persona
              extend ActiveSupport::Concern
      Severity: Minor
      Found in lib/msip/concerns/models/persona.rb - About 7 hrs to fix

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

                  def presenta_msip(atr)
                    case atr.to_s
                    when "{:orgsocial_persona=>[]}"
                      if orgsocial_persona
                        orgsocial_persona.inject("") do |memo, s|
        Severity: Minor
        Found in lib/msip/concerns/models/orgsocial.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 bootstrap_helper.rb has 456 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module Msip
          module BootstrapHelper
            # Genera grupo de menus
            def grupo_menus(opciones = {}, &bloque)
              adclases = ["navbar-nav", "me-auto"]
        Severity: Minor
        Found in app/helpers/msip/bootstrap_helper.rb - About 6 hrs to fix

          Method update_gen has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
          Open

                    def update_gen(registro = nil)
                      @registro = if registro
                        registro
                      else
                        clase.constantize.find(params[:id])
          Severity: Minor
          Found in lib/msip/concerns/controllers/modelos_controller.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

          File ubicacionespre_controller.rb has 435 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module Msip
            module Concerns
              module Controllers
                module UbicacionespreController
                  extend ActiveSupport::Concern
          Severity: Minor
          Found in lib/msip/concerns/controllers/ubicacionespre_controller.rb - About 6 hrs to fix

            Method index_msip has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
            Open

                      def index_msip(c = nil)
                        if !c.nil?
                          if c.class.to_s.end_with?("ActiveRecord_Relation")
                            if clase.constantize.to_s != c.klass.to_s
                              Rails.logger.debug do
            Severity: Minor
            Found in lib/msip/concerns/controllers/modelos_controller.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 campofecha_mesanio has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
            Open

                  def campofecha_mesanio(*fields)
                    fields.each do |f|
                      define_method("#{f}_anio") do
                        val = self[f]
                        val&.year ? val.year : nil
            Severity: Minor
            Found in app/models/msip/localizacion.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 accesores_ubicacionpre has 129 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def accesores_ubicacionpre(prefijo)
                  send(
                    :belongs_to,
                    prefijo.to_s.to_sym,
                    class_name: "Msip::Ubicacionpre",
            Severity: Major
            Found in lib/msip/accesores_ubicacionpre.rb - About 5 hrs to fix

              File ubicacionpre.rb has 381 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              module Msip
                module Concerns
                  module Models
                    module Ubicacionpre
                      extend ActiveSupport::Concern
              Severity: Minor
              Found in lib/msip/concerns/models/ubicacionpre.rb - About 5 hrs to fix

                Method destroy_gen has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                          def destroy_gen(mens = "", verifica_tablas_union = true)
                            @registro = clase.constantize.find(params[:id])
                            if @registro.respond_to?("current_usuario=")
                              @registro.current_usuario = current_usuario
                            end
                Severity: Minor
                Found in lib/msip/concerns/controllers/modelos_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

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

                          def self.a(ip, usuario_id, url, params,
                            modelo, modelo_id, operacion, detalle_json = "{}")
                            url = url ? url.to_s : ""
                            url = url[0..49] if url && url.length > 50
                            modelo = modelo ? modelo.to_s : ""
                Severity: Minor
                Found in lib/msip/concerns/models/bitacora.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

                Method filtrar has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                Open

                          def filtrar(reg, params_filtro)
                            # Control para fecha podría no estar localizado aunque
                            # campos por presentar si
                            latr1 = atributos_index.map do |a|
                              if a.to_s.end_with?("_localizada")
                Severity: Minor
                Found in lib/msip/concerns/controllers/modelos_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

                Method importa_msip has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          def importa_msip(datosent, datossal, menserror, opciones = {})
                            unless datosent.key?(:sexo)
                              self.sexo = "S"
                            end
                
                
                Severity: Major
                Found in lib/msip/concerns/models/persona.rb - About 4 hrs to fix

                  Method importa_gen has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def importa_gen(datosent, datossal, menserror, opciones = {})
                          datosent.keys.each do |ll|
                            case ll.to_sym
                            when :actualizado_en
                              self.updated_at = datosent[ll.to_sym]
                  Severity: Minor
                  Found in app/models/msip/modelo.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

                  Method accesores_ubicacionpre has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def accesores_ubicacionpre(prefijo)
                        send(
                          :belongs_to,
                          prefijo.to_s.to_sym,
                          class_name: "Msip::Ubicacionpre",
                  Severity: Minor
                  Found in lib/msip/accesores_ubicacionpre.rb - About 3 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