ciudadanointeligente/partidopublico

View on GitHub

Showing 182 of 182 total issues

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

  def update
    respond_to do |format|
      if @requisito.update(requisito_params)
        format.html { redirect_to @requisito, notice: 'Requisito was successfully updated.' }
        format.json { render :show, status: :ok, location: @requisito }
Severity: Major
Found in app/controllers/requisitos_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/actividad_publicas_controller.rb on lines 43..50
app/controllers/acuerdos_controller.rb on lines 43..50
app/controllers/afiliacions_controller.rb on lines 59..66
app/controllers/balance_anuals_controller.rb on lines 59..66
app/controllers/circunscripcions_controller.rb on lines 43..50
app/controllers/contratacions_controller.rb on lines 57..64
app/controllers/distritos_controller.rb on lines 44..51
app/controllers/documentos_controller.rb on lines 43..50
app/controllers/egreso_campanas_controller.rb on lines 58..65
app/controllers/egreso_ordinarios_controller.rb on lines 53..60
app/controllers/eleccion_internas_controller.rb on lines 43..50
app/controllers/eleccion_populars_controller.rb on lines 43..50
app/controllers/ingreso_campanas_controller.rb on lines 58..65
app/controllers/ingreso_ordinarios_controller.rb on lines 52..59
app/controllers/leys_controller.rb on lines 43..50
app/controllers/marco_generals_controller.rb on lines 44..51
app/controllers/organo_internos_controller.rb on lines 47..54
app/controllers/procedimientos_controller.rb on lines 43..50
app/controllers/regions_controller.rb on lines 48..55
app/controllers/tramites_controller.rb on lines 43..50
app/controllers/transferencias_controller.rb on lines 57..64

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

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 update
    respond_to do |format|
      if @marco_general.update(marco_general_params)
        format.html { redirect_to @marco_general, notice: 'Marco general was successfully updated.' }
        format.json { render :show, status: :ok, location: @marco_general }
Severity: Major
Found in app/controllers/marco_generals_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/actividad_publicas_controller.rb on lines 43..50
app/controllers/acuerdos_controller.rb on lines 43..50
app/controllers/afiliacions_controller.rb on lines 59..66
app/controllers/balance_anuals_controller.rb on lines 59..66
app/controllers/circunscripcions_controller.rb on lines 43..50
app/controllers/contratacions_controller.rb on lines 57..64
app/controllers/distritos_controller.rb on lines 44..51
app/controllers/documentos_controller.rb on lines 43..50
app/controllers/egreso_campanas_controller.rb on lines 58..65
app/controllers/egreso_ordinarios_controller.rb on lines 53..60
app/controllers/eleccion_internas_controller.rb on lines 43..50
app/controllers/eleccion_populars_controller.rb on lines 43..50
app/controllers/ingreso_campanas_controller.rb on lines 58..65
app/controllers/ingreso_ordinarios_controller.rb on lines 52..59
app/controllers/leys_controller.rb on lines 43..50
app/controllers/organo_internos_controller.rb on lines 47..54
app/controllers/procedimientos_controller.rb on lines 43..50
app/controllers/regions_controller.rb on lines 48..55
app/controllers/requisitos_controller.rb on lines 43..50
app/controllers/tramites_controller.rb on lines 43..50
app/controllers/transferencias_controller.rb on lines 57..64

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

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 update
    respond_to do |format|
      if @eleccion_popular.update(eleccion_popular_params)
        format.html { redirect_to @eleccion_popular, notice: 'Eleccion popular was successfully updated.' }
        format.json { render :show, status: :ok, location: @eleccion_popular }
