pasosdeJesus/sivel2_gen

View on GitHub

Showing 410 of 410 total issues

Method cuenta has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

          def cuenta
            fechasinicial = Sivel2Gen::Caso.all.order(fecha: :asc).pluck(:fecha).uniq
            fechafinal = params[:fechafin] ? params[:fechafin] : Date.today
            fechainicial = params[:fechaini] ? params[:fechaini] : 
              (fechasinicial.count > 0 ? fechasinicial[0] : '2001-01-01')
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 1 hr 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 guardar_y_editar has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

          def guardar_y_editar
            @caso = Caso.find(params[:id])
            @caso.assign_attributes(caso_params)
            @caso.memo = @caso.memo == "" ? " " : @caso.memo
            if @caso.save
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 1 hr 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 sivel2_gen_destroy has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

          def sivel2_gen_destroy
            tcaso_id=@caso.id
            if @caso.id
              CasoUsuario.where(caso_id: @caso.id).destroy_all
            end
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 1 hr 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 nuevo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

          def nuevo
            if params[:caso_id]
              @grupoper = Msip::Grupoper.new
              @victimacolectiva = Victimacolectiva.new
              @grupoper.nombre = 'N'

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 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def nuevo
      if params[:caso_id]
        @combatiente = Combatiente.new
        @combatiente.nombre = 'N'
        @combatiente.sexo = Msip::Persona.convencion_sexo[:sexo_masculino].to_s
