Showing 272 of 272 total issues
Method despliega_abajo_dk
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def despliega_abajo_dk(opcionmenu, url, opciones = {}, &bloque)
copiaop = opciones
opab = opcionmenu.gsub(" ", "_")
maticon = "home"
if opciones[:maticon]
Method filtra_contenido_params
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def filtra_contenido_params
if !params || !params[:ubicacionpre] ||
!params[:ubicacionpre][:lugar] ||
!params[:ubicacionpre][:lugar].strip == '' ||
!params[:ubicacionpre][:pais_id] ||
- 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 validar_conjunto_paises_biyeccion
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validar_conjunto_paises_biyeccion(validaciones)
if Msip::Pais.all.count != Msip::Ubicacionpre.where(lugar: nil).
where(departamento_id: nil).count
validaciones << {
titulo: "Diferencia en paises y ubicacionespre dpa de paises",
Method initialize_msip
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize_msip(usuario = nil)
# El primer argumento para can es la acción a la que se da permiso,
# el segundo es el recurso sobre el que puede realizar la acción,
# el tercero opcional es un diccionario de condiciones para filtrar
# más (e.g :publicado => true).
Function enviarAutomaticoFormulario
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
static enviarAutomaticoFormulario(f, metodo = 'GET', tipo = 'script', alertaerror = true, vcommit = 'Enviar', agenviarautom = true) {
const root = window;
const t = Date.now();
let d = -1;
if (root.msip_enviarautomatico_t) {
Method barra_navegacion
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def barra_navegacion(opciones, &bloque)
r = content_tag(
:nav,
class: "navbar navbar-expand-lg navbar-light bg-light",
) do
- 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 reconoce_adivinando_locale
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def reconoce_adivinando_locale(f, menserror = nil)
if !f || (f.class != String && f.class != Date) ||
(f.class == String && f == "")
return nil
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 dif_meses_dias
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def dif_meses_dias(fechaini, fechafin)
m = 0
d = 0
if fechaini && fechafin && fechaini < fechafin
if fechafin.month < fechaini.month
- 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 item_acordeon_bs
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def item_acordeon_bs(
acid, idit, titulo, expandido = false, opciones_ps = {}, &bloque
)
opciones = opciones_ps.stringify_keys
content_tag(
- 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 modelo_path
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def modelo_path(o, posfijo_path = true)
if o.nil?
return main_app.root_path
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 carga_semillas_sql
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def self.carga_semillas_sql(conexion, motor, tipoarchivo, patexcluye = nil)
if tipoarchivo.to_s != "datos" && tipoarchivo.to_s != "cambios"
raise "Las semillas solo pueden ser cambios o datos"
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
Function remplazarOpcionesSelect
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
static remplazarOpcionesSelect(
idElemento, nuevasop, usatomselect = false, cid = 'id',
cetiqueta = 'nombre', opvacia = false
) {
let elemento = document.getElementById(idElemento)
Function cambia_tdocumento
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
cambia_tdocumento(e) {
var purl = window.puntomontaje;
if (purl == "/") {
purl = "";
}
Method genera_modelo
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def genera_modelo
template(
"tablabasica.rb.erb",
"app/models/#{nom_arch}.rb",
)
Method ruta_responde_0p
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def ruta_responde_0p(n)
begin
r = send(n)
return [n, r]
rescue NoMethodError
- 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 ruta_responde_1p
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def ruta_responde_1p(n, p)
begin
r = send(n, p)
return [n, r]
rescue NoMethodError
- 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 asociacion_combinada
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.asociacion_combinada(atr)
r = nil
if atr.is_a?(Hash) &&
(atr.first[0].to_s.ends_with?("_ids") ||
atr.first[0].to_s.ends_with?("_attributes"))
- 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 a
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.a(ip, usuario_id, url, params,
modelo, modelo_id, operacion, detalle_json = "{}")
url = url ? url.to_s : ""
url = url[0..49] if url && url.length > 50
modelo = modelo ? modelo.to_s : ""
Method index
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index(c = nil)
if c.nil?
c = Msip::Orgsocial.all
end
if params[:term]
Method nomenclatura
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def nomenclatura(pais, departamento, municipio,
centropoblado, vereda, lugar, sitio)
if pais.to_s.strip == ""
return ['', '']
end