Severity: Major
Found in app/controllers/eleccion_populars_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/actividad_publicas_controller.rb on lines 43..50
app/controllers/acuerdos_controller.rb on lines 43..50
app/controllers/afiliacions_controller.rb on lines 59..66
app/controllers/balance_anuals_controller.rb on lines 59..66
app/controllers/circunscripcions_controller.rb on lines 43..50
app/controllers/contratacions_controller.rb on lines 57..64
app/controllers/distritos_controller.rb on lines 44..51
app/controllers/documentos_controller.rb on lines 43..50
app/controllers/egreso_campanas_controller.rb on lines 58..65
app/controllers/egreso_ordinarios_controller.rb on lines 53..60
app/controllers/eleccion_internas_controller.rb on lines 43..50
app/controllers/ingreso_campanas_controller.rb on lines 58..65
app/controllers/ingreso_ordinarios_controller.rb on lines 52..59
app/controllers/leys_controller.rb on lines 43..50
app/controllers/marco_generals_controller.rb on lines 44..51
app/controllers/organo_internos_controller.rb on lines 47..54
app/controllers/procedimientos_controller.rb on lines 43..50
app/controllers/regions_controller.rb on lines 48..55
app/controllers/requisitos_controller.rb on lines 43..50
app/controllers/tramites_controller.rb on lines 43..50
app/controllers/transferencias_controller.rb on lines 57..64

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

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 update
    respond_to do |format|
      if @egreso_ordinario.update(egreso_ordinario_params)
        format.html { redirect_to @egreso_ordinario, notice: 'Egreso ordinario was successfully updated.' }
        format.json { render :show, status: :ok, location: @egreso_ordinario }
Severity: Major
Found in app/controllers/egreso_ordinarios_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/actividad_publicas_controller.rb on lines 43..50
app/controllers/acuerdos_controller.rb on lines 43..50
app/controllers/afiliacions_controller.rb on lines 59..66
app/controllers/balance_anuals_controller.rb on lines 59..66
app/controllers/circunscripcions_controller.rb on lines 43..50
app/controllers/contratacions_controller.rb on lines 57..64
app/controllers/distritos_controller.rb on lines 44..51
app/controllers/documentos_controller.rb on lines 43..50
app/controllers/egreso_campanas_controller.rb on lines 58..65
app/controllers/eleccion_internas_controller.rb on lines 43..50
app/controllers/eleccion_populars_controller.rb on lines 43..50
app/controllers/ingreso_campanas_controller.rb on lines 58..65
app/controllers/ingreso_ordinarios_controller.rb on lines 52..59
app/controllers/leys_controller.rb on lines 43..50
app/controllers/marco_generals_controller.rb on lines 44..51
app/controllers/organo_internos_controller.rb on lines 47..54
app/controllers/procedimientos_controller.rb on lines 43..50
app/controllers/regions_controller.rb on lines 48..55
app/controllers/requisitos_controller.rb on lines 43..50
app/controllers/tramites_controller.rb on lines 43..50
app/controllers/transferencias_controller.rb on lines 57..64

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

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 update
    respond_to do |format|
      if @documento.update(documento_params)
        format.html { redirect_to @documento, notice: 'Documento was successfully updated.' }
        format.json { render :show, status: :ok, location: @documento }
Severity: Major
Found in app/controllers/documentos_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/actividad_publicas_controller.rb on lines 43..50
app/controllers/acuerdos_controller.rb on lines 43..50
app/controllers/afiliacions_controller.rb on lines 59..66
app/controllers/balance_anuals_controller.rb on lines 59..66
app/controllers/circunscripcions_controller.rb on lines 43..50
app/controllers/contratacions_controller.rb on lines 57..64
app/controllers/distritos_controller.rb on lines 44..51
app/controllers/egreso_campanas_controller.rb on lines 58..65
app/controllers/egreso_ordinarios_controller.rb on lines 53..60
app/controllers/eleccion_internas_controller.rb on lines 43..50
app/controllers/eleccion_populars_controller.rb on lines 43..50
app/controllers/ingreso_campanas_controller.rb on lines 58..65
app/controllers/ingreso_ordinarios_controller.rb on lines 52..59
app/controllers/leys_controller.rb on lines 43..50
app/controllers/marco_generals_controller.rb on lines 44..51
app/controllers/organo_internos_controller.rb on lines 47..54
app/controllers/procedimientos_controller.rb on lines 43..50
app/controllers/regions_controller.rb on lines 48..55
app/controllers/requisitos_controller.rb on lines 43..50
app/controllers/tramites_controller.rb on lines 43..50
app/controllers/transferencias_controller.rb on lines 57..64

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

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 update
    respond_to do |format|
      if @circunscripcion.update(circunscripcion_params)
        format.html { redirect_to @circunscripcion, notice: 'Circunscripcion was successfully updated.' }
        format.json { render :show, status: :ok, location: @circunscripcion }
