pasosdeJesus/sivel2_gen

View on GitHub

Showing 410 of 410 total issues

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

    if (event.target.dataset['sivel2Gen-EdadTarget'] == 'edadactual') {
      this.edadTarget.value = null
      this.rangoedadTarget.value = null
    }
Severity: Major
Found in app/javascript/controllers/edad_controller.js and 2 other locations - About 55 mins to fix
app/javascript/controllers/edad_controller.js on lines 116..119
app/javascript/controllers/edad_controller.js on lines 120..123

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

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

    if (event.target.dataset['sivel2Gen-EdadTarget'] == 'edad') {
      this.rangoedadTarget.value = null
      this.edadactualTarget.value = null
    }
Severity: Major
Found in app/javascript/controllers/edad_controller.js and 2 other locations - About 55 mins to fix
app/javascript/controllers/edad_controller.js on lines 116..119
app/javascript/controllers/edad_controller.js on lines 124..127

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

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

    if (event.target.dataset['sivel2Gen-EdadTarget'] == 'rangoedad') {
      this.edadTarget.value = null
      this.edadactualTarget.value = null
    }
Severity: Major
Found in app/javascript/controllers/edad_controller.js and 2 other locations - About 55 mins to fix
app/javascript/controllers/edad_controller.js on lines 120..123
app/javascript/controllers/edad_controller.js on lines 124..127

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

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 poblacion_por_rango_sexo has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def poblacion_por_rango_sexo(caso_id, anio, mes, dia, modelorango, 
                                 rangoedadsexo, totsexo)
