Showing 51 of 73 total issues
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 programa_generacion_listado_int
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def programa_generacion_listado_int(params, extension, campoid, pl, narch)
Method importa_dato
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def importa_dato(datosent, datossal, menserror, registro = nil, opciones = {})
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 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"
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 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"