Severity: Major
Found in app/controllers/circunscripcions_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/actividad_publicas_controller.rb on lines 43..50
app/controllers/acuerdos_controller.rb on lines 43..50
app/controllers/afiliacions_controller.rb on lines 59..66
app/controllers/balance_anuals_controller.rb on lines 59..66
app/controllers/contratacions_controller.rb on lines 57..64
app/controllers/distritos_controller.rb on lines 44..51
app/controllers/documentos_controller.rb on lines 43..50
app/controllers/egreso_campanas_controller.rb on lines 58..65
app/controllers/egreso_ordinarios_controller.rb on lines 53..60
app/controllers/eleccion_internas_controller.rb on lines 43..50
app/controllers/eleccion_populars_controller.rb on lines 43..50
app/controllers/ingreso_campanas_controller.rb on lines 58..65
app/controllers/ingreso_ordinarios_controller.rb on lines 52..59
app/controllers/leys_controller.rb on lines 43..50
app/controllers/marco_generals_controller.rb on lines 44..51
app/controllers/organo_internos_controller.rb on lines 47..54
app/controllers/procedimientos_controller.rb on lines 43..50
app/controllers/regions_controller.rb on lines 48..55
app/controllers/requisitos_controller.rb on lines 43..50
app/controllers/tramites_controller.rb on lines 43..50
app/controllers/transferencias_controller.rb on lines 57..64

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

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 update
    respond_to do |format|
      if @actividad_publica.update(actividad_publica_params)
        format.html { redirect_to @actividad_publica, notice: 'Actividad publica was successfully updated.' }
        format.json { render :show, status: :ok, location: @actividad_publica }
Severity: Major
Found in app/controllers/actividad_publicas_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/acuerdos_controller.rb on lines 43..50
app/controllers/afiliacions_controller.rb on lines 59..66
app/controllers/balance_anuals_controller.rb on lines 59..66
app/controllers/circunscripcions_controller.rb on lines 43..50
app/controllers/contratacions_controller.rb on lines 57..64
app/controllers/distritos_controller.rb on lines 44..51
app/controllers/documentos_controller.rb on lines 43..50
app/controllers/egreso_campanas_controller.rb on lines 58..65
app/controllers/egreso_ordinarios_controller.rb on lines 53..60
app/controllers/eleccion_internas_controller.rb on lines 43..50
app/controllers/eleccion_populars_controller.rb on lines 43..50
app/controllers/ingreso_campanas_controller.rb on lines 58..65
app/controllers/ingreso_ordinarios_controller.rb on lines 52..59
app/controllers/leys_controller.rb on lines 43..50
app/controllers/marco_generals_controller.rb on lines 44..51
app/controllers/organo_internos_controller.rb on lines 47..54
app/controllers/procedimientos_controller.rb on lines 43..50
app/controllers/regions_controller.rb on lines 48..55
app/controllers/requisitos_controller.rb on lines 43..50
app/controllers/tramites_controller.rb on lines 43..50
app/controllers/transferencias_controller.rb on lines 57..64

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

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 update
    respond_to do |format|
      if @egreso_campana.update(egreso_campana_params)
        format.html { redirect_to @egreso_campana, notice: 'Egreso campana was successfully updated.' }
        format.json { render :show, status: :ok, location: @egreso_campana }
