Showing 214 of 272 total issues
Method atributos_index
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def atributos_index
[
:id,
:nombre,
:fondo,
Method presenta_nombre
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def presenta_nombre(opciones = {})
sep = ""
r = ""
if opciones[:sin_pais].nil? && pais
r = pais.nombre
- 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 a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
static remplazarOpcionesSelect(
idElemento, nuevasop, usatomselect = false, cid = 'id',
cetiqueta = 'nombre', opvacia = false
) {
let elemento = document.getElementById(idElemento)
- 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 partirFechaLocalizada
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
static partirFechaLocalizada(fechaLocalizada, formato) {
let anio = 1900
let dia = 15
let mes = 6
if (formato == 'dd/M/yyyy' || formato == 'dd-M-yyyy') {
- 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 27 lines of code (exceeds 25 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
Function ponerTemaUsuarioAjax
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static async ponerTemaUsuarioAjax(){
var root = window
var ruta = 'temausuario'
var datos = {}
var t = Date.now();
Method asegura_varambiente_bd
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def asegura_varambiente_bd
# Toma ideas de https://github.com/opdemand/puppet-modules/blob/master/rails/files/databases.rake
abcs = ActiveRecord::Base.configurations
confbd = abcs.configurations.select { |c| c.env_name == Rails.env }.first
Method vfechanac
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def vfechanac
anioactual = Time.now.strftime("%Y").to_i
if anionac && anionac > anioactual
errors.add(:anionac, "Año debe ser menor al actual")
end
Method temausuario
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def temausuario
t = ::Msip::TemasHelper.tema_usuario(defined?(current_usuario) ? current_usuario : nil)
render(
json: {
fondo: t.fondo,
Method filtra_contenido_params
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def filtra_contenido_params
if !params || !params[:ubicacionpre] ||
!params[:ubicacionpre][:lugar] ||
!params[:ubicacionpre][:lugar].strip == '' ||
!params[:ubicacionpre][:pais_id] ||
Method solicitud
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def solicitud
unless ENV["SMTP_MAQ"]
Rails.logger.debug("No esta definida variable de ambiente SMTP_MAQ")
exit(1)
end
Method modelo_path
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def modelo_path(o, posfijo_path = true)
if o.nil?
return main_app.root_path
end
Method anuncios_bootstrap
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def anuncios_bootstrap
r = "".dup
flash.each do |tipo, mensaje|
tal = case tipo.to_sym
when :success, :notice
Method genera_modelo
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def genera_modelo
template(
"tablabasica.rb.erb",
"app/models/#{nom_arch}.rb",
)
Method a
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.a(ip, usuario_id, url, params,
modelo, modelo_id, operacion, detalle_json = "{}")
Function msip_ubicacionpre_expandible_autocompleta_lugar
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function msip_ubicacionpre_expandible_autocompleta_lugar(centropoblado_id, tsit, lug, sit, lat, lon, ubipre, root){
Consider simplifying this complex logical expression. Open
elsif dianac && mesnac && (mesnac == 4 || mesnac == 6 ||
mesnac == 9 || mesnac == 11) &&
dianac > 30
errors.add(:dianac, "Dia debe ser menor o igual a 30")
elsif dianac && dianac > 31
Consider simplifying this complex logical expression. Open
regjson = if params &&
((params[:presenta_nombre] &&
params[:presenta_nombre] == "1") ||
(params[:filtro] && params[:filtro][:presenta_nombre] &&
params[:filtro][:presenta_nombre] == "1")) && @registros
Function cambiar_pais
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
cambiar_pais(e) {
var purl = Msip__Motor.arreglarPuntoMontaje()
console.log("departamento ahora es", this.departamentoTarget.value)
let url = purl + '/admin/departamentos.json?pais_id=' + e.target.value
- 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 modelos_path
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def modelos_path(o, posfijo_path = true)
if o.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"