pasosdeJesus/cor1440_gen

View on GitHub

Showing 234 of 234 total issues

Method descripciones_datos_intermedios has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def descripciones_datos_intermedios(mindicadorpf)
            if mindicadorpf.datointermedioti
              mindicadorpf.datointermedioti.pluck(:nombre)
            else
              if mindicadorpf.indicadorpf.tipoindicador.nil? ||
Severity: Minor
Found in lib/cor1440_gen/concerns/controllers/mindicadorespf_controller.rb - About 35 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

Method eval has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def eval(contexto, menserror = "".dup)
        unless contexto
          STDERR.puts "** No se definió contexto"
          return nil
        end
Severity: Minor
Found in app/helpers/cor1440_gen/medicion_helper.rb - About 35 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

Method genera_dicc_poblacion_de_asistentes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def genera_dicc_poblacion_de_asistentes(a)
      personas = {}
      a.asistencia.each do |asist|
        if !asist.persona
          merr = "Persona en NULL en asistencia #{asist.id} "\
Severity: Minor
Found in app/helpers/cor1440_gen/conteos_helper.rb - About 35 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

Method new has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def new
            if params[:proyectofinanciero_id]
              @resultadopf = Resultadopf.new
              @resultadopf.proyectofinanciero_id = params[:proyectofinanciero_id]
              @resultadopf.numero = "R"
Severity: Minor
Found in lib/cor1440_gen/concerns/controllers/resultadospf_controller.rb - About 35 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

Method new has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def new
            if params[:proyectofinanciero_id]
              @actividadpf = Actividadpf.new
              @actividadpf.proyectofinanciero_id = params[:proyectofinanciero_id]
              @actividadpf.nombrecorto = "R"
Severity: Minor
Found in lib/cor1440_gen/concerns/controllers/actividadespf_controller.rb - About 35 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

Method new has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def new
            if params[:proyectofinanciero_id]
              @objetivopf = Objetivopf.new
              @objetivopf.proyectofinanciero_id = params[:proyectofinanciero_id]
              @objetivopf.numero = "O"
Severity: Minor
Found in lib/cor1440_gen/concerns/controllers/objetivospf_controller.rb - About 35 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

Method new has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def new
            if params[:tipoindicador_id]
              @campotind = Campotind.new
              @campotind.tipoindicador_id = params[:tipoindicador_id]
              @campotind.nombrecampo = "N"
Severity: Minor
Found in lib/cor1440_gen/concerns/controllers/campostind_controller.rb - About 35 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

Method validar_registro has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def validar_registro(registro, detalle)
            detalleini = detalle.clone
            if !registro.fechainicio &&
                Cor1440Gen::ApplicationHelper::ESTADOS_APROBADO.include?(registro.estado)
              detalle << "No tiene fecha de inicio"
Severity: Minor
Found in lib/cor1440_gen/concerns/controllers/proyectosfinancieros_controller.rb - About 35 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

Method new has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def new
            if params[:proyectofinanciero_id]
              @indicadorpf = Indicadorpf.new
              @indicadorpf.proyectofinanciero_id = params[:proyectofinanciero_id]
              @indicadorpf.numero = "R"
Severity: Minor
Found in lib/cor1440_gen/concerns/controllers/indicadorespf_controller.rb - About 35 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

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

              Cor1440Gen::Indicadorpf.where(
                proyectofinanciero_id: p.id, objetivopf_id: ob.id,
              )
                .each do |ind|
                nind = ind.dup