Severity: Major
Found in app/controllers/egreso_campanas_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/actividad_publicas_controller.rb on lines 43..50
app/controllers/acuerdos_controller.rb on lines 43..50
app/controllers/afiliacions_controller.rb on lines 59..66
app/controllers/balance_anuals_controller.rb on lines 59..66
app/controllers/circunscripcions_controller.rb on lines 43..50
app/controllers/contratacions_controller.rb on lines 57..64
app/controllers/distritos_controller.rb on lines 44..51
app/controllers/documentos_controller.rb on lines 43..50
app/controllers/egreso_ordinarios_controller.rb on lines 53..60
app/controllers/eleccion_internas_controller.rb on lines 43..50
app/controllers/eleccion_populars_controller.rb on lines 43..50
app/controllers/ingreso_campanas_controller.rb on lines 58..65
app/controllers/ingreso_ordinarios_controller.rb on lines 52..59
app/controllers/leys_controller.rb on lines 43..50
app/controllers/marco_generals_controller.rb on lines 44..51
app/controllers/organo_internos_controller.rb on lines 47..54
app/controllers/procedimientos_controller.rb on lines 43..50
app/controllers/regions_controller.rb on lines 48..55
app/controllers/requisitos_controller.rb on lines 43..50
app/controllers/tramites_controller.rb on lines 43..50
app/controllers/transferencias_controller.rb on lines 57..64

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

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 update
    respond_to do |format|
      if @procedimiento.update(procedimiento_params)
        format.html { redirect_to @procedimiento, notice: 'Procedimiento was successfully updated.' }
        format.json { render :show, status: :ok, location: @procedimiento }
Severity: Major
Found in app/controllers/procedimientos_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/actividad_publicas_controller.rb on lines 43..50
app/controllers/acuerdos_controller.rb on lines 43..50
app/controllers/afiliacions_controller.rb on lines 59..66
app/controllers/balance_anuals_controller.rb on lines 59..66
app/controllers/circunscripcions_controller.rb on lines 43..50
app/controllers/contratacions_controller.rb on lines 57..64
app/controllers/distritos_controller.rb on lines 44..51
app/controllers/documentos_controller.rb on lines 43..50
app/controllers/egreso_campanas_controller.rb on lines 58..65
app/controllers/egreso_ordinarios_controller.rb on lines 53..60
app/controllers/eleccion_internas_controller.rb on lines 43..50
app/controllers/eleccion_populars_controller.rb on lines 43..50
app/controllers/ingreso_campanas_controller.rb on lines 58..65
app/controllers/ingreso_ordinarios_controller.rb on lines 52..59
app/controllers/leys_controller.rb on lines 43..50
app/controllers/marco_generals_controller.rb on lines 44..51
app/controllers/organo_internos_controller.rb on lines 47..54
app/controllers/regions_controller.rb on lines 48..55
app/controllers/requisitos_controller.rb on lines 43..50
app/controllers/tramites_controller.rb on lines 43..50
app/controllers/transferencias_controller.rb on lines 57..64

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

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 update
    respond_to do |format|
      if @balance_anual.update(balance_anual_params)
        format.html { redirect_to @balance_anual, notice: 'Balance anual was successfully updated.' }
        format.json { render :show, status: :ok, location: @balance_anual }
