pasosdeJesus/sivel2_gen

View on GitHub

Showing 410 of 410 total issues

Method crea_consexpcaso has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def crea_consexpcaso(conscaso, ordenar_por = nil)
            if ARGV.include?("db:migrate")
              return
            end
            if !ActiveRecord::Base.connection.data_source_exists? 'sivel2_gen_conscaso'
Severity: Minor
Found in lib/sivel2_gen/concerns/models/consexpcaso.rb - About 25 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 connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  connect() {
    console.log("Conexion de controlador Mapa osm");
    const usuarioAutenticado = this.data.get("usuarioAutenticado") === 'true';
    if (!this.constructor.marcadores) {
      this.constructor.marcadores = L.markerClusterGroup();
Severity: Minor
Found in app/javascript/controllers/mapaosm_controller.js - About 25 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 refresca_conscaso has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def refresca_conscaso
            if ARGV.include?("db:migrate")
              return 'Ejecutando migración'
            end
            if !ActiveRecord::Base.connection.data_source_exists? 'sivel2_gen_conscaso'
Severity: Minor
Found in lib/sivel2_gen/concerns/models/conscaso.rb - About 25 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 2 locations. Consider refactoring.
Open

            @mapamun_subtitulo = Sivel2Gen::MapadepController.nomrango(
              pFini != '' ? 
              Msip::FormatoFechaHelper::reconoce_adivinando_locale(pFini) : 
              Sivel2Gen::Caso.all.minimum(:fecha), 
              pFfin != '' ? 
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/mapamun_controller.rb and 1 other location - About 25 mins to fix
lib/sivel2_gen/concerns/controllers/mapadep_controller.rb on lines 86..92

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

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

            @mapadep_subtitulo = Sivel2Gen::MapadepController.nomrango(
              pFini != '' ? 
              Msip::FormatoFechaHelper::reconoce_adivinando_locale(pFini) : 
              Sivel2Gen::Caso.all.minimum(:fecha), 
              pFfin != '' ? 
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/mapadep_controller.rb and 1 other location - About 25 mins to fix
lib/sivel2_gen/concerns/controllers/mapamun_controller.rb on lines 66..72

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

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 v['observaciones'].kind_of?(Array)
                  v['observaciones'].each do |ob|
                    ele = ob.split(/\_([^_]*)$/)
                    recorrer_observaciones_co(ele, menserror)
                  end
Severity: Minor
Found in lib/sivel2_gen/concerns/models/combatiente.rb and 1 other location - About 25 mins to fix
lib/sivel2_gen/concerns/models/victima.rb on lines 568..575

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

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

Method reportar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def reportar
            authorize! :read, Sivel2Gen::Caso
            @rango_fechas = 'Fecha del hecho'
            @titulo = 'Reporte de casos repetidos'
            @repetidos = []
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/buscarrepetidos_controller.rb - About 25 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 2 locations. Consider refactoring.
Open

            if v['observaciones'].kind_of?(Array)
              v['observaciones'].each do |ob|
                ele = ob.split(/\_([^_]*)$/)
                recorrer_observaciones_v(ele, menserror)
              end
Severity: Minor
Found in lib/sivel2_gen/concerns/models/victima.rb and 1 other location - About 25 mins to fix
lib/sivel2_gen/concerns/models/combatiente.rb on lines 176..183

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

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

Method gen_formato has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def gen_formato(formato)
            Consexpcaso.crea_consexpcaso(@conscaso, @campoord)
            if params[:filtro].nil? || params[:idplantilla].nil?
              head :no_content
            elsif params[:idplantilla].to_i <= 0
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 25 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 error_plantilla_no_autenticado has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def error_plantilla_no_autenticado
            redirect_back fallback_location: Rails.configuration.relative_url_root, flash:{ 
              error: "La generación de este reporte permite máximo "\
              "#{Rails.configuration.x.sivel2_consweb_max ?
              Rails.configuration.x.sivel2_consweb_max.to_s : '0' }"\
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 25 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 resolver_solicitud has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def resolver_solicitud
            if params[:solicitud_id]
              usuario = Msip::Usuario.find(current_usuario.id)
              solicitud = Msip::Solicitud.find(params[:solicitud_id])
              creado_por = Msip::Usuario.find(solicitud.usuario_id) 
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/casos_controller.rb - About 25 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 4 locations. Consider refactoring.
Open

            if (params[:filtro] && params[:filtro]['fechaini'] && 
                params[:filtro]['fechaini'] != "") 
              @fechaini = params[:filtro]['fechaini']
              where1 = personas_fecha_inicial(where1)
            end
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb and 3 other locations - About 20 mins to fix
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 382..386
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 387..391
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 576..580

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

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

            if (params[:filtro] && params[:filtro]['fechafin'] && 
                params[:filtro]['fechafin'] != "") 
              @fechafin = params[:filtro]['fechafin']
              where1 = personas_fecha_final(where1)
            end
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb and 3 other locations - About 20 mins to fix
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 382..386
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 387..391
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 571..575

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

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

            if (params[:filtro] && params[:filtro]['fechaini'] && 
                params[:filtro]['fechaini'] != "") 
              @fechaini = params[:filtro]['fechaini']
              where1 = personas_fecha_inicial(where1)
            end
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb and 3 other locations - About 20 mins to fix
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 387..391
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 571..575
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 576..580

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

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

            if (params[:filtro] && params[:filtro]['fechafin'] && 
                params[:filtro]['fechafin'] != "") 
              @fechafin = params[:filtro]['fechafin']
              where1 = personas_fecha_final(where1)
            end
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb and 3 other locations - About 20 mins to fix
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 382..386
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 571..575
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 576..580

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

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 (pExcluirCateRep == '1')
              cats_repetidas = Sivel2Gen::Categoria.habilitados.
                where(contadaen: nil).pluck(:id)
              where1 = ampliar_where_sinap(
                where1, 'categoria.id', "('" + 
lib/sivel2_gen/concerns/controllers/conteos_controller.rb on lines 833..838

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

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

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

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

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

Refactorings

Further Reading

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

  module Concerns
    module Models
      module DepartamentoRegion 
        extend ActiveSupport::Concern

Severity: Minor
Found in lib/sivel2_gen/concerns/models/departamento_region.rb and 1 other location - About 20 mins to fix
lib/sivel2_gen/concerns/models/municipio_region.rb on lines 3..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 27.

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

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

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

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

Refactorings

Further Reading

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

  module Concerns
    module Models
      module MunicipioRegion 
        extend ActiveSupport::Concern

Severity: Minor
Found in lib/sivel2_gen/concerns/models/municipio_region.rb and 1 other location - About 20 mins to fix
lib/sivel2_gen/concerns/models/departamento_region.rb on lines 3..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 27.

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 (pExcluirCateRep == '1')
              cats_repetidas = Sivel2Gen::Categoria.habilitados.
                where(contadaen: nil).pluck(:id)
              where1 = ampliar_where_sinap(
                where1, 'categoria.id', "('" + 
Severity: Minor
Found in lib/sivel2_gen/concerns/controllers/conteos_controller.rb and 1 other location - About 20 mins to fix
lib/sivel2_gen/concerns/controllers/graficar_conteo_controller.rb on lines 198..203

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

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

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

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

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

Refactorings

Further Reading

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

  module Concerns
    module Models
      module Estadocivil
        extend ActiveSupport::Concern

Severity: Minor
Found in lib/sivel2_gen/concerns/models/estadocivil.rb and 1 other location - About 15 mins to fix
lib/sivel2_gen/concerns/models/maternidad.rb on lines 3..12

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

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