lib/cor1440_gen/concerns/controllers/proyectosfinancieros_controller.rb on lines 270..280
lib/cor1440_gen/concerns/controllers/proyectosfinancieros_controller.rb on lines 282..292

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if params && params[:validarpf] &&
                params[:validarpf][:fechaini] &&
                params[:validarpf][:fechaini] != ""
              @validarpf.fechaini = params[:validarpf][:fechaini]
              @registro = @registro.where(
lib/cor1440_gen/concerns/controllers/proyectosfinancieros_controller.rb on lines 358..366

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if params && params[:validarpf] &&
                params[:validarpf][:fechafin] &&
                params[:validarpf][:fechafin] != ""
              @validarpf.fechafin = params[:validarpf][:fechafin]
              @registro = @registro.where(
lib/cor1440_gen/concerns/controllers/proyectosfinancieros_controller.rb on lines 349..357

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

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

                Cor1440Gen::Actividadpf.where(
                  proyectofinanciero_id: p.id, resultadopf_id: res.id,
                )
                  .each do |act|
                  nact = act.dup
lib/cor1440_gen/concerns/controllers/proyectosfinancieros_controller.rb on lines 247..257
lib/cor1440_gen/concerns/controllers/proyectosfinancieros_controller.rb on lines 270..280

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

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

                Cor1440Gen::Indicadorpf.where(
                  proyectofinanciero_id: p.id, resultadopf_id: res.id,
                )
                  .each do |ind|
                  nind = ind.dup
lib/cor1440_gen/concerns/controllers/proyectosfinancieros_controller.rb on lines 247..257
lib/cor1440_gen/concerns/controllers/proyectosfinancieros_controller.rb on lines 282..292

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

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

                pob = actividad.actividad_rangoedadac.map do |i|
                  (i.ml ? i.ml : 0) + (i.mr ? i.mr : 0) +
                    (i.fl ? i.fl : 0) + (i.fr ? i.fr : 0)
Severity: Minor
Found in lib/cor1440_gen/concerns/controllers/informes_controller.rb and 1 other location - About 30 mins to fix
lib/cor1440_gen/concerns/controllers/informes_controller.rb on lines 78..80

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

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

        if a.actividad_rangoedadac &&
            a.actividad_rangoedadac.where(rangoedadac_id: re.id).count > 0
          are = a.actividad_rangoedadac.where(rangoedadac_id: re.id).take
          tm = are.mr
          tf = are.fr
Severity: Minor
Found in app/helpers/cor1440_gen/conteos_helper.rb and 1 other location - About 30 mins to fix
app/helpers/cor1440_gen/conteos_helper.rb on lines 165..171

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

              par[0].constantize.where(proyectofinanciero_id: p.id)
                .each do |tr|
                ntr = tr.dup
                ntr.proyectofinanciero_id = @registro.id
                unless ntr.save
lib/cor1440_gen/concerns/controllers/actividades_controller.rb on lines 192..198

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

                  pob = ac.actividad_rangoedadac.map do |i|
                    (i.ml ? i.ml : 0) + (i.mr ? i.mr : 0) +
                      (i.fl ? i.fl : 0) + (i.fr ? i.fr : 0)
Severity: Minor
Found in lib/cor1440_gen/concerns/controllers/informes_controller.rb and 1 other location - About 30 mins to fix
lib/cor1440_gen/concerns/controllers/informes_controller.rb on lines 162..164

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

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

        if a.actividad_rangoedadac &&
            a.actividad_rangoedadac.where(rangoedadac_id: re.id).count > 0
          are = a.actividad_rangoedadac.where(rangoedadac_id: re.id).take
          tm = are.mr
          tf = are.fr
Severity: Minor
Found in app/helpers/cor1440_gen/conteos_helper.rb and 1 other location - About 30 mins to fix
app/helpers/cor1440_gen/conteos_helper.rb on lines 75..81

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

              par[0].constantize.where(actividad_id: a.id).each do |tr|
                ntr = tr.dup
                ntr.actividad_id = @registro.id
                unless ntr.save
                  render(inline: "No pudo salvar copia de #{par[1]}")
Severity: Minor
Found in lib/cor1440_gen/concerns/controllers/actividades_controller.rb and 1 other location - About 30 mins to fix
lib/cor1440_gen/concerns/controllers/proyectosfinancieros_controller.rb on lines 229..236

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

Severity
Category
Status
Source
Language