Showing 21 of 43 total issues
Method eliminar_casos
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
def eliminar_casos(subconsulta_ids_por_eliminar)
ejecutar_sql("
DELETE FROM sivel2_gen_caso_fuenteprensa WHERE
caso_id in (#{subconsulta_ids_por_eliminar});
")
Function exports
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(api) {
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env()
var isDevelopmentEnv = api.env('development')
var isProductionEnv = api.env('production')
Method arranca_ap_shiny
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def arranca_ap_shiny
# Como una aplicación shiny puede responder a diversos usuarios
# lo que hacemos por ahora es lanzar una que atienda a todos sobre
# un proceso nuevo que no bloquee la aplicación rails.
# Solo vuelve a iniciarse si un usuario solicita la gráfica
Function actualizarTrazosPresentados
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function actualizarTrazosPresentados(etiquetas) {
var etiquetasP = []
var i = 0
trazosPresentados.forEach(function(t) {
etiquetasP.push(t.name)
Function actualizarTrazosPresentados
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function actualizarTrazosPresentados(etiquetas) {
var etiquetasP = []
var i = 0
trazosPresentados.forEach(function(t) {
etiquetasP.push(t.name)
Function procesar_datos
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function procesar_datos(filas, variable) {
var contenedorFiltros = document.querySelector('.filtros'),
selectorCategoria= contenedorFiltros.querySelector('#presponsable'),
campoFechaini = contenedorFiltros.querySelector('#fechaini'),
Function procesar_datos
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function procesar_datos(filas, variable) {
var contenedorFiltros = document.querySelector('.filtros'),
selectorCategoria= contenedorFiltros.querySelector('#presponsable'),
campoFechaini = contenedorFiltros.querySelector('#fechaini'),
Method victimizaciones_individuales
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def victimizaciones_individuales
authorize! :contar, Sivel2Gen::Caso
@rutacsv = File.join(Rails.root, 'public/somosdefensores/siaddhh/csv/victimizaciones_individuales.csv').to_s
Method actos_individuales
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def actos_individuales
authorize! :contar, Sivel2Gen::Caso
@rutacsv = File.join(Rails.root, 'public/somosdefensores/siaddhh/csv/actos_individuales.csv').to_s
Method nuevo
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def nuevo
if params[:caso_id]
@persona = Msip::Persona.new
@victima = Victima.new
@persona.nombres = 'N'
Method arranca_ap_shiny
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def arranca_ap_shiny
# Como una aplicación shiny puede responder a diversos usuarios
# lo que hacemos por ahora es lanzar una que atienda a todos sobre
# un proceso nuevo que no bloquee la aplicación rails.
# Solo vuelve a iniciarse si un usuario solicita la gráfica
- 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 nuevo
has 43 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 update
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def update
if params[:caso] && params[:caso][:victimacolectiva_attributes]
params[:caso][:victimacolectiva_attributes].each { |i,v|
if v[:orgsocial_attributes] &&
v[:orgsocial_attributes][:grupoper_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
Method campos_plantillas
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def campos_plantillas
n = Heb412Gen::Ability::CAMPOS_PLANTILLAS_PROPIAS.
clone.merge(Sivel2Gen::Ability::CAMPOS_PLANTILLAS_PROPIAS.clone)
c= n['Victima'][:campos]
if c.index(:profesion)
Method presenta
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def presenta(atr)
case atr.to_s
when 'perfilliderazgo'
self.profesion ? self.profesion.nombre : ''
when 'colectivohumano'
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
function obtener_info_victimas(victimas, prresp, caso){
ruta_foto = caso.fotos_victimas;
var victimasCont = '<div class="text-center">'
if(ruta_foto){
primera = jQuery.map(ruta_foto, function(n, i ){return n })[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 ajusta_titulos
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def ajusta_titulos(pFini, pFfin, pTviolencia, pEtiqueta1,
pEtiqueta2, pColormax)
Function actualizarTrazosPresentados
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function actualizarTrazosPresentados(etiquetas) {
var etiquetasP = []
var i = 0
trazosPresentados.forEach(function(t) {
etiquetasP.push(t.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
Function actualizarTrazosPresentados
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function actualizarTrazosPresentados(etiquetas) {
var etiquetasP = []
var i = 0
trazosPresentados.forEach(function(t) {
etiquetasP.push(t.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 nuevo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def nuevo
if params[:caso_id]
@persona = Msip::Persona.new
@victima = Victima.new
@persona.nombres = 'N'
- 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"