ciudadanointeligente/partidopublico

View on GitHub

Showing 123 of 182 total issues

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

  def create
    PaperTrail.whodunnit = current_admin.email
    @cargo = Cargo.new(cargo_params)

    respond_to do |format|
Severity: Major
Found in app/controllers/cargos_controller.rb and 2 other locations - About 1 hr to fix
app/controllers/sedes_controller.rb on lines 29..39
app/controllers/tipo_cargos_controller.rb on lines 28..38

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

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

  def create
    PaperTrail.whodunnit = current_admin.email
    @sede = Sede.new(sede_params)

    respond_to do |format|
Severity: Major
Found in app/controllers/sedes_controller.rb and 2 other locations - About 1 hr to fix
app/controllers/cargos_controller.rb on lines 28..38
app/controllers/tipo_cargos_controller.rb on lines 28..38

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

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

  def create
    PaperTrail.whodunnit = current_admin.email
    @tipo_cargo = TipoCargo.new(tipo_cargo_params)

    respond_to do |format|
Severity: Major
Found in app/controllers/tipo_cargos_controller.rb and 2 other locations - About 1 hr to fix
app/controllers/cargos_controller.rb on lines 28..38
app/controllers/sedes_controller.rb on lines 29..39

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

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 aggregate_contrataciones
    datos_by_partido = Contratacion.where partido: @partido
    fechas_distintas = datos_by_partido.uniq.pluck(:fecha_datos)
    @datos = []
    fechas_distintas.each do |fecha|
Severity: Major
Found in app/controllers/contratacions_controller.rb and 1 other location - About 1 hr to fix
app/controllers/transferencias_controller.rb on lines 12..21

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 aggregate_transferencias
    datos_by_partido = Transferencia.where partido: @partido
    fechas_distintas = datos_by_partido.uniq.pluck(:fecha_datos)
    @datos = []
    fechas_distintas.each do |fecha|
Severity: Major
Found in app/controllers/transferencias_controller.rb and 1 other location - About 1 hr to fix
app/controllers/contratacions_controller.rb on lines 12..21

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

  def update
    PaperTrail.whodunnit = current_admin.email
    respond_to do |format|
      if @partido.update(partido_params)
        format.html { redirect_to @partido, notice: 'Partido was successfully updated.' }
Severity: Major
Found in app/controllers/partidos_controller.rb and 3 other locations - About 1 hr to fix
app/controllers/cargos_controller.rb on lines 45..53
app/controllers/sedes_controller.rb on lines 46..54
app/controllers/tipo_cargos_controller.rb on lines 45..53

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

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

  def update
    PaperTrail.whodunnit = current_admin.email
    respond_to do |format|
      if @sede.update(sede_params)
        format.html { redirect_to @sede, notice: 'Sede was successfully updated.' }
Severity: Major
Found in app/controllers/sedes_controller.rb and 3 other locations - About 1 hr to fix
app/controllers/cargos_controller.rb on lines 45..53
app/controllers/partidos_controller.rb on lines 125..133
app/controllers/tipo_cargos_controller.rb on lines 45..53

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

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

  def update
    PaperTrail.whodunnit = current_admin.email
    respond_to do |format|
      if @tipo_cargo.update(tipo_cargo_params)
        format.html { redirect_to @tipo_cargo, notice: 'Tipo cargo was successfully updated.' }
Severity: Major
Found in app/controllers/tipo_cargos_controller.rb and 3 other locations - About 1 hr to fix
app/controllers/cargos_controller.rb on lines 45..53
app/controllers/partidos_controller.rb on lines 125..133
app/controllers/sedes_controller.rb on lines 46..54

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

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

  def update
    PaperTrail.whodunnit = current_admin.email
    respond_to do |format|
      if @cargo.update(cargo_params)
        format.html { redirect_to @cargo, notice: 'Cargo was successfully updated.' }
Severity: Major
Found in app/controllers/cargos_controller.rb and 3 other locations - About 1 hr to fix
app/controllers/partidos_controller.rb on lines 125..133
app/controllers/sedes_controller.rb on lines 46..54
app/controllers/tipo_cargos_controller.rb on lines 45..53

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

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

  def create
    @actividad_publica = ActividadPublica.new(actividad_publica_params)

    respond_to do |format|
      if @actividad_publica.save