Severity: Major
Found in app/controllers/balance_anuals_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/actividad_publicas_controller.rb on lines 43..50
app/controllers/acuerdos_controller.rb on lines 43..50
app/controllers/afiliacions_controller.rb on lines 59..66
app/controllers/circunscripcions_controller.rb on lines 43..50
app/controllers/contratacions_controller.rb on lines 57..64
app/controllers/distritos_controller.rb on lines 44..51
app/controllers/documentos_controller.rb on lines 43..50
app/controllers/egreso_campanas_controller.rb on lines 58..65
app/controllers/egreso_ordinarios_controller.rb on lines 53..60
app/controllers/eleccion_internas_controller.rb on lines 43..50
app/controllers/eleccion_populars_controller.rb on lines 43..50
app/controllers/ingreso_campanas_controller.rb on lines 58..65
app/controllers/ingreso_ordinarios_controller.rb on lines 52..59
app/controllers/leys_controller.rb on lines 43..50
app/controllers/marco_generals_controller.rb on lines 44..51
app/controllers/organo_internos_controller.rb on lines 47..54
app/controllers/procedimientos_controller.rb on lines 43..50
app/controllers/regions_controller.rb on lines 48..55
app/controllers/requisitos_controller.rb on lines 43..50
app/controllers/tramites_controller.rb on lines 43..50
app/controllers/transferencias_controller.rb on lines 57..64

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

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 update
    respond_to do |format|
      if @distrito.update(distrito_params)
        format.html { redirect_to @distrito, notice: 'Distrito was successfully updated.' }
        format.json { render :show, status: :ok, location: @distrito }
Severity: Major
Found in app/controllers/distritos_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/actividad_publicas_controller.rb on lines 43..50
app/controllers/acuerdos_controller.rb on lines 43..50
app/controllers/afiliacions_controller.rb on lines 59..66
app/controllers/balance_anuals_controller.rb on lines 59..66
app/controllers/circunscripcions_controller.rb on lines 43..50
app/controllers/contratacions_controller.rb on lines 57..64
app/controllers/documentos_controller.rb on lines 43..50
app/controllers/egreso_campanas_controller.rb on lines 58..65
app/controllers/egreso_ordinarios_controller.rb on lines 53..60
app/controllers/eleccion_internas_controller.rb on lines 43..50
app/controllers/eleccion_populars_controller.rb on lines 43..50
app/controllers/ingreso_campanas_controller.rb on lines 58..65
app/controllers/ingreso_ordinarios_controller.rb on lines 52..59
app/controllers/leys_controller.rb on lines 43..50
app/controllers/marco_generals_controller.rb on lines 44..51
app/controllers/organo_internos_controller.rb on lines 47..54
app/controllers/procedimientos_controller.rb on lines 43..50
app/controllers/regions_controller.rb on lines 48..55
app/controllers/requisitos_controller.rb on lines 43..50
app/controllers/tramites_controller.rb on lines 43..50
app/controllers/transferencias_controller.rb on lines 57..64

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

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 update
    respond_to do |format|
      if @acuerdo.update(acuerdo_params)
        format.html { redirect_to @acuerdo, notice: 'Acuerdo was successfully updated.' }
        format.json { render :show, status: :ok, location: @acuerdo }
Severity: Major
Found in app/controllers/acuerdos_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/actividad_publicas_controller.rb on lines 43..50
app/controllers/afiliacions_controller.rb on lines 59..66
app/controllers/balance_anuals_controller.rb on lines 59..66
app/controllers/circunscripcions_controller.rb on lines 43..50
app/controllers/contratacions_controller.rb on lines 57..64
app/controllers/distritos_controller.rb on lines 44..51
app/controllers/documentos_controller.rb on lines 43..50
app/controllers/egreso_campanas_controller.rb on lines 58..65
app/controllers/egreso_ordinarios_controller.rb on lines 53..60
app/controllers/eleccion_internas_controller.rb on lines 43..50
app/controllers/eleccion_populars_controller.rb on lines 43..50
app/controllers/ingreso_campanas_controller.rb on lines 58..65
app/controllers/ingreso_ordinarios_controller.rb on lines 52..59
app/controllers/leys_controller.rb on lines 43..50
app/controllers/marco_generals_controller.rb on lines 44..51
app/controllers/organo_internos_controller.rb on lines 47..54
app/controllers/procedimientos_controller.rb on lines 43..50
app/controllers/regions_controller.rb on lines 48..55
app/controllers/requisitos_controller.rb on lines 43..50
app/controllers/tramites_controller.rb on lines 43..50
app/controllers/transferencias_controller.rb on lines 57..64

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

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 update
    respond_to do |format|
      if @transferencia.update(transferencia_params)
        format.html { redirect_to @transferencia, notice: 'Transferencia was successfully updated.' }
        format.json { render :show, status: :ok, location: @transferencia }
