Showing 234 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)
- Read upRead up
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
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
- Read upRead up
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 = []
- Read upRead up
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 = []
- Read upRead up
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
- Read upRead up
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
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
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
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 &&
- Read upRead up
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,
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
- Read upRead up
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)
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]
- Read upRead up
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
- Read upRead up
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
- Read upRead up
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
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
- Read upRead up
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"