Showing 241 of 410 total issues
Method remplazar_sivel2_gen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def remplazar_sivel2_gen
@persona = Msip::Persona.find(params[:persona_id].to_i)
@caso = Sivel2Gen::Caso.find(params[:caso_id].to_i)
@caso.current_usuario = current_usuario
@vic_position = params[:vic_position].to_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
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return true
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return mi + ai + " - " + mf + af
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return
Method crea_consexpcaso
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def crea_consexpcaso(conscaso, ordenar_por = nil)
if ARGV.include?("db:migrate")
return
end
if !ActiveRecord::Base.connection.data_source_exists? 'sivel2_gen_conscaso'
- 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
Function connect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
connect() {
console.log("Conexion de controlador Mapa osm");
const usuarioAutenticado = this.data.get("usuarioAutenticado") === 'true';
if (!this.constructor.marcadores) {
this.constructor.marcadores = L.markerClusterGroup();
- 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 refresca_conscaso
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def refresca_conscaso
if ARGV.include?("db:migrate")
return 'Ejecutando migración'
end
if !ActiveRecord::Base.connection.data_source_exists? 'sivel2_gen_conscaso'
- 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 reportar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def reportar
authorize! :read, Sivel2Gen::Caso
@rango_fechas = 'Fecha del hecho'
@titulo = 'Reporte de casos repetidos'
@repetidos = []
- 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 gen_formato
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def gen_formato(formato)
Consexpcaso.crea_consexpcaso(@conscaso, @campoord)
if params[:filtro].nil? || params[:idplantilla].nil?
head :no_content
elsif params[:idplantilla].to_i <= 0
- 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 error_plantilla_no_autenticado
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def error_plantilla_no_autenticado
redirect_back fallback_location: Rails.configuration.relative_url_root, flash:{
error: "La generación de este reporte permite máximo "\
"#{Rails.configuration.x.sivel2_consweb_max ?
Rails.configuration.x.sivel2_consweb_max.to_s : '0' }"\
- 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"