Severity: Major
Found in app/controllers/transferencias_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/actividad_publicas_controller.rb on lines 43..50
app/controllers/acuerdos_controller.rb on lines 43..50
app/controllers/afiliacions_controller.rb on lines 59..66
app/controllers/balance_anuals_controller.rb on lines 59..66
app/controllers/circunscripcions_controller.rb on lines 43..50
app/controllers/contratacions_controller.rb on lines 57..64
app/controllers/distritos_controller.rb on lines 44..51
app/controllers/documentos_controller.rb on lines 43..50
app/controllers/egreso_campanas_controller.rb on lines 58..65
app/controllers/egreso_ordinarios_controller.rb on lines 53..60
app/controllers/eleccion_internas_controller.rb on lines 43..50
app/controllers/eleccion_populars_controller.rb on lines 43..50
app/controllers/ingreso_campanas_controller.rb on lines 58..65
app/controllers/ingreso_ordinarios_controller.rb on lines 52..59
app/controllers/leys_controller.rb on lines 43..50
app/controllers/marco_generals_controller.rb on lines 44..51
app/controllers/organo_internos_controller.rb on lines 47..54
app/controllers/procedimientos_controller.rb on lines 43..50
app/controllers/regions_controller.rb on lines 48..55
app/controllers/requisitos_controller.rb on lines 43..50
app/controllers/tramites_controller.rb on lines 43..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 44.

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

Function sedesController has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function sedesController($scope,$http,$location,$aside,$attrs){
  $scope.sedes = [];
  $scope.partido_id = $location.path().split("/")[2];
  $scope.pageSize = 5;

Severity: Minor
Found in app/assets/javascripts/angular/angular_app.js - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function tipoCargosController has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function tipoCargosController($scope,$http,$location,$aside,$attrs){
  $scope.tipo_cargos = [];
  $scope.partido_id = $location.path().split("/")[2];

  function getTipoCargosByPartido(partido_id) {
Severity: Minor
Found in app/assets/javascripts/angular/angular_app.js - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function sector has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    function sector(cx, cy, r, startAngle, endAngle, params) {
Severity: Minor
Found in app/assets/javascripts/raphael_frontend.js - About 45 mins to fix

    Function cargosController has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function cargosController($scope,$http,$location,$aside,$attrs){
      $scope.cargos = [];
      $scope.personas = [];
      $scope.partido_id = $location.path().split("/")[2];
      $scope.pageSize = 5;
    Severity: Minor
    Found in app/assets/javascripts/angular/angular_app.js - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

        [[14,17],[18,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,59],[60,64],[65,69],[70,100]]
    Severity: Minor
    Found in app/helpers/comparisons_helper.rb and 1 other location - About 40 mins to fix
    app/controllers/partidos_controller.rb on lines 159..159

    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

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

        rangos = [[14,17],[18,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,59],[60,64],[65,69],[70,100]]
    Severity: Minor
    Found in app/controllers/partidos_controller.rb and 1 other location - About 40 mins to fix
    app/helpers/comparisons_helper.rb on lines 14..14

    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

    Function finanzas4Controller has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function finanzas4Controller($scope,$http,$location,$aside,$attrs){
    Severity: Minor
    Found in app/assets/javascripts/angular/angular_app.js - About 35 mins to fix
      Severity
      Category
      Status
      Source
      Language