pasosdeJesus/sivel2_gen

View on GitHub

Showing 380 of 380 total issues

Identical blocks of code found in 3 locations. Consider refactoring.
Open

            que3.each do |t|
              if (t[1] != "") 
                gb += sep + i.to_s
                qc += t[0] + ", "
                sep = ", "
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 435..441
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 1046..1052

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 32.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

            que3.each do |t|
              if (t[1] != "") 
                gb += sep + i.to_s
                qc += t[0] + ", "
                sep = ", "
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb and 2 other locations - About 30 mins to fix
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 435..441
lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb on lines 432..438

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 32.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

  module Concerns
    module Models
      module ContextovictimaVictima 

        extend ActiveSupport::Concern
Severity: Major
Found in lib/sivel2_gen/concerns/models/contextovictima_victima.rb and 5 other locations - About 25 mins to fix
lib/sivel2_gen/concerns/models/etnia_victimacolectiva.rb on lines 3..21
lib/sivel2_gen/concerns/models/otraorga_victima.rb on lines 2..14
lib/sivel2_gen/concerns/models/profesion_victima.rb on lines 2..13
lib/sivel2_gen/concerns/models/sectorsocialsec_victima.rb on lines 2..13
lib/sivel2_gen/concerns/models/victimacolectiva_vinculoestado.rb on lines 3..18

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 31.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

  module Concerns
    module Models
      module VictimacolectivaVinculoestado 

        extend ActiveSupport::Concern
lib/sivel2_gen/concerns/models/contextovictima_victima.rb on lines 3..16
lib/sivel2_gen/concerns/models/etnia_victimacolectiva.rb on lines 3..21
lib/sivel2_gen/concerns/models/otraorga_victima.rb on lines 2..14
lib/sivel2_gen/concerns/models/profesion_victima.rb on lines 2..13
lib/sivel2_gen/concerns/models/sectorsocialsec_victima.rb on lines 2..13

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 31.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

  module Concerns
    module Models
      module SectorsocialsecVictima 

        extend ActiveSupport::Concern
Severity: Major
Found in lib/sivel2_gen/concerns/models/sectorsocialsec_victima.rb and 5 other locations - About 25 mins to fix
lib/sivel2_gen/concerns/models/contextovictima_victima.rb on lines 3..16
lib/sivel2_gen/concerns/models/etnia_victimacolectiva.rb on lines 3..21
lib/sivel2_gen/concerns/models/otraorga_victima.rb on lines 2..14
lib/sivel2_gen/concerns/models/profesion_victima.rb on lines 2..13
lib/sivel2_gen/concerns/models/victimacolectiva_vinculoestado.rb on lines 3..18

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 31.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

  module Concerns
    module Models
      module EtniaVictimacolectiva

        extend ActiveSupport::Concern
Severity: Major
Found in lib/sivel2_gen/concerns/models/etnia_victimacolectiva.rb and 5 other locations - About 25 mins to fix
lib/sivel2_gen/concerns/models/contextovictima_victima.rb on lines 3..16
lib/sivel2_gen/concerns/models/otraorga_victima.rb on lines 2..14
lib/sivel2_gen/concerns/models/profesion_victima.rb on lines 2..13
lib/sivel2_gen/concerns/models/sectorsocialsec_victima.rb on lines 2..13
lib/sivel2_gen/concerns/models/victimacolectiva_vinculoestado.rb on lines 3..18

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 31.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

  module Concerns
    module Models
      module OtraorgaVictima 

        extend ActiveSupport::Concern
Severity: Major
Found in lib/sivel2_gen/concerns/models/otraorga_victima.rb and 5 other locations - About 25 mins to fix
lib/sivel2_gen/concerns/models/contextovictima_victima.rb on lines 3..16
lib/sivel2_gen/concerns/models/etnia_victimacolectiva.rb on lines 3..21
lib/sivel2_gen/concerns/models/profesion_victima.rb on lines 2..13
lib/sivel2_gen/concerns/models/sectorsocialsec_victima.rb on lines 2..13
lib/sivel2_gen/concerns/models/victimacolectiva_vinculoestado.rb on lines 3..18

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 31.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

  module Concerns
    module Models
      module ProfesionVictima 
        extend ActiveSupport::Concern
          included do