Severity: Major
Found in app/controllers/actividad_publicas_controller.rb and 21 other locations - About 1 hr to fix
app/controllers/acuerdos_controller.rb on lines 27..36
app/controllers/afiliacions_controller.rb on lines 43..52
app/controllers/balance_anuals_controller.rb on lines 43..52
app/controllers/circunscripcions_controller.rb on lines 27..36
app/controllers/contratacions_controller.rb on lines 41..50
app/controllers/distritos_controller.rb on lines 28..37
app/controllers/documentos_controller.rb on lines 27..36
app/controllers/egreso_campanas_controller.rb on lines 42..51
app/controllers/egreso_ordinarios_controller.rb on lines 37..46
app/controllers/eleccion_internas_controller.rb on lines 27..36
app/controllers/eleccion_populars_controller.rb on lines 27..36
app/controllers/ingreso_campanas_controller.rb on lines 42..51
app/controllers/ingreso_ordinarios_controller.rb on lines 36..45
app/controllers/leys_controller.rb on lines 27..36
app/controllers/marco_generals_controller.rb on lines 28..37
app/controllers/organo_internos_controller.rb on lines 31..40
app/controllers/procedimientos_controller.rb on lines 27..36
app/controllers/regions_controller.rb on lines 32..41
app/controllers/requisitos_controller.rb on lines 27..36
app/controllers/tramites_controller.rb on lines 27..36
app/controllers/transferencias_controller.rb on lines 41..50

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

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

  def create
    @organo_interno = OrganoInterno.new(organo_interno_params)

    respond_to do |format|
      if @organo_interno.save
Severity: Major
Found in app/controllers/organo_internos_controller.rb and 21 other locations - About 1 hr to fix
app/controllers/actividad_publicas_controller.rb on lines 27..36
app/controllers/acuerdos_controller.rb on lines 27..36
app/controllers/afiliacions_controller.rb on lines 43..52
app/controllers/balance_anuals_controller.rb on lines 43..52
app/controllers/circunscripcions_controller.rb on lines 27..36
app/controllers/contratacions_controller.rb on lines 41..50
app/controllers/distritos_controller.rb on lines 28..37
app/controllers/documentos_controller.rb on lines 27..36
app/controllers/egreso_campanas_controller.rb on lines 42..51
app/controllers/egreso_ordinarios_controller.rb on lines 37..46
app/controllers/eleccion_internas_controller.rb on lines 27..36
app/controllers/eleccion_populars_controller.rb on lines 27..36
app/controllers/ingreso_campanas_controller.rb on lines 42..51
app/controllers/ingreso_ordinarios_controller.rb on lines 36..45
app/controllers/leys_controller.rb on lines 27..36
app/controllers/marco_generals_controller.rb on lines 28..37
app/controllers/procedimientos_controller.rb on lines 27..36
app/controllers/regions_controller.rb on lines 32..41
app/controllers/requisitos_controller.rb on lines 27..36
app/controllers/tramites_controller.rb on lines 27..36
app/controllers/transferencias_controller.rb on lines 41..50

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

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

  def create
    @eleccion_interna = EleccionInterna.new(eleccion_interna_params)

    respond_to do |format|
      if @eleccion_interna.save