Severity: Major
Found in app/helpers/sivel2_gen/rangoedad_helper.rb - About 50 mins to fix

    Method poblacion_por_sexo_rango has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def poblacion_por_sexo_rango(caso_id, anio, mes, dia, modelorango, rangoedad, totsexo)
    Severity: Major
    Found in app/helpers/sivel2_gen/rangoedad_helper.rb - About 50 mins to fix

      Method importar_relato has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

                def self.importar_relato(doc, menserror, sintaxis_errores, mensexito, ids_importados,
                                         usuario_id, formato_sexo)
      Severity: Major
      Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 50 mins to fix

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

              if md && sinmun > 0
                if r4.include?(sinmun)
                  md['fill'] = color4
                elsif r3.include?(sinmun)
                  md['fill'] = color3
        Severity: Major
        Found in app/helpers/sivel2_gen/vista_helper.rb and 3 other locations - About 50 mins to fix
        app/helpers/sivel2_gen/vista_helper.rb on lines 233..245
        app/helpers/sivel2_gen/vista_helper.rb on lines 263..275
        app/helpers/sivel2_gen/vista_helper.rb on lines 489..501

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

        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

          module Admin
            class MaternidadesController < Msip::Admin::BasicasController
              before_action :set_maternidad, only: [:show, :edit, :update, :destroy]
              load_and_authorize_resource class: Sivel2Gen::Maternidad
        
        
        Severity: Minor
        Found in app/controllers/sivel2_gen/admin/maternidades_controller.rb and 1 other location - About 50 mins to fix
        app/controllers/sivel2_gen/admin/estadosciviles_controller.rb on lines 2..22

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

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

                if md && cant > 0
                  if r4.include?(cant)
                    md['fill'] = color4
                  elsif r3.include?(cant)
                    md['fill'] = color3
        Severity: Major
        Found in app/helpers/sivel2_gen/vista_helper.rb and 3 other locations - About 50 mins to fix
        app/helpers/sivel2_gen/vista_helper.rb on lines 263..275
        app/helpers/sivel2_gen/vista_helper.rb on lines 489..501
        app/helpers/sivel2_gen/vista_helper.rb on lines 519..531

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

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

                if md && cant > 0
                  if r4.include?(cant)
                    md['fill'] = color4
                  elsif r3.include?(cant)
                    md['fill'] = color3
        Severity: Major
        Found in app/helpers/sivel2_gen/vista_helper.rb and 3 other locations - About 50 mins to fix
        app/helpers/sivel2_gen/vista_helper.rb on lines 233..245
        app/helpers/sivel2_gen/vista_helper.rb on lines 263..275
        app/helpers/sivel2_gen/vista_helper.rb on lines 519..531

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

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

              if md && sindep > 0
                if r4.include?(sindep)
                  md['fill'] = color4
                elsif r3.include?(sindep)
                  md['fill'] = color3
        Severity: Major
        Found in app/helpers/sivel2_gen/vista_helper.rb and 3 other locations - About 50 mins to fix
        app/helpers/sivel2_gen/vista_helper.rb on lines 233..245
        app/helpers/sivel2_gen/vista_helper.rb on lines 489..501
        app/helpers/sivel2_gen/vista_helper.rb on lines 519..531

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

        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

          module Admin
            class EstadoscivilesController < Msip::Admin::BasicasController
              before_action :set_estadocivil, only: [:show, :edit, :update, :destroy]
              load_and_authorize_resource class: Sivel2Gen::Estadocivil
        
        
        Severity: Minor
        Found in app/controllers/sivel2_gen/admin/estadosciviles_controller.rb and 1 other location - About 50 mins to fix
        app/controllers/sivel2_gen/admin/maternidades_controller.rb on lines 2..22

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

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

                          genvic_tabla(
                            'Tortura', 
                            [
                              {"cat" => [22, 36],
                               "titulo" => "Victimizaciones por `Tortura´ por Abuso de Autoridad e Intolerancia Social por agentes directos o indirectos del Estado (Violaciones a los Derechos Humanos)."},
        Severity: Major
        Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb and 2 other locations - About 50 mins to fix
        lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 623..638
        lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 680..695

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

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

                    series_gen = graficar_sexo
                    sexos = Msip::Persona::sexo_opciones.to_h.invert
                    valores = ActiveRecord::Base.connection.execute(consulta_totsex).values.to_h
                    @valores_tot= valores.to_a.map{|k| [sexos[k[0].to_sym], k[1]]}.to_h
                    @opciones_tot = {
        app/controllers/sivel2_gen/fil23_gen/graficar_apexcharts_controller.rb on lines 162..170

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

        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[:buscarrepetido] && params[:buscarrepetido][:fechafin] &&
                       params[:buscarrepetido][:fechafin] != '')
                      pff = params[:buscarrepetido][:fechafin]
                      pffd = Msip::FormatoFechaHelper.fecha_local_estandar(pff)
                      rf += " AND c1.fecha <= '#{pffd}'" +
        lib/sivel2_gen/concerns/controllers/buscarrepetidos_controller.rb on lines 18..25

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

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

          module Admin
            class ContextosController < Msip::Admin::BasicasController
              before_action :set_contexto, only: [:show, :edit, :update, :destroy]
              load_and_authorize_resource class: Sivel2Gen::Contexto
          
        Severity: Major
        Found in app/controllers/sivel2_gen/admin/contextos_controller.rb and 2 other locations - About 50 mins to fix
        app/controllers/sivel2_gen/admin/antecedentes_controller.rb on lines 3..21
        app/controllers/sivel2_gen/admin/vinculosestado_controller.rb on lines 2..20

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

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

                          genvic_tabla(
                            'Amenazas', 
                            [
                              {"cat" => [25, 35],
                               "titulo" => "Victimizaciones por `Amenaza´ por Abuso de Autoridad e Intolerancia Social por agentes directos o indirectos del Estado (Violaciones a los Derechos Humanos)."},
        Severity: Major
        Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb and 2 other locations - About 50 mins to fix
        lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 663..678
        lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 680..695

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

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

          module Admin
            class AntecedentesController < Msip::Admin::BasicasController
              before_action :set_antecedente, only: [:show, :edit, :update, :destroy]
              load_and_authorize_resource class: Sivel2Gen::Antecedente
          
        Severity: Major
        Found in app/controllers/sivel2_gen/admin/antecedentes_controller.rb and 2 other locations - About 50 mins to fix
        app/controllers/sivel2_gen/admin/contextos_controller.rb on lines 2..20
        app/controllers/sivel2_gen/admin/vinculosestado_controller.rb on lines 2..20

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

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

                          genvic_tabla(
                            'Violencia sexual', 
                            [
                              {"cat" => [29, 39],
                               "titulo" => "Victimizaciones por `Violencia Sexual´ por móvil de Abuso de Autoridad o Intolerancia Social, perpetradas por agentes directos o indirectos del Estado (Violaciones a los Derechos Humanos)."},
        Severity: Major
        Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb and 2 other locations - About 50 mins to fix
        lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 623..638
        lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 663..678

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

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

                  series_gen = graficar_sexo
                  sexos = Msip::Persona::sexo_opciones.to_h.invert
                  valores = ActiveRecord::Base.connection.execute(consulta_totsex).values.to_h
                  @valores_tot= valores.to_a.map{|k| [sexos[k[0].to_sym], k[1]]}.to_h 
                  @opciones_tot = {
        app/controllers/sivel2_gen/fil23_gen/graficar_apexcharts_controller.rb on lines 99..107

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

        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