Method edad_de_fechanac_fecha
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def edad_de_fechanac_fecha(anionac, mesnac, dianac,
anio, mes, dia)
if anionac.nil? || anionac == ''
return -1
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 poblacion_por_sexo_rango
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def poblacion_por_sexo_rango(caso_id, anio, mes, dia, modelorango, rangoedad, totsexo)
Method poblacion_por_rango_sexo
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def poblacion_por_rango_sexo(caso_id, anio, mes, dia, modelorango,
rangoedadsexo, totsexo)
Method poblacion_por_sexo_rango
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def poblacion_por_sexo_rango(caso_id, anio, mes, dia, modelorango, rangoedad, totsexo)
caso = Sivel2Gen::Caso.where(id: caso_id)
if caso.count < 1
return false
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 poblacion_por_rango_sexo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def poblacion_por_rango_sexo(caso_id, anio, mes, dia, modelorango,
rangoedadsexo, totsexo)
caso = Sivel2Gen::Caso.where(id: caso_id)
if caso.count < 1
return false
- 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 edad_de_fechanac_fecha
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def edad_de_fechanac_fecha(anionac, mesnac, dianac,
anio, mes, dia)
Consider simplifying this complex logical expression. Open
if mesnac > mes || (dianac && dianac > 0 && dia && dia > 0 &&
dianac > dia)
na -= 1
end
Method buscar_rango_edad
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def buscar_rango_edad(edad, modelorango)
if (!modelorango || !defined?(modelorango.constantize) ||
!defined?(!modelorango.constantize.habilitados))
puts "No se pudo usar modelorango"
return -1
- 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"