Severity: Major
Found in app/controllers/eleccion_internas_controller.rb and 21 other locations - About 1 hr to fix
app/controllers/actividad_publicas_controller.rb on lines 27..36
app/controllers/acuerdos_controller.rb on lines 27..36
app/controllers/afiliacions_controller.rb on lines 43..52
app/controllers/balance_anuals_controller.rb on lines 43..52
app/controllers/circunscripcions_controller.rb on lines 27..36
app/controllers/contratacions_controller.rb on lines 41..50
app/controllers/distritos_controller.rb on lines 28..37
app/controllers/documentos_controller.rb on lines 27..36
app/controllers/egreso_campanas_controller.rb on lines 42..51
app/controllers/egreso_ordinarios_controller.rb on lines 37..46
app/controllers/eleccion_populars_controller.rb on lines 27..36
app/controllers/ingreso_campanas_controller.rb on lines 42..51
app/controllers/ingreso_ordinarios_controller.rb on lines 36..45
app/controllers/leys_controller.rb on lines 27..36
app/controllers/marco_generals_controller.rb on lines 28..37
app/controllers/organo_internos_controller.rb on lines 31..40
app/controllers/procedimientos_controller.rb on lines 27..36
app/controllers/regions_controller.rb on lines 32..41
app/controllers/requisitos_controller.rb on lines 27..36
app/controllers/tramites_controller.rb on lines 27..36
app/controllers/transferencias_controller.rb on lines 41..50

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

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

  def create
    @ingreso_campana = IngresoCampana.new(ingreso_campana_params)

    respond_to do |format|
      if @ingreso_campana.save
Severity: Major
Found in app/controllers/ingreso_campanas_controller.rb and 21 other locations - About 1 hr to fix
app/controllers/actividad_publicas_controller.rb on lines 27..36
app/controllers/acuerdos_controller.rb on lines 27..36
app/controllers/afiliacions_controller.rb on lines 43..52
app/controllers/balance_anuals_controller.rb on lines 43..52
app/controllers/circunscripcions_controller.rb on lines 27..36
app/controllers/contratacions_controller.rb on lines 41..50
app/controllers/distritos_controller.rb on lines 28..37
app/controllers/documentos_controller.rb on lines 27..36
app/controllers/egreso_campanas_controller.rb on lines 42..51
app/controllers/egreso_ordinarios_controller.rb on lines 37..46
app/controllers/eleccion_internas_controller.rb on lines 27..36
app/controllers/eleccion_populars_controller.rb on lines 27..36
app/controllers/ingreso_ordinarios_controller.rb on lines 36..45
app/controllers/leys_controller.rb on lines 27..36
app/controllers/marco_generals_controller.rb on lines 28..37
app/controllers/organo_internos_controller.rb on lines 31..40
app/controllers/procedimientos_controller.rb on lines 27..36
app/controllers/regions_controller.rb on lines 32..41
app/controllers/requisitos_controller.rb on lines 27..36
app/controllers/tramites_controller.rb on lines 27..36
app/controllers/transferencias_controller.rb on lines 41..50

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

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

  def create
    @contratacion = Contratacion.new(contratacion_params)

    respond_to do |format|
      if @contratacion.save
Severity: Major
Found in app/controllers/contratacions_controller.rb and 21 other locations - About 1 hr to fix
app/controllers/actividad_publicas_controller.rb on lines 27..36
app/controllers/acuerdos_controller.rb on lines 27..36
app/controllers/afiliacions_controller.rb on lines 43..52
app/controllers/balance_anuals_controller.rb on lines 43..52
app/controllers/circunscripcions_controller.rb on lines 27..36
app/controllers/distritos_controller.rb on lines 28..37
app/controllers/documentos_controller.rb on lines 27..36
app/controllers/egreso_campanas_controller.rb on lines 42..51
app/controllers/egreso_ordinarios_controller.rb on lines 37..46
app/controllers/eleccion_internas_controller.rb on lines 27..36
app/controllers/eleccion_populars_controller.rb on lines 27..36
app/controllers/ingreso_campanas_controller.rb on lines 42..51
app/controllers/ingreso_ordinarios_controller.rb on lines 36..45
app/controllers/leys_controller.rb on lines 27..36
app/controllers/marco_generals_controller.rb on lines 28..37
app/controllers/organo_internos_controller.rb on lines 31..40
app/controllers/procedimientos_controller.rb on lines 27..36
app/controllers/regions_controller.rb on lines 32..41
app/controllers/requisitos_controller.rb on lines 27..36
app/controllers/tramites_controller.rb on lines 27..36
app/controllers/transferencias_controller.rb on lines 41..50

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

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

  def create
    @distrito = Distrito.new(distrito_params)

    respond_to do |format|
      if @distrito.save
