Showing 56 of 82 total issues
Method llena_plantilla_multiple_importadatos
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
def self.llena_plantilla_multiple_importadatos(
plantillahcm, controlador, modelo, narchent, ulteditor_id
)
puts "self.llena_plantilla. ulteditor_id=#{ulteditor_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
File plantillahcm_controller.rb
has 457 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Heb412Gen
module Concerns
module Controllers
module PlantillahcmController
extend ActiveSupport::Concern
Function ejecutarAlCargarDocumentoYRecursos
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
static ejecutarAlCargarDocumentoYRecursos() {
console.log("* Corriendo Heb412Gen__Motor::ejecutarAlCargarDocumentoYRecursos()")
if (window.location.href.match(/\/plantillahcm\/ */)) {
document.addEventListener('change', event => {
if (event.target.id = "plantillahcm_vista") {
Method llena_plantilla_multiple_importadatos
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.llena_plantilla_multiple_importadatos(
plantillahcm, controlador, modelo, narchent, ulteditor_id
)
puts "self.llena_plantilla. ulteditor_id=#{ulteditor_id}"
Method perform
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def perform(idplantilla, cmodelo, ccontrolador, ids, narch, parsimp,
extension, campoid = :id, params = nil)
puts "Inicio de generación de plantilla #{idplantilla}, con modelo #{cmodelo}, controlador #{ccontrolador}, cantidad de ids #{ids.length}, en #{narch}#{extension}"
plant = Heb412Gen::Plantillahcm.find(idplantilla)
controlador = ccontrolador.constantize
- 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
File modelos_controller.rb
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Heb412Gen
class ModelosController < Msip::ModelosController
# Sin control de autorización porquue es usada por otras clases
# que si lo deben implementar
def importa_dato_gen(datosent, datossal, menserror, registro = nil, opciones = {})
Method index
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def index
authorize!(:read, Heb412Gen::Doc)
if current_usuario &&
::Ability.respond_to?(:externo?) && ::Ability.externo?(current_usuario)
if request.path != "/sis/arch/generados"
- 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 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform(idplantilla, cmodelo, ccontrolador, ids, narch, parsimp,
extension, campoid = :id, params = nil)
puts "Inicio de generación de plantilla #{idplantilla}, con modelo #{cmodelo}, controlador #{ccontrolador}, cantidad de ids #{ids.length}, en #{narch}#{extension}"
plant = Heb412Gen::Plantillahcm.find(idplantilla)
controlador = ccontrolador.constantize
Method importadatos
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def importadatos
if params && params[:filtro] &&
params[:filtro][:plantillahcm_id] && params[:filtro][:archivo]
if params[:filtro][:plantillahcm_id].to_i <= 0
Method llena_plantilla_multiple_fd
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def self.llena_plantilla_multiple_fd(plantillahcm, fd,
nomcontrolador = nil)
ruta = File.join(
Rails.application.config.x.heb412_ruta,
plantillahcm.ruta,
- 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_contenido
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def presenta_contenido(rr, modhistorial = true)
@leeme = nil
@dir = []
cotejador = TwitterCldr::Collation::Collator.new(
Rails.configuration.i18n.default_locale,
- 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 completarEnlacePlantilla
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
static completarEnlacePlantilla(
elema, idselplantilla, idruta, rutagenera, formatosalida = 'ods'
) {
let formato = formatosalida
let p = $(idselplantilla).val().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 llena_plantilla_fd
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def self.llena_plantilla_fd(plantillahcr, fd)
ruta = File.join(
Rails.application.config.x.heb412_ruta,
plantillahcr.ruta,
).to_s
- 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
Class ModelosController
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class ModelosController < Msip::ModelosController
# Sin control de autorización porquue es usada por otras clases
# que si lo deben implementar
def importa_dato_gen(datosent, datossal, menserror, registro = nil, opciones = {})
if registro.nil?
File sisarch_controller.rb
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "cgi"
module Heb412Gen
module Concerns
module Controllers
Method importadatos
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def importadatos
if params && params[:filtro] &&
params[:filtro][:plantillahcm_id] && params[:filtro][:archivo]
if params[:filtro][:plantillahcm_id].to_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 programa_generacion_listado
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def programa_generacion_listado(params, extension, campoid = :id)
if params[:idplantilla].nil? or params[:idplantilla].to_i <= 0 or
@registros == []
flash[:error] = "No hay registros por generar"
elsif Heb412Gen::Plantillahcm.where(
Method index
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
authorize!(:read, Heb412Gen::Doc)
if current_usuario &&
::Ability.respond_to?(:externo?) && ::Ability.externo?(current_usuario)
if request.path != "/sis/arch/generados"
Method presenta_contenido
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def presenta_contenido(rr, modhistorial = true)
@leeme = nil
@dir = []
cotejador = TwitterCldr::Collation::Collator.new(
Rails.configuration.i18n.default_locale,
Method campos_vista_formulario
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def campos_vista_formulario(v, formularios, agrega_ult_ed)
ab = ::Ability.new
col = if v.nil? || ab.campos_plantillas[v].nil?
[["", ""]]
else
- 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"