Showing 241 of 410 total issues
Method create
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def create
@caso.current_usuario = current_usuario
@caso.memo = ''
@caso.titulo = ''
- 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 filtro_avanzado
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def filtro_avanzado(conscaso, params_filtro)
for i in campos_filtro1_gen do
if params_filtro[i] && params_filtro[i] != '' &&
params_filtro[i] != [''] &&
conscaso.respond_to?('filtro_' + i.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
Method procesa_desagregarpor_om
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def procesa_desagregarpor_om(que1, tablas1, where1, que3, tablas3, where3)
case @pDesagregarpor
when ''
que1 = agregar_tabla(que1, 'cast(\'total\' as text) as total')
Function ejecutarAlCargarPagina
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
static ejecutarAlCargarPagina() {
console.log("* Corriendo Sivel2Gen__Motor::ejecutarAlCargarPagina()")
// Envia formulario al presionar botones con clase fichacambia
// con más de 5 segundos de diferencia entre un click y el siguiente
Method create
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
@caso.current_usuario = current_usuario
@caso.memo = ''
@caso.titulo = ''
Method reportar
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def reportar
authorize! :read, Sivel2Gen::Caso
@rango_fechas = 'Fecha del hecho'
@titulo = 'Reporte de casos repetidos'
@repetidos = []
Method importa
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def importa(datosent, datossal, menserror, opciones = {})
## Verifica que sí es un presunto responsable
pres = Sivel2Gen::Presponsable.
where('upper(nombre COLLATE es_co_utf_8)=upper(? COLLATE es_co_utf_8)', datosent['nombre_grupo'])
unless pres.empty?
- 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 filtra_por_tviolencia
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def filtra_por_tviolencia
datos = []
if params[:tviolencia] && Sivel2Gen::Supracategoria.where(
tviolencia_id: params[:tviolencia]).count > 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 victimizaciones_gen_tabla
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
pFini, pFfin, pTviolencia, pEtiqueta1, pEtiqueta2,
pExcluirCateRep, pSegun, pDepartamento, pMunicipio, otro,
pCategoria, pAgrucol)
Function operarElegida
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
static operarElegida (eorig, cadpersona, id, otrosop) {
vic_position = eorig.target.id.split("_")[3]
fam_position = eorig.target.id.split("_")[9]
Msip__Motor.arreglarPuntomontaje()
const cs = id.split(';')
Function agregarCasosOsm
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
agregarCasosOsm(usuario_autenticado) {
if (typeof window.formato_fecha === 'undefined') {
Msip__Mootr.preparaEventosComunes();
}
var urlSolicitud = this.armarRutaConsulta('casos.json', usuario_autenticado);
Function armarRutaConsulta
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
armarRutaConsulta(rutaSinPuntomontaje, usuarioAutenticado) {
var ruta = window.puntoMontaje + rutaSinPuntomontaje;
var desde = document.getElementById('campo-desde').value;
var hasta = document.getElementById('campo-hasta').value;
var departamento = document.getElementById('departamento').value;
Method nuevo
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def nuevo
if params[:caso_id]
@grupoper = Msip::Grupoper.new
@victimacolectiva = Victimacolectiva.new
@grupoper.nombre = 'N'
Method importa
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def importa(datosent, datossal, menserror, opciones = {})
victimascol = datosent[0]
d = datosent[1]
if d['id_grupo_victima']
self.presponsable_id = d['id_presunto_grupo_responsable']
- 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 obtener_info_victimas
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
obtener_info_victimas(victimas, prresp, caso) {
var victimasCont = '<div><table>' +
'<tr><td>Víctimas:</td><td>';
for (var cv in victimas) {
if (victimas.hasOwnProperty(cv)) {
- 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 consulta
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def consulta
authorize! :contar, Sivel2Gen::Caso
arma_estructuras
- 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 departamento_caso
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def departamento_caso
r = ''
if self.caso && self.caso.ubicacionprincipal
if self.caso.ubicacionprincipal.pais_id == Msip.paisomision
r += self.caso.ubicacionprincipal.departamento ?
- 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 importa
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def importa(datosent, datossal, menserror, opciones = {})
victimas = datosent[0]
d = datosent[1]
if d['id_victima_individual']
self.presponsable_id = d['id_presunto_responsable_individual'].to_i
- 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 filtra_por_tviolencia
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def filtra_por_tviolencia
datos = []
if params[:tviolencia] && Sivel2Gen::Supracategoria.where(
tviolencia_id: params[:tviolencia]).count > 0
Method filtros_victimizaciones_gen
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
pFini, pFfin, pTviolencia, pEtiqueta1, pEtiqueta2,
pExcluirCateRep, pSegun, pDepartamento, pMunicipio, otro= nil,
pCategoria = nil)