Showing 228 of 380 total issues
Method personas_procesa_filtros
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def personas_procesa_filtros(que1, tablas1, where1, que3,
tablas3, where3)
Method personas_segun_tipico
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def personas_segun_tipico(tabla, nomtabla, que1, que3, tablas3, where3)
Avoid deeply nested control flow statements. Open
if usuario.filtrodepartamento_ids.count > 0
dicc_filtro[:ubicacion]={
departamento_id: usuario.filtrodepartamento_ids
}
end
Method edad_de_fechanac_fecha
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def edad_de_fechanac_fecha(anionac, mesnac, dianac,
anio, mes, dia)
Method desagregarpor_tipico
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def desagregarpor_tipico(tabla, nomtabla, que1, que3, tablas3, where3)
Method procesa_filtros_fechas
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def procesa_filtros_fechas(where1)
if (params[:filtro] && params[:filtro]['fechaini'] &&
params[:filtro]['fechaini'] != "")
@pFechaini = fecha_local_estandar(params[:filtro]['fechaini'])
else
- 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 procesa_filtros
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def procesa_filtros(que1, tablas1, where1, que3,
tablas3, where3)
Method validacion_estandar
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def validacion_estandar(casos, titulo, where,
atr = [:id, :fecha, :nusuario],
encabezado = [
'Código', 'Fecha del Hecho', 'Usuario'],
ordenapor = 'fecha')
Avoid deeply nested control flow statements. Open
if pt.count > 0
params[:caso][:victima_attributes][victima_indice][:persona_attributes][:persona_trelacion1_attributes][persona_indice][:id] = pt[0].id
else
ptn = Msip::PersonaTrelacion.create(
persona1: vic.persona.id , persona2: p2_id
Avoid deeply nested control flow statements. Open
if victima_params[:persona_attributes][:id] != ""
vics = Sivel2Gen::Victima.where(
persona_id: victima_params[:persona_attributes][:id])
if vics.count > 0
vic = vics[0]
Method lista
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def lista
if params[:tabla]
r = nil
if (params[:tabla] == "departamento" && params[:pais_id].to_i > 0)
r = Msip::Departamento.where(fechadeshabilitacion: nil,
- 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
Avoid deeply nested control flow statements. Open
if victima_params[:id] == ""
if victima_creada == false
vic = Sivel2Gen::Victima.create(victima_params)
victima_creada = true
end
Method ajusta_titulos
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def ajusta_titulos(pFini, pFfin, pTviolencia, pEtiqueta1,
pEtiqueta2, pColormax)
Avoid deeply nested control flow statements. Open
if victima_params[:id] != ""
vic = Sivel2Gen::Victima.find(victima_params[:id].to_i)
else
victima_params_filtrado = victima_params.deep_dup.tap do |params|
params[:persona_attributes].delete(:persona_trelacion1_attributes)
Consider simplifying this complex logical expression. Open
if cr >= 0 && cr <= 255 && cv >= 0 && cv <= 255 && ca <= 0 && ca <= 255
cr = crt
cv = cvt
ca = cat
end
Consider simplifying this complex logical expression. Open
if cr >= 0 && cr <= 255 && cv >= 0 && cv <= 255 && ca <= 0 && ca <= 255
cr = crt
cv = cvt
ca = cat
end
Consider simplifying this complex logical expression. Open
if mesnac > mes || (dianac && dianac > 0 && dia && dia > 0 &&
dianac > dia)
na -= 1
end
Method importa
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def importa(datosent, datossal, formato_sexo,
menserror, opciones = {})
Method importa
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def importa(datosent, datossal, formato_sexo, menserror, opciones = {})
Method presenta_arbol_presp_ul_li
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def presenta_arbol_presp_ul_li(nivel, arbol, opciones={})
subarbol = ''
if arbol && arbol[:hijos] && arbol[:hijos].count > 0
subarbol = "<ul>\n".html_safe + arbol[:hijos].map{|h|
"<li>".html_safe +
- 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"