pasosdeJesus/sivel2_gen

View on GitHub

Showing 380 of 380 total issues

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

          respond_to do |format|
            format.js { render text: @ubicacion.id.to_s }
            format.json { render json: @ubicacion.id.to_s, status: :created }
            format.html { render inline: @ubicacion.id.to_s }
Severity: Major
Found in app/controllers/sivel2_gen/ubicaciones_controller.rb and 3 other locations - About 30 mins to fix
app/controllers/sivel2_gen/ubicaciones_controller.rb on lines 35..38
lib/sivel2_gen/concerns/controllers/caso_etiquetas_controller.rb on lines 22..25
lib/sivel2_gen/concerns/controllers/presponsables_controller.rb on lines 59..62

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

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

                respond_to do |format|
                  format.js { render text: @casoetiqueta.id.to_s }
                  format.json { render json: @casoetiqueta.id.to_s, status: :created }
                  format.html { render inline: @casoetiqueta.id.to_s }
app/controllers/sivel2_gen/ubicaciones_controller.rb on lines 15..18
app/controllers/sivel2_gen/ubicaciones_controller.rb on lines 35..38
lib/sivel2_gen/concerns/controllers/presponsables_controller.rb on lines 59..62

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

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

        respond_to do |format|
          format.js { render text: @ubicacion.id.to_s }
          format.json { render json: @ubicacion.id.to_s, status: :updated }
          format.html { render inline: @ubicacion.id.to_s }
Severity: Major
Found in app/controllers/sivel2_gen/ubicaciones_controller.rb and 3 other locations - About 30 mins to fix
app/controllers/sivel2_gen/ubicaciones_controller.rb on lines 15..18
lib/sivel2_gen/concerns/controllers/caso_etiquetas_controller.rb on lines 22..25
lib/sivel2_gen/concerns/controllers/presponsables_controller.rb on lines 59..62

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

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

                respond_to do |format|
                  format.js { render text: @presponsable.id.to_s }
                  format.json { render json: @presponsable.id.to_s, status: :created }
                  format.html { render inline: @presponsable.id.to_s }
app/controllers/sivel2_gen/ubicaciones_controller.rb on lines 15..18
app/controllers/sivel2_gen/ubicaciones_controller.rb on lines 35..38
lib/sivel2_gen/concerns/controllers/caso_etiquetas_controller.rb on lines 22..25

Duplicated Code

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

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

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

Tuning

This issue has a mass of 33.

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

Avoid too many return statements within this method.
Open

              return
Severity: Major
Found in lib/sivel2_gen/concerns/controllers/actos_controller.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                      return
    Severity: Major
    Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return true
      Severity: Major
      Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                          return
        Severity: Major
        Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                            return
          Severity: Major
          Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                              return
            Severity: Major
            Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                return
              Severity: Major
              Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

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

                    if (edad > 0) {
                      this.edadTarget.value = edad;
                    } else {
                      this.edadTarget.value = 0;
                    }
                Severity: Minor
                Found in app/javascript/controllers/edad_controller.js and 1 other location - About 30 mins to fix
                app/javascript/controllers/edad_controller.js on lines 92..96

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

                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

                Avoid too many return statements within this method.
                Open

                                  return
                Severity: Major
                Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                    return
                  Severity: Major
                  Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                  return
                    Severity: Major
                    Found in lib/sivel2_gen/concerns/controllers/actos_controller.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                    return
                      Severity: Major
                      Found in lib/sivel2_gen/concerns/controllers/actoscolectivos_controller.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return mi + ai + " - " + mf + af
                        Severity: Major
                        Found in lib/sivel2_gen/concerns/controllers/mapadep_controller.rb - About 30 mins to fix

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

                                if (edadactual > 0 ) {
                                  this.edadactualTarget.value = edadactual;
                                } else {
                                  this.edadactualTarget.value = 0;
                                }
                          Severity: Minor
                          Found in app/javascript/controllers/edad_controller.js and 1 other location - About 30 mins to fix
                          app/javascript/controllers/edad_controller.js on lines 86..90

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

                          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

                          Avoid too many return statements within this method.
                          Open

                                            return
                          Severity: Major
                          Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 30 mins to fix

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

                                        que3.each do |t|
                                          if (t[1] != "") 
                                            gb += sep + i.to_s
                                            qc += t[0] + ", "
                                            sep = ", "
                            Severity: Minor
                            Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb and 2 other locations - About 30 mins to fix
                            lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 1046..1052
                            lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb on lines 432..438

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

                            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