pasosdeJesus/sivel2_gen

View on GitHub

Showing 380 of 380 total issues

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 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 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 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 '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 '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 '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 '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

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

                            when 'sectorsocial'
                              ele[1].split(";").each do |sec|
                                sectorsocial = Sivel2Gen::Sectorsocial.where(nombre: sec)
                                if sectorsocial.count == 1
                                  ss = Sivel2Gen::SectorsocialVictimacolectiva.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 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 '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 2 locations. Consider refactoring.
            Open

                      def interpreta_ordenar_por(campo)
                        critord = ""
                        case campo.to_s
                        when /^fechadesc/
                          critord = "conscaso.fecha desc"
            Severity: Major
            Found in lib/sivel2_gen/concerns/models/consexpcaso.rb and 1 other location - About 1 hr to fix
            lib/sivel2_gen/concerns/models/conscaso.rb on lines 343..362

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

                      def interpreta_ordenar_por(campo)
                        critord = ""
                        case campo.to_s
                        when /^fechadesc/
                          critord = "sivel2_gen_conscaso.fecha desc"
            Severity: Major
            Found in lib/sivel2_gen/concerns/models/conscaso.rb and 1 other location - About 1 hr to fix
            lib/sivel2_gen/concerns/models/consexpcaso.rb on lines 40..59

            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 'sectorsocialsec'
                            ele[1].split(";").each do |sec|
                              sectorsocial = Sivel2Gen::Sectorsocial.where(nombre: sec)
                              if sectorsocial.count == 1
                                ss = Sivel2Gen::SectorsocialsecVictima.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 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
            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 '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

            Method nueva has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                      def nueva
                        if params[:caso_id]
                          @casoetiqueta = Sivel2Gen::CasoEtiqueta.new
                          @casoetiqueta.caso_id = params[:caso_id]
                          @casoetiqueta.etiqueta_id = Msip::Etiqueta.count > 0 ? Msip::Etiqueta.take.id : 0
            Severity: Minor
            Found in lib/sivel2_gen/concerns/controllers/caso_etiquetas_controller.rb - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language