Showing 214 of 272 total issues
Avoid too many return
statements within this method. Open
return p.to_s + "PB"
Avoid too many return
statements within this method. Open
return Msip::Ubicacionpre.where(nombre: w[:nombre]).first.id
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return Msip::Ubicacionpre.where(w).take.id
Avoid too many return
statements within this method. Open
return ubi[0].id
Avoid too many return
statements within this method. Open
return t.to_s + "TB"
Avoid too many return
statements within this method. Open
return Msip::Ubicacionpre.where(w).take.id
Avoid too many return
statements within this method. Open
return ubi[0].id
Avoid too many return
statements within this method. Open
return nil
Method index
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def index
c = nil
if params[:pais_id]
idpais = params[:pais_id] != "" ? params[:pais_id].to_i : nil
c = Msip::Departamento.where(
- 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 despliega_abajo_prosidebar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def despliega_abajo_prosidebar(
opcionmenu, iconomenu = nil, iconoexp = nil, &bloque
)
ia = "".html_safe
if iconomenu
- 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 par_municipio_vereda
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def par_municipio_vereda
if municipio_id && vereda_id
if Msip::Vereda.where(municipio_id: municipio_id,
id: vereda_id).count != 1
errors.add(
- 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 capitaliza_titulo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def capitaliza_titulo(t)
r = ""
n = t.split(/\s+/)
unless n.empty?
r = n[0].titleize
- 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 which
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def which(cmd)
exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""]
ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
exts.each do |ext|
exe = File.join(path, "#{cmd}#{ext}")
- 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 vformatonumdoc
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def vformatonumdoc
if tdocumento && tdocumento.formatoregex != "" &&
!(numerodocumento =~ Regexp.new("^#{tdocumento.formatoregex}$"))
menserr = "Número de documento con formato errado."
if tdocumento.ayuda
- 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 ponerTemaUsuarioAjax
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static async ponerTemaUsuarioAjax(){
var root = window
var ruta = 'temausuario'
var datos = {}
var t = Date.now();
- 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 par_pais_departamento
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def par_pais_departamento
if pais_id && departamento_id
if Msip::Departamento.where(pais_id: pais_id,
id: departamento_id).count != 1
errors.add(
- 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_base
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.presenta_base(registro, atr)
case atr.to_s
when "actualizacion"
registro.updated_at
when "condensado_de_clave"
- 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 tema_usuario
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def tema_usuario(current_usuario)
t = if !current_usuario || !current_usuario.tema_id
if Msip::Tema.where(id: 1).count == 1
Msip::Tema.find(1)
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"