Showing 214 of 272 total issues
Method index
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def index(c = nil)
if c.nil?
c = Msip::Orgsocial.all
end
if params[:term]
- 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 separa_apellidos_nombres
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def separa_apellidos_nombres(nombre, menserror)
apellidos = "N"
nombres = "N"
n = nombre.to_s.gsub(/ */, " ").gsub(/^ /, "").gsub(/ $/, "")
p = n.split(" ")
- 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 update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update
if params && params[:orgsocial] &&
params[:orgsocial][:orgsocial_persona_attributes]
op_params = params[:orgsocial][:orgsocial_persona_attributes]
op_params.each do |_clave, valor|
- 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 formato_ubicacion
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def formato_ubicacion(u, con_centropoblado = true, con_pais = true)
if u.nil?
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 par_departamento_municipio
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def par_departamento_municipio
if (centropoblado_id || vereda_id || municipio_id) &&
!departamento_id
errors.add(
:departamento_id, "Falta departamento"
- 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_centropoblado
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def par_municipio_centropoblado
if (centropoblado_id || vereda_id ) && !municipio_id
errors.add(
:municipio_id, "Falta municipio"
)
- 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 fecha_estandar_local
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def fecha_estandar_local(f)
if !f || (f.class != String && f.class != Date &&
f.class != ActiveSupport::TimeWithZone) ||
(f.class == String && f == "")
return 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
Method presenta_fechanac
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def presenta_fechanac
r = ""
r += dianac.to_s if dianac
r += "/"
r += FormatoFechaHelper::ABMESES[mesnac] if mesnac &&
- 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 edit_gen
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def edit_gen
@registro = clase.constantize.find(params[:id])
if @registro.respond_to?("current_usuario=")
@registro.current_usuario = current_usuario
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 index
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def index(c = nil)
if c.nil?
c = Msip::Ubicacionpre.all
end
if params[:term]
- 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 nomenclatura
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def nomenclatura(pais, departamento, municipio,
centropoblado, vereda, lugar, sitio)
Method agregar_actualizar
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
request, indparam1, indparam2, usuario_id, params,
modelo, registro_id
Avoid deeply nested control flow statements. Open
if send(atr.to_s).to_s.include?("ActiveRecord_Associations_CollectionProxy")
e = send(atr.to_s)
e.inject("") do |memo, i|
(memo == "" ? "" : memo + "; ") +
(i.respond_to?("presenta_nombre") ? i.presenta_nombre.to_s : i.to_s)
Avoid deeply nested control flow statements. Open
if(typeof el.tomselect === 'undefined' &&
(el.tagName == "INPUT" || el.tagName == "SELECT")) {
new TomSelect(el, window.configuracionTomSelect);
}
Method coleccion_basica
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.coleccion_basica(basica, ultimos_ids = nil)
h = basica.habilitados
unless ultimos_ids.nil?
idsh = h.map(&:id)
lu = ultimos_ids
- 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)
Method item_nav_pestaña_bs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def item_nav_pestaña_bs(idit, titulo, elegida = false,
clase_boton = "", &bloque)
content_tag(
:li,
class: "nav-item",
- 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 formato_ubicacion_partes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def formato_ubicacion_partes(pais_id, departamento_id, municipio_id,
centropoblado_id, con_centropoblado, con_pais)
Function msip_ubicacionpre_expandible_busca_lugar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function msip_ubicacionpre_expandible_busca_lugar(s, ubi) {
root = window
msip_arregla_puntomontaje(root)
cnom = s.attr('id')
v = $("#" + cnom).data('autocompleta')
- 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
elsif respond_to?(atr)
r = send(atr)
if r
r.presenta_nombre
else