Severity: Minor
Found in app/controllers/sivel2_gen/combatientes_controller.rb - About 1 hr to fix

    Method vista_geo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def vista_geo(que3, tablas3, where3)
                if (@pDepartamento == "1") 
                  que3 << ["departamento_nombre", "Departamento"]
                end
                if (@pMunicipio== "1") 
    Severity: Minor
    Found in lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb - About 1 hr to fix

      Method procesa_filtros_categoria has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                def procesa_filtros_categoria(where1)
                  pTviolencia = escapar_param(params, [:filtro, 'tviolencia_id'])
                  @pDesagregarpor = escapar_param(params, [:filtro, 'segun'])
                  pExcluirCateRep = escapar_param(params, [:filtro, 'excluircaterep'])
                  lcat = Sivel2Gen::Categoria.habilitados.pluck(:id)
      Severity: Minor
      Found in lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb - About 1 hr to fix

        Function capaInfo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          capaInfo(des, hec, vic) {
            if (this.constructor.info != undefined) { // si ya tenía información se quita primero
              this.constructor.info.remove(this.constructor.mapa); 
            }
            this.constructor.info.onAdd = function (mapa) {
        Severity: Minor
        Found in app/javascript/controllers/mapaosm_controller.js - About 1 hr to fix

          Method personas_vista_geo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                    def personas_vista_geo(que3, tablas3, where3)
                      if (@pDepartamento == "1") 
                        que3 << ["departamento_nombre", "Departamento"]
                      end
                      if (@pMunicipio== "1") 
          Severity: Minor
          Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb - About 1 hr to fix

            Method remplazar_sivel2_gen has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                      def remplazar_sivel2_gen
                        @persona = Msip::Persona.find(params[:persona_id].to_i)
                        @caso = Sivel2Gen::Caso.find(params[:caso_id].to_i)
                        @caso.current_usuario = current_usuario
                        @vic_position = params[:vic_position].to_i
            Severity: Minor
            Found in lib/sivel2_gen/concerns/controllers/personas_controller.rb - About 1 hr to fix

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

                              when 'etnia'
                                ele[1].split(";").each do |etn|
                                  etnia = Msip::Etnia.where(nombre: etn)
                                  if etnia.count == 1
                                    vetn = Sivel2Gen::EtniaVictimacolectiva.new
              Severity: Major
              Found in lib/sivel2_gen/concerns/models/victimacolectiva.rb and 11 other locations - About 1 hr to fix
              lib/sivel2_gen/concerns/models/victima.rb on lines 498..508
              lib/sivel2_gen/concerns/models/victima.rb on lines 511..521
              lib/sivel2_gen/concerns/models/victima.rb on lines 537..547
              lib/sivel2_gen/concerns/models/victima.rb on lines 552..562
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 104..114
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 117..127
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 130..140
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 143..153
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 156..166
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 169..179
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 182..192

              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 49.

              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 12 locations. Consider refactoring.
              Open

                              when 'rangoedad'
                                ele[1].split(";").each do |ran|
                                  rangoedad = Sivel2Gen::Rangoedad.where(nombre: ran)
                                  if rangoedad.count == 1
                                    re = Sivel2Gen::RangoedadVictimacolectiva.new
              Severity: Major
              Found in lib/sivel2_gen/concerns/models/victimacolectiva.rb and 11 other locations - About 1 hr to fix
              lib/sivel2_gen/concerns/models/victima.rb on lines 498..508
              lib/sivel2_gen/concerns/models/victima.rb on lines 511..521
              lib/sivel2_gen/concerns/models/victima.rb on lines 537..547
              lib/sivel2_gen/concerns/models/victima.rb on lines 552..562
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 104..114
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 117..127
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 130..140
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 156..166
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 169..179
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 182..192
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 195..205

              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 49.

              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 12 locations. Consider refactoring.
              Open

                              when 'vinculoestado'
                                ele[1].split(";").each do |ves|
                                  vinculoe = Sivel2Gen::Vinculoestado.where(nombre: ves)
                                  if vinculoe.count == 1
                                    ve = Sivel2Gen::VictimacolectivaVinculoestado.new
              Severity: Major
              Found in lib/sivel2_gen/concerns/models/victimacolectiva.rb and 11 other locations - About 1 hr to fix
              lib/sivel2_gen/concerns/models/victima.rb on lines 498..508
              lib/sivel2_gen/concerns/models/victima.rb on lines 511..521
              lib/sivel2_gen/concerns/models/victima.rb on lines 537..547
              lib/sivel2_gen/concerns/models/victima.rb on lines 552..562
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 104..114
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 117..127
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 130..140
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 143..153
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 156..166
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 182..192
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 195..205

              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 49.

              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 12 locations. Consider refactoring.
              Open

                            when 'otraorga'
                              ele[1].split(";").each do |org|
                                organizacion = Sivel2Gen::Organizacion.where(nombre: org)
                                if organizacion.count == 1
                                  orgv = Sivel2Gen::OtraorgaVictima.new
              Severity: Major
              Found in lib/sivel2_gen/concerns/models/victima.rb and 11 other locations - About 1 hr to fix
              lib/sivel2_gen/concerns/models/victima.rb on lines 498..508
              lib/sivel2_gen/concerns/models/victima.rb on lines 537..547
              lib/sivel2_gen/concerns/models/victima.rb on lines 552..562
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 104..114
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 117..127
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 130..140
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 143..153
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 156..166
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 169..179
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 182..192
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 195..205

              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 49.

              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 12 locations. Consider refactoring.
              Open

                              when 'filiacion'
                                ele[1].split(";").each do |fil|
                                  filiacion = Sivel2Gen::Filiacion.where(nombre: fil)
                                  if filiacion.count == 1
                                    fv = Sivel2Gen::FiliacionVictimacolectiva.new
              Severity: Major
              Found in lib/sivel2_gen/concerns/models/victimacolectiva.rb and 11 other locations - About 1 hr to fix
              lib/sivel2_gen/concerns/models/victima.rb on lines 498..508
              lib/sivel2_gen/concerns/models/victima.rb on lines 511..521
              lib/sivel2_gen/concerns/models/victima.rb on lines 537..547
              lib/sivel2_gen/concerns/models/victima.rb on lines 552..562
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 117..127
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 130..140
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 143..153
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 156..166
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 169..179
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 182..192
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 195..205

              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 49.

              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 12 locations. Consider refactoring.
              Open

                              when 'profesion'
                                ele[1].split(";").each do |pro|
                                  profesion = Sivel2Gen::Profesion.where(nombre: pro)
                                  if profesion.count == 1
                                    pr = Sivel2Gen::ProfesionVictimacolectiva.new
              Severity: Major
              Found in lib/sivel2_gen/concerns/models/victimacolectiva.rb and 11 other locations - About 1 hr to fix
              lib/sivel2_gen/concerns/models/victima.rb on lines 498..508
              lib/sivel2_gen/concerns/models/victima.rb on lines 511..521
              lib/sivel2_gen/concerns/models/victima.rb on lines 537..547
              lib/sivel2_gen/concerns/models/victima.rb on lines 552..562
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 104..114
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 117..127
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 143..153
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 156..166
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 169..179
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 182..192
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 195..205

              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 49.

              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 12 locations. Consider refactoring.
              Open

                              when 'antecedente'
                                ele[1].split(";").each do |ant|
                                  antecedente = Sivel2Gen::Antecedente.where(nombre: ant)
                                  if antecedente.count == 1
                                    vant = Sivel2Gen::AntecedenteVictimacolectiva.new
              Severity: Major
              Found in lib/sivel2_gen/concerns/models/victimacolectiva.rb and 11 other locations - About 1 hr to fix
              lib/sivel2_gen/concerns/models/victima.rb on lines 498..508
              lib/sivel2_gen/concerns/models/victima.rb on lines 511..521
              lib/sivel2_gen/concerns/models/victima.rb on lines 537..547
              lib/sivel2_gen/concerns/models/victima.rb on lines 552..562
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 104..114
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 117..127
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 130..140
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 143..153
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 156..166
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 169..179
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 195..205

              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 49.

              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 12 locations. Consider refactoring.
              Open

                            when 'contexto'
                              ele[1].split(";").each do |cont|
                                contexto = Sivel2Gen::Contextovictima.where(nombre: cont)
                                if contexto.count == 1
                                  contv = Sivel2Gen::ContextovictimaVictima.new
              Severity: Major
              Found in lib/sivel2_gen/concerns/models/victima.rb and 11 other locations - About 1 hr to fix
              lib/sivel2_gen/concerns/models/victima.rb on lines 498..508
              lib/sivel2_gen/concerns/models/victima.rb on lines 511..521
              lib/sivel2_gen/concerns/models/victima.rb on lines 552..562
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 104..114
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 117..127
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 130..140
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 143..153
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 156..166
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 169..179
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 182..192
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 195..205

              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 49.

              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 12 locations. Consider refactoring.
              Open

                              when 'organizacion'
                                ele[1].split(";").each do |org|
                                  organizacion = Sivel2Gen::Organizacion.where(nombre: org)
                                  if organizacion.count == 1
                                    orgv = Sivel2Gen::OrganizacionVictimacolectiva.new
              Severity: Major
              Found in lib/sivel2_gen/concerns/models/victimacolectiva.rb and 11 other locations - About 1 hr to fix
              lib/sivel2_gen/concerns/models/victima.rb on lines 498..508
              lib/sivel2_gen/concerns/models/victima.rb on lines 511..521
              lib/sivel2_gen/concerns/models/victima.rb on lines 537..547
              lib/sivel2_gen/concerns/models/victima.rb on lines 552..562
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 104..114
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 130..140
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 143..153
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 156..166
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 169..179
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 182..192
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 195..205

              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 49.

              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 12 locations. Consider refactoring.
              Open

                            when 'antecedente'
                              ele[1].split(";").each do |ante|
                                antecedente = Sivel2Gen::Antecedente.where(nombre: ante)
                                if antecedente.count == 1
                                  antv = Sivel2Gen::AntecedenteVictima.new
              Severity: Major
              Found in lib/sivel2_gen/concerns/models/victima.rb and 11 other locations - About 1 hr to fix
              lib/sivel2_gen/concerns/models/victima.rb on lines 498..508
              lib/sivel2_gen/concerns/models/victima.rb on lines 511..521
              lib/sivel2_gen/concerns/models/victima.rb on lines 537..547
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 104..114
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 117..127
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 130..140
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 143..153
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 156..166
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 169..179
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 182..192
              lib/sivel2_gen/concerns/models/victimacolectiva.rb on lines 195..205

              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 49.

              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

              Severity
              Category
              Status
              Source
              Language