Showing 56 of 82 total issues
Method perform
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def perform(idplantilla, nomcontrolador, narchent, narcherr, extension, ulteditor_id)
Method antcol
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def antcol(col)
if col == ""
raise "No puede calcular antcol(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 compara_columnas
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def compara_columnas(col1, col2)
if col1.length < col2.length
return -1
end
if col2.length < col1.length
- 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
Consider simplifying this complex logical expression. Open
if (p[1] != 'html' && p[1] != 'ods' && p[1] != 'odt' && p[1] != 'xrlat' && p[1] != 'json' && p[1] != 'csv') {
nplantilla = ''
} else {
formato = p[1]
if (formato == 'html' || formato == 'odt' || formato == 'xrlat' || formato == 'json' || formato == 'csv') {
Method importa_dato
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def importa_dato(datosent, datossal, menserror, registro = nil, opciones = {})
Method importa_dato_gen
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def importa_dato_gen(datosent, datossal, menserror, registro = nil, opciones = {})
Method complementa_importa_dato
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def complementa_importa_dato(registro, ulteditor_id, datossal,
menserror, opciones = {})
Method llena_plantilla_multiple_importadatos
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
plantillahcm, controlador, modelo, narchent, ulteditor_id
Method programa_generacion_listado_int
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def programa_generacion_listado_int(params, extension, campoid, pl, narch)
Method sigcol
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sigcol(col)
res = ""
i = col.length - 1
lleva = 1
while 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 permiso_ver_leer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def permiso_ver_leer(ruta, carpeta, usuario)
if usuario.rol == Ability::ROLADMIN || usuario.rol == Ability::ROLDIR ||
ruta == "/"
return true
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
Avoid too many return
statements within this method. Open
return
Method elimina_columna
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def elimina_columna(plantillahcm_id, id)
pore = Heb412Gen::Campoplantillahcm
.where(plantillahcm_id: plantillahcm_id).where(id: id).take
unless pore
raise "No se encontró columna con id #{id} en "\
- 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 perform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def perform(idplantilla, nomcontrolador, narchent, narcherr, extension, ulteditor_id)
puts "Inicio de generación de plantilla #{idplantilla} con nomcontrolador #{nomcontrolador}, importando de #{narchent} escribiendo errores en #{narcherr} con extensión #{extension} ulteditor_id es #{ulteditor_id}"
plant = Heb412Gen::Plantillahcm.find(idplantilla)
controlador = nomcontrolador.constantize.new
modelo = controlador.clase
- 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 programa_generacion_listado_int
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def programa_generacion_listado_int(params, extension, campoid, pl, narch)
ids = @registros.map(&campoid)
parsimp = {}
parsimp[:busfechainicio_ini] = 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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create
authorize!(:edit, Heb412Gen::Doc)
@doc = Heb412Gen::Doc.new(doc_params)
if !@doc.nombre && @doc.adjunto_file_name
@doc.nombre = @doc.adjunto_file_name
- 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"