pasosdeJesus/sivel2_gen

View on GitHub

Showing 380 of 380 total issues

Avoid deeply nested control flow statements.
Open

                      if victima_params[:id] != ""
                        vic = Sivel2Gen::Victima.find(victima_params[:id].to_i)
                      else
                        victima_params_filtrado = victima_params.deep_dup.tap do |params|
                          params[:persona_attributes].delete(:persona_trelacion1_attributes)
Severity: Major
Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 45 mins to fix

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

          if assets
            cont = assets.find_asset('svg/mapacalordep.svg').source.force_encoding("UTF-8")
          else
            rutas = Gem::Specification.stubs.map(&:full_gem_path)
            rs = rutas.select {|x| x.include?('sivel2_gen')}.first
    Severity: Minor
    Found in app/helpers/sivel2_gen/vista_helper.rb and 1 other location - About 45 mins to fix
    app/helpers/sivel2_gen/vista_helper.rb on lines 344..351

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

    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

                if r[:nomfiltro] == :aniosnac
                  where1 += (where1 != '' ? ' AND ' : '') + 
                    "(persona.anionac IS NULL OR persona.anionac IN ('" +
                    ids.sort.join("', '") + "'))"
                else
    lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 168..175

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

    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

                    elsif r[:nomfiltro] == :aniosnac
                      where1 += (where1 != '' ? ' AND ' : '') + 
                        "(persona.anionac IS NULL OR persona.anionac IN ('" +
                        ids.sort.join("', '") + "'))"
                    else
    Severity: Minor
    Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb and 1 other location - About 45 mins to fix
    lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb on lines 132..139

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

    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 consulta_final(i, que3, tablas3, where3, qc, gb)
                @coltotales = [i-1]
                que3 << ["", "Víctimas"]
                twhere3 = where3 == "" ? "" : "WHERE " + where3
                q3="SELECT #{qc}
    lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 328..338

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

    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 personas_consulta_final(i, que3, tablas3, where3, qc, gb)
                @coltotales = [i-1]
                que3 << ["", "Víctimas"]
                twhere3 = where3 == "" ? "" : "WHERE " + where3
                q3="SELECT #{qc}
    Severity: Minor
    Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb and 1 other location - About 45 mins to fix
    lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb on lines 331..341

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

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

      module Admin
        class ProfesionesController < Msip::Admin::BasicasController
          before_action :set_profesion, only: [:show, :edit, :update, :destroy]
          load_and_authorize_resource class: Sivel2Gen::Profesion
      
    Severity: Major
    Found in app/controllers/sivel2_gen/admin/profesiones_controller.rb and 4 other locations - About 40 mins to fix
    app/controllers/sivel2_gen/admin/actividadoficios_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/filiaciones_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/fronteras_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/organizaciones_controller.rb on lines 2..16

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

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

      module Admin
        class FronterasController < Msip::Admin::BasicasController
          before_action :set_frontera, only: [:show, :edit, :update, :destroy]
          load_and_authorize_resource class: Sivel2Gen::Frontera
      
    Severity: Major
    Found in app/controllers/sivel2_gen/admin/fronteras_controller.rb and 4 other locations - About 40 mins to fix
    app/controllers/sivel2_gen/admin/actividadoficios_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/filiaciones_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/organizaciones_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/profesiones_controller.rb on lines 2..16

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

    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

                          tip += catsinv.inject("") {|memo, r| 
                           (memo == "" ? "" : memo + ", ") + 
                             r.supracategoria.tviolencia_id + ':' +
                             r.supracategoria.codigo.to_s + ':' +
                             r.id.to_s + ' ' + r.nombre}
    Severity: Minor
    Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb and 1 other location - About 40 mins to fix
    lib/sivel2_gen/concerns/controllers/casos_controller.rb on lines 384..389

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

    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 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 and 1 other location - About 40 mins to fix
    lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb on lines 298..327

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

    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 vista_geo(que3, tablas3, where3)
                if (@pDepartamento == "1") 
                  que3 << ["departamento_nombre", "Departamento"]
                end
                if (@pMunicipio== "1") 
    lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 295..324

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

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

      module Admin
        class FiliacionesController < Msip::Admin::BasicasController
          before_action :set_filiacion, only: [:show, :edit, :update, :destroy]
          load_and_authorize_resource class: Sivel2Gen::Filiacion
      
    Severity: Major
    Found in app/controllers/sivel2_gen/admin/filiaciones_controller.rb and 4 other locations - About 40 mins to fix
    app/controllers/sivel2_gen/admin/actividadoficios_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/fronteras_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/organizaciones_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/profesiones_controller.rb on lines 2..16

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

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

      module Admin
        class ActividadoficiosController < Msip::Admin::BasicasController
          before_action :set_actividadoficio, only: [:show, :edit, :update, :destroy]
          load_and_authorize_resource class: Sivel2Gen::Actividadoficio
      
    app/controllers/sivel2_gen/admin/filiaciones_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/fronteras_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/organizaciones_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/profesiones_controller.rb on lines 2..16

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

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

      module Admin
        class OrganizacionesController < Msip::Admin::BasicasController
          before_action :set_organizacion, only: [:show, :edit, :update, :destroy]
          load_and_authorize_resource class: Sivel2Gen::Organizacion
      
    Severity: Major
    Found in app/controllers/sivel2_gen/admin/organizaciones_controller.rb and 4 other locations - About 40 mins to fix
    app/controllers/sivel2_gen/admin/actividadoficios_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/filiaciones_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/fronteras_controller.rb on lines 2..16
    app/controllers/sivel2_gen/admin/profesiones_controller.rb on lines 2..16

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

    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

                            tip += catcol.inject("") {|memo, r| 
                             (memo == "" ? "" : memo + ", ") + 
                             r.supracategoria.tviolencia_id + ':' +
                             r.supracategoria.codigo.to_s + ':' +
                             r.id.to_s + ' ' + r.nombre} 
    Severity: Minor
    Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb and 1 other location - About 40 mins to fix
    lib/sivel2_gen/concerns/controllers/casos_controller.rb on lines 397..402

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

    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

    Consider simplifying this complex logical expression.
    Open

            if cr >= 0 && cr <= 255 && cv >= 0 && cv <= 255 && ca <= 0 && ca <= 255
              cr = crt
              cv = cvt
              ca = cat
            end
    Severity: Major
    Found in app/helpers/sivel2_gen/vista_helper.rb - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if cr >= 0 && cr <= 255 && cv >= 0 && cv <= 255 && ca <= 0 && ca <= 255
                cr = crt
                cv = cvt
                ca = cat
              end
      Severity: Major
      Found in app/helpers/sivel2_gen/vista_helper.rb - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                if mesnac > mes || (dianac && dianac > 0 && dia && dia > 0 && 
                    dianac > dia)
                  na -= 1
                end
        Severity: Major
        Found in app/helpers/sivel2_gen/rangoedad_helper.rb - About 40 mins to fix

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

            module Concerns
              module Models
                module Sectorsocial
                  extend ActiveSupport::Concern
          
          
          Severity: Minor
          Found in lib/sivel2_gen/concerns/models/sectorsocial.rb and 1 other location - About 40 mins to fix
          lib/sivel2_gen/concerns/models/profesion.rb on lines 3..16

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

          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 Concerns
              module Models
                module Profesion
                  extend ActiveSupport::Concern
          
          
          Severity: Minor
          Found in lib/sivel2_gen/concerns/models/profesion.rb and 1 other location - About 40 mins to fix
          lib/sivel2_gen/concerns/models/sectorsocial.rb on lines 3..18

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 37.

          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