pasosdeJesus/sivel2_gen

View on GitHub

Showing 411 of 411 total issues

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

          def presenta(atr)
            case atr.to_s
            when 'fuentesfrecuentes'
              caso_fuenteprensa.inject('') { 
                |memo, cf| 
Severity: Minor
Found in lib/sivel2_gen/concerns/models/caso.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 casos_controller.rb has 1371 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'nokogiri'
require 'csv'

module Sivel2Gen
  module Concerns
Severity: Major
Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 3 days to fix

    File conteos_controller.rb has 1028 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Sivel2Gen
      module Concerns
        module Controllers
          module ConteosController
            extend ActiveSupport::Concern
    Severity: Major
    Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb - About 2 days to fix

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

                def presenta_mas_index(formato)
                  formato.csv {
                    authorize! :exportaCSV, Sivel2Gen::Caso
                    atributos = %w{caso_id fecha ubicaciones victimas presponsables tipificacion memo}
                    r = CSV.generate(headers: true) do |csv|
      Severity: Minor
      Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 2 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

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

                def importa(datosent, datossal, formato_sexo,
                            menserror, opciones = {})
                  if datosent['fecha'].nil?
                    self.fecha = Date.today
                    menserror << "Falta fecha. "
      Severity: Minor
      Found in lib/sivel2_gen/concerns/models/caso.rb - About 2 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

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

                def update_gen
                  respond_to do |format|
      
                     if (caso_params[:caso_ubicacionpre_attributes])
                      # Usa ubicacionepre existente o agrega si hace falta
      Severity: Minor
      Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 2 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

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

                def importa(datosent, datossal, menserror, opciones = {})
                  v = datosent[1]
                  if v
                    if v['nombre']
                      self.nombre = v['nombre']
      Severity: Minor
      Found in lib/sivel2_gen/concerns/models/combatiente.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 victimizaciones_gen_tabla has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
      Open

                def victimizaciones_gen_tabla(
                  pFini, pFfin, pTviolencia, pEtiqueta1, pEtiqueta2,
                  pExcluirCateRep, pSegun, pDepartamento, pMunicipio, otro,
                  pCategoria, pAgrucol)
      
      
      Severity: Minor
      Found in lib/sivel2_gen/concerns/controllers/conteos_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 caso.rb has 712 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module Sivel2Gen
        module Concerns
          module Models
            module Caso 
              extend ActiveSupport::Concern
      Severity: Major
      Found in lib/sivel2_gen/concerns/models/caso.rb - About 1 day to fix

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

            def embeber_mapacalormuncol_svg(
              depid, depcad, titulo, subtitulo, titulorangos, fuente, 
              cantidadesmun, opciones = {})
              # Color más oscuro (para rango4)
              cr = 0
        Severity: Minor
        Found in app/helpers/sivel2_gen/vista_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 embeber_mapacalordepcol_svg has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
        Open

            def embeber_mapacalordepcol_svg(titulo, subtitulo, titulorangos, fuente,
                                            cantidadesdep, opciones = {})
              # Color más oscuro (para rango4)
              cr = 0
              cv = 255
        Severity: Minor
        Found in app/helpers/sivel2_gen/vista_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 importa has 291 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                  def importa(datosent, datossal, formato_sexo, menserror, opciones = {})
                    v = datosent[1]
                    def crea_persona(p, v, menserror, formato_sexo)
                      if p['id_persona'].to_i == v['id_persona'].to_i
                        per = Msip::Persona.new
        Severity: Major
        Found in lib/sivel2_gen/concerns/models/victima.rb - About 1 day to fix

          Method presenta has 284 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                    def presenta(atr)
                      case atr.to_s
                      when 'fuentesfrecuentes'
                        caso_fuenteprensa.inject('') { 
                          |memo, cf| 
          Severity: Major
          Found in lib/sivel2_gen/concerns/models/caso.rb - About 1 day to fix

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

                      def importa(g, datossal, menserror, opciones = {})
                        #Se verifica que el grupo no sea un presunto responsable
                        gp = Msip::Grupoper.new
                        gp.nombre = g['nombre_grupo']
                        gp.save!
            Severity: Minor
            Found in lib/sivel2_gen/concerns/models/victimacolectiva.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 crea_persona has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
            Open

                        def crea_persona(p, v, menserror, formato_sexo)
                          if p['id_persona'].to_i == v['id_persona'].to_i
                            per = Msip::Persona.new
                            if p['nombre'].nil?
                              per.nombres = 'N'
            Severity: Minor
            Found in lib/sivel2_gen/concerns/models/victima.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 victimizaciones_gen_tabla has 229 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                      def victimizaciones_gen_tabla(
                        pFini, pFfin, pTviolencia, pEtiqueta1, pEtiqueta2,
                        pExcluirCateRep, pSegun, pDepartamento, pMunicipio, otro,
                        pCategoria, pAgrucol)
            
            
            Severity: Major
            Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb - About 1 day to fix

              File victima.rb has 542 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              module Sivel2Gen
                module Concerns
                  module Models
                    module Victima
                      extend ActiveSupport::Concern
              Severity: Major
              Found in lib/sivel2_gen/concerns/models/victima.rb - About 1 day to fix

                Method lista_params_sivel2_gen has 224 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          def lista_params_sivel2_gen
                            if current_usuario && can?(:solocambiaretiquetas, Sivel2Gen::Caso)
                              [
                                :caso_etiqueta_attributes => [
                                  :fecha,
                Severity: Major
                Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 1 day to fix

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

                            def create_sivel2_gen
                              @merr = ""
                              params2 = {}
                              if (!params[:caso] && !params2['caso'])
                                @merr = 'Faltan parámetros de caso'
                  Severity: Minor
                  Found in lib/sivel2_gen/concerns/controllers/actos_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

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

                            def importa(datosent, datossal, formato_sexo, menserror, opciones = {})
                              v = datosent[1]
                              def crea_persona(p, v, menserror, formato_sexo)
                                if p['id_persona'].to_i == v['id_persona'].to_i
                                  per = Msip::Persona.new
                  Severity: Minor
                  Found in lib/sivel2_gen/concerns/models/victima.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

                  Severity
                  Category
                  Status
                  Source
                  Language