Severity: Major
Found in app/controllers/distritos_controller.rb and 21 other locations - About 1 hr to fix
app/controllers/actividad_publicas_controller.rb on lines 27..36
app/controllers/acuerdos_controller.rb on lines 27..36
app/controllers/afiliacions_controller.rb on lines 43..52
app/controllers/balance_anuals_controller.rb on lines 43..52
app/controllers/circunscripcions_controller.rb on lines 27..36
app/controllers/contratacions_controller.rb on lines 41..50
app/controllers/documentos_controller.rb on lines 27..36
app/controllers/egreso_campanas_controller.rb on lines 42..51
app/controllers/egreso_ordinarios_controller.rb on lines 37..46
app/controllers/eleccion_internas_controller.rb on lines 27..36
app/controllers/eleccion_populars_controller.rb on lines 27..36
app/controllers/ingreso_campanas_controller.rb on lines 42..51
app/controllers/ingreso_ordinarios_controller.rb on lines 36..45
app/controllers/leys_controller.rb on lines 27..36
app/controllers/marco_generals_controller.rb on lines 28..37
app/controllers/organo_internos_controller.rb on lines 31..40
app/controllers/procedimientos_controller.rb on lines 27..36
app/controllers/regions_controller.rb on lines 32..41
app/controllers/requisitos_controller.rb on lines 27..36
app/controllers/tramites_controller.rb on lines 27..36
app/controllers/transferencias_controller.rb on lines 41..50

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

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

  def create
    @region = Region.new(region_params)

    respond_to do |format|
      if @region.save
Severity: Major
Found in app/controllers/regions_controller.rb and 21 other locations - About 1 hr to fix
app/controllers/actividad_publicas_controller.rb on lines 27..36
app/controllers/acuerdos_controller.rb on lines 27..36
app/controllers/afiliacions_controller.rb on lines 43..52
app/controllers/balance_anuals_controller.rb on lines 43..52
app/controllers/circunscripcions_controller.rb on lines 27..36
app/controllers/contratacions_controller.rb on lines 41..50
app/controllers/distritos_controller.rb on lines 28..37
app/controllers/documentos_controller.rb on lines 27..36
app/controllers/egreso_campanas_controller.rb on lines 42..51
app/controllers/egreso_ordinarios_controller.rb on lines 37..46
app/controllers/eleccion_internas_controller.rb on lines 27..36
app/controllers/eleccion_populars_controller.rb on lines 27..36
app/controllers/ingreso_campanas_controller.rb on lines 42..51
app/controllers/ingreso_ordinarios_controller.rb on lines 36..45
app/controllers/leys_controller.rb on lines 27..36
app/controllers/marco_generals_controller.rb on lines 28..37
app/controllers/organo_internos_controller.rb on lines 31..40
app/controllers/procedimientos_controller.rb on lines 27..36
app/controllers/requisitos_controller.rb on lines 27..36
app/controllers/tramites_controller.rb on lines 27..36
app/controllers/transferencias_controller.rb on lines 41..50

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

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 eliminar
    #array_fecha = params[:fecha_datos].split(' - ')
    fecha_eliminacion = Date.new(params[:fecha_datos].split("-")[0].to_i, params[:fecha_datos].split("-")[1].to_i, params[:fecha_datos].split("-")[2].to_i)
    datos_partido = EgresoOrdinario.where partido: @partido
    #datos_de_fecha = datos_partido.where fecha_datos: Date.new(array_fecha[0].to_i, array_fecha[1].to_i, 01)
Severity: Minor
Found in app/controllers/egreso_ordinarios_controller.rb and 1 other location - About 1 hr to fix
app/controllers/ingreso_ordinarios_controller.rb on lines 74..82

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

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

  def create
    @marco_general = MarcoGeneral.new(marco_general_params)

    respond_to do |format|
      if @marco_general.save
