Showing 411 of 411 total issues
Method presenta
has a Cognitive Complexity of 328 (exceeds 5 allowed). Consider refactoring. Open
def presenta(atr)
case atr.to_s
when 'fuentesfrecuentes'
caso_fuenteprensa.inject('') {
|memo, cf|
- 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 casos_controller.rb
has 1371 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'nokogiri'
require 'csv'
module Sivel2Gen
module Concerns
File conteos_controller.rb
has 1028 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Sivel2Gen
module Concerns
module Controllers
module ConteosController
extend ActiveSupport::Concern
Method presenta_mas_index
has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring. Open
def presenta_mas_index(formato)
formato.csv {
authorize! :exportaCSV, Sivel2Gen::Caso
atributos = %w{caso_id fecha ubicaciones victimas presponsables tipificacion memo}
r = CSV.generate(headers: true) do |csv|
- 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 103 (exceeds 5 allowed). Consider refactoring. Open
def importa(datosent, datossal, formato_sexo,
menserror, opciones = {})
if datosent['fecha'].nil?
self.fecha = Date.today
menserror << "Falta fecha. "
- 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 update_gen
has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring. Open
def update_gen
respond_to do |format|
if (caso_params[:caso_ubicacionpre_attributes])
# Usa ubicacionepre existente o agrega si hace falta
- 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 94 (exceeds 5 allowed). Consider refactoring. Open
def importa(datosent, datossal, menserror, opciones = {})
v = datosent[1]
if v
if v['nombre']
self.nombre = v['nombre']
- 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 a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring. Open
def victimizaciones_gen_tabla(
pFini, pFfin, pTviolencia, pEtiqueta1, pEtiqueta2,
pExcluirCateRep, pSegun, pDepartamento, pMunicipio, otro,
pCategoria, pAgrucol)
- 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 caso.rb
has 712 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Sivel2Gen
module Concerns
module Models
module Caso
extend ActiveSupport::Concern
Method embeber_mapacalormuncol_svg
has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring. Open
def embeber_mapacalormuncol_svg(
depid, depcad, titulo, subtitulo, titulorangos, fuente,
cantidadesmun, opciones = {})
# Color más oscuro (para rango4)
cr = 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 embeber_mapacalordepcol_svg
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
def embeber_mapacalordepcol_svg(titulo, subtitulo, titulorangos, fuente,
cantidadesdep, opciones = {})
# Color más oscuro (para rango4)
cr = 0
cv = 255
- 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 291 lines of code (exceeds 25 allowed). Consider refactoring. Open
def importa(datosent, datossal, formato_sexo, menserror, opciones = {})
v = datosent[1]
def crea_persona(p, v, menserror, formato_sexo)
if p['id_persona'].to_i == v['id_persona'].to_i
per = Msip::Persona.new
Method presenta
has 284 lines of code (exceeds 25 allowed). Consider refactoring. Open
def presenta(atr)
case atr.to_s
when 'fuentesfrecuentes'
caso_fuenteprensa.inject('') {
|memo, cf|
Method importa
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
def importa(g, datossal, menserror, opciones = {})
#Se verifica que el grupo no sea un presunto responsable
gp = Msip::Grupoper.new
gp.nombre = g['nombre_grupo']
gp.save!
- 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 crea_persona
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
def crea_persona(p, v, menserror, formato_sexo)
if p['id_persona'].to_i == v['id_persona'].to_i
per = Msip::Persona.new
if p['nombre'].nil?
per.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"
Further reading
Method victimizaciones_gen_tabla
has 229 lines of code (exceeds 25 allowed). Consider refactoring. Open
def victimizaciones_gen_tabla(
pFini, pFfin, pTviolencia, pEtiqueta1, pEtiqueta2,
pExcluirCateRep, pSegun, pDepartamento, pMunicipio, otro,
pCategoria, pAgrucol)
File victima.rb
has 542 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Sivel2Gen
module Concerns
module Models
module Victima
extend ActiveSupport::Concern
Method lista_params_sivel2_gen
has 224 lines of code (exceeds 25 allowed). Consider refactoring. Open
def lista_params_sivel2_gen
if current_usuario && can?(:solocambiaretiquetas, Sivel2Gen::Caso)
[
:caso_etiqueta_attributes => [
:fecha,
Method create_sivel2_gen
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def create_sivel2_gen
@merr = ""
params2 = {}
if (!params[:caso] && !params2['caso'])
@merr = 'Faltan parámetros de caso'
- 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 55 (exceeds 5 allowed). Consider refactoring. Open
def importa(datosent, datossal, formato_sexo, menserror, opciones = {})
v = datosent[1]
def crea_persona(p, v, menserror, formato_sexo)
if p['id_persona'].to_i == v['id_persona'].to_i
per = Msip::Persona.new
- 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"