Severity: Major
Found in lib/sivel2_gen/concerns/models/profesion_victima.rb and 5 other locations - About 25 mins to fix
lib/sivel2_gen/concerns/models/contextovictima_victima.rb on lines 3..16
lib/sivel2_gen/concerns/models/etnia_victimacolectiva.rb on lines 3..21
lib/sivel2_gen/concerns/models/otraorga_victima.rb on lines 2..14
lib/sivel2_gen/concerns/models/sectorsocialsec_victima.rb on lines 2..13
lib/sivel2_gen/concerns/models/victimacolectiva_vinculoestado.rb on lines 3..18

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 31.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if (params[:filtro] && params[:filtro]['fechafin'] && 
                params[:filtro]['fechafin'] != "") 
              @pFechafin = fecha_local_estandar(params[:filtro]['fechafin'])
            else
              @pFechafin = Sivel2Gen::Caso.maximum(:fecha).to_s
lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb on lines 114..119

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 31.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if (params[:filtro] && params[:filtro]['fechaini'] && 
                params[:filtro]['fechaini'] != "") 
              @pFechaini = fecha_local_estandar(params[:filtro]['fechaini'])
            else
              @pFechaini = Sivel2Gen::Caso.minimum(:fecha).to_s
lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb on lines 121..126

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 31.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method refresca_conscaso has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def refresca_conscaso
            if ARGV.include?("db:migrate")
              return 'Ejecutando migración'
            end
            if !ActiveRecord::Base.connection.data_source_exists? 'sivel2_gen_conscaso'
Severity: Minor
Found in lib/sivel2_gen/concerns/models/conscaso.rb - About 25 mins to fix

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 connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  connect() {
    console.log("Conexion de controlador Mapa osm");
    const usuarioAutenticado = this.data.get("usuarioAutenticado") === 'true';
    if (!this.constructor.marcadores) {
      this.constructor.marcadores = L.markerClusterGroup();
Severity: Minor
Found in app/javascript/controllers/mapaosm_controller.js - About 25 mins to fix

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_consexpcaso has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def crea_consexpcaso(conscaso, ordenar_por = nil)
            if ARGV.include?("db:migrate")
              return
            end
            if !ActiveRecord::Base.connection.data_source_exists? 'sivel2_gen_conscaso'
Severity: Minor
Found in lib/sivel2_gen/concerns/models/consexpcaso.rb - About 25 mins to fix

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 error_plantilla_no_autenticado has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def error_plantilla_no_autenticado
            redirect_back fallback_location: Rails.configuration.relative_url_root, flash:{ 
              error: "La generación de este reporte permite máximo "\
              "#{Rails.configuration.x.sivel2_consweb_max ?
              Rails.configuration.x.sivel2_consweb_max.to_s : '0' }"\
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 25 mins to fix

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                if v['observaciones'].kind_of?(Array)
                  v['observaciones'].each do |ob|
                    ele = ob.split(/\_([^_]*)$/)
                    recorrer_observaciones_co(ele, menserror)
                  end
Severity: Minor
Found in lib/sivel2_gen/concerns/models/combatiente.rb and 1 other location - About 25 mins to fix
lib/sivel2_gen/concerns/models/victima.rb on lines 568..575

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 30.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method reportar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def reportar
            authorize! :read, Sivel2Gen::Caso
            @rango_fechas = 'Fecha del hecho'
            @titulo = 'Reporte de casos repetidos'
            @repetidos = []
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/buscarrepetidos_controller.rb - About 25 mins to fix

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            @mapamun_subtitulo = Sivel2Gen::MapadepController.nomrango(
              pFini != '' ? 
              Msip::FormatoFechaHelper::reconoce_adivinando_locale(pFini) : 
              Sivel2Gen::Caso.all.minimum(:fecha), 
              pFfin != '' ? 
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/mapamun_controller.rb and 1 other location - About 25 mins to fix
lib/sivel2_gen/concerns/controllers/mapadep_controller.rb on lines 86..92

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 30.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if v['observaciones'].kind_of?(Array)
              v['observaciones'].each do |ob|
                ele = ob.split(/\_([^_]*)$/)
                recorrer_observaciones_v(ele, menserror)
              end
Severity: Minor
Found in lib/sivel2_gen/concerns/models/victima.rb and 1 other location - About 25 mins to fix
lib/sivel2_gen/concerns/models/combatiente.rb on lines 176..183

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 30.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method resolver_solicitud has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def resolver_solicitud
            if params[:solicitud_id]
              usuario = Msip::Usuario.find(current_usuario.id)
              solicitud = Msip::Solicitud.find(params[:solicitud_id])
              creado_por = Msip::Usuario.find(solicitud.usuario_id) 
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 25 mins to fix

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 gen_formato has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def gen_formato(formato)
            Consexpcaso.crea_consexpcaso(@conscaso, @campoord)
            if params[:filtro].nil? || params[:idplantilla].nil?
              head :no_content
            elsif params[:idplantilla].to_i <= 0
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 25 mins to fix

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

Severity
Category
Status
Source
Language