Severity: Major
Found in app/controllers/marco_generals_controller.rb and 21 other locations - About 1 hr to fix
app/controllers/actividad_publicas_controller.rb on lines 27..36
app/controllers/acuerdos_controller.rb on lines 27..36
app/controllers/afiliacions_controller.rb on lines 43..52
app/controllers/balance_anuals_controller.rb on lines 43..52
app/controllers/circunscripcions_controller.rb on lines 27..36
app/controllers/contratacions_controller.rb on lines 41..50
app/controllers/distritos_controller.rb on lines 28..37
app/controllers/documentos_controller.rb on lines 27..36
app/controllers/egreso_campanas_controller.rb on lines 42..51
app/controllers/egreso_ordinarios_controller.rb on lines 37..46
app/controllers/eleccion_internas_controller.rb on lines 27..36
app/controllers/eleccion_populars_controller.rb on lines 27..36
app/controllers/ingreso_campanas_controller.rb on lines 42..51
app/controllers/ingreso_ordinarios_controller.rb on lines 36..45
app/controllers/leys_controller.rb on lines 27..36
app/controllers/organo_internos_controller.rb on lines 31..40
app/controllers/procedimientos_controller.rb on lines 27..36
app/controllers/regions_controller.rb on lines 32..41
app/controllers/requisitos_controller.rb on lines 27..36
app/controllers/tramites_controller.rb on lines 27..36
app/controllers/transferencias_controller.rb on lines 41..50

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

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

  def create
    @tramite = Tramite.new(tramite_params)

    respond_to do |format|
      if @tramite.save
Severity: Major
Found in app/controllers/tramites_controller.rb and 21 other locations - About 1 hr to fix
app/controllers/actividad_publicas_controller.rb on lines 27..36
app/controllers/acuerdos_controller.rb on lines 27..36
app/controllers/afiliacions_controller.rb on lines 43..52
app/controllers/balance_anuals_controller.rb on lines 43..52
app/controllers/circunscripcions_controller.rb on lines 27..36
app/controllers/contratacions_controller.rb on lines 41..50
app/controllers/distritos_controller.rb on lines 28..37
app/controllers/documentos_controller.rb on lines 27..36
app/controllers/egreso_campanas_controller.rb on lines 42..51
app/controllers/egreso_ordinarios_controller.rb on lines 37..46
app/controllers/eleccion_internas_controller.rb on lines 27..36
app/controllers/eleccion_populars_controller.rb on lines 27..36
app/controllers/ingreso_campanas_controller.rb on lines 42..51
app/controllers/ingreso_ordinarios_controller.rb on lines 36..45
app/controllers/leys_controller.rb on lines 27..36
app/controllers/marco_generals_controller.rb on lines 28..37
app/controllers/organo_internos_controller.rb on lines 31..40
app/controllers/procedimientos_controller.rb on lines 27..36
app/controllers/regions_controller.rb on lines 32..41
app/controllers/requisitos_controller.rb on lines 27..36
app/controllers/transferencias_controller.rb on lines 41..50

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

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

  def create
    @afiliacion = Afiliacion.new(afiliacion_params)

    respond_to do |format|
      if @afiliacion.save
Severity: Major
Found in app/controllers/afiliacions_controller.rb and 21 other locations - About 1 hr to fix
app/controllers/actividad_publicas_controller.rb on lines 27..36
app/controllers/acuerdos_controller.rb on lines 27..36
app/controllers/balance_anuals_controller.rb on lines 43..52
app/controllers/circunscripcions_controller.rb on lines 27..36
app/controllers/contratacions_controller.rb on lines 41..50
app/controllers/distritos_controller.rb on lines 28..37
app/controllers/documentos_controller.rb on lines 27..36
app/controllers/egreso_campanas_controller.rb on lines 42..51
app/controllers/egreso_ordinarios_controller.rb on lines 37..46
app/controllers/eleccion_internas_controller.rb on lines 27..36
app/controllers/eleccion_populars_controller.rb on lines 27..36
app/controllers/ingreso_campanas_controller.rb on lines 42..51
app/controllers/ingreso_ordinarios_controller.rb on lines 36..45
app/controllers/leys_controller.rb on lines 27..36
app/controllers/marco_generals_controller.rb on lines 28..37
app/controllers/organo_internos_controller.rb on lines 31..40
app/controllers/procedimientos_controller.rb on lines 27..36
app/controllers/regions_controller.rb on lines 32..41
app/controllers/requisitos_controller.rb on lines 27..36
app/controllers/tramites_controller.rb on lines 27..36
app/controllers/transferencias_controller.rb on lines 41..50

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

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