pasosdeJesus/siaddhh

View on GitHub

Showing 43 of 43 total issues

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

function actualizarTrazosPresentados(etiquetas) {
  var etiquetasP = []
  var i = 0
  trazosPresentados.forEach(function(t) {
    etiquetasP.push(t.name)
Severity: Major
Found in app/packs/plotly_actos.js and 1 other location - About 3 days to fix
app/javascript/plotly_actos.js on lines 73..143

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

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

function actualizarTrazosPresentados(etiquetas) {
  var etiquetasP = []
  var i = 0
  trazosPresentados.forEach(function(t) {
    etiquetasP.push(t.name)
Severity: Major
Found in app/javascript/plotly_actos.js and 1 other location - About 3 days to fix
app/packs/plotly_actos.js on lines 73..143

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

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

function recalcularSeriesPresentadas(fechaini, fechafin, etiquetas) {
  totalesEtiqueta = {}
  ejex= []
  seriesEjey = {}
  trazosPresentados = [] 
Severity: Major
Found in app/javascript/plotly_actos.js and 1 other location - About 1 day to fix
app/packs/plotly_actos.js on lines 150..176

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

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

function recalcularSeriesPresentadas(fechaini, fechafin, etiquetas) {
  totalesEtiqueta = {}
  ejex= []
  seriesEjey = {}
  trazosPresentados = [] 
Severity: Major
Found in app/packs/plotly_actos.js and 1 other location - About 1 day to fix
app/javascript/plotly_actos.js on lines 150..176

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

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

  filas.forEach(function(r) {
    dicEtiquetas[r[variable]] = 0
    if (typeof datosr[r.fecha] == 'undefined') {
      datosr[r.fecha] = {}
      if (typeof datosrFechamin == 'undefined' || r.fecha < datosrFechamin) {
Severity: Major
Found in app/javascript/plotly_actos.js and 1 other location - About 1 day to fix
app/packs/plotly_actos.js on lines 225..241

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

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

  filas.forEach(function(r) {
    dicEtiquetas[r[variable]] = 0
    if (typeof datosr[r.fecha] == 'undefined') {
      datosr[r.fecha] = {}
      if (typeof datosrFechamin == 'undefined' || r.fecha < datosrFechamin) {
Severity: Major
Found in app/packs/plotly_actos.js and 1 other location - About 1 day to fix
app/javascript/plotly_actos.js on lines 225..241

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

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 eliminar_casos has 146 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def eliminar_casos(subconsulta_ids_por_eliminar)
  ejecutar_sql("
  DELETE FROM sivel2_gen_caso_fuenteprensa WHERE 
    caso_id in (#{subconsulta_ids_por_eliminar});
              ")
Severity: Major
Found in scripts/auxiliar_eliminar.rb - About 5 hrs to fix

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

    function seleccionmOpcionesElegidas(selector) {
      var res = [];
      var opciones = selector && selector.options;
      var op;
    
    
    Severity: Major
    Found in app/packs/plotly_actos.js and 1 other location - About 4 hrs to fix
    app/javascript/plotly_actos.js on lines 197..210

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

    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

    function seleccionmAsignarOpciones(selector, opciones, seltodo = true) {
      for (var i = 0; i < opciones.length;  i++) {
        var opcionActual = document.createElement('option');
        if (seltodo) {
          opcionActual.selected = true;
    Severity: Major
    Found in app/javascript/plotly_actos.js and 1 other location - About 4 hrs to fix
    app/packs/plotly_actos.js on lines 183..193

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

    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

    function seleccionmAsignarOpciones(selector, opciones, seltodo = true) {
      for (var i = 0; i < opciones.length;  i++) {
        var opcionActual = document.createElement('option');
        if (seltodo) {
          opcionActual.selected = true;
    Severity: Major
    Found in app/packs/plotly_actos.js and 1 other location - About 4 hrs to fix
    app/javascript/plotly_actos.js on lines 183..193

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

    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

    function seleccionmOpcionesElegidas(selector) {
      var res = [];
      var opciones = selector && selector.options;
      var op;
    
    
    Severity: Major
    Found in app/javascript/plotly_actos.js and 1 other location - About 4 hrs to fix
    app/packs/plotly_actos.js on lines 197..210

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

    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 exports has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function(api) {
      var validEnv = ['development', 'test', 'production']
      var currentEnv = api.env()
      var isDevelopmentEnv = api.env('development')
      var isProductionEnv = api.env('production')
    Severity: Major
    Found in babel.config.js - About 2 hrs to fix

      Method arranca_ap_shiny has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def arranca_ap_shiny
            # Como una aplicación shiny puede responder a diversos usuarios
            # lo que hacemos por ahora es lanzar una que atienda a todos sobre
            # un proceso nuevo que no bloquee la aplicación rails.
            # Solo vuelve a iniciarse si un usuario solicita la gráfica
      Severity: Major
      Found in app/controllers/fil23_gen/graficar_r_controller.rb - About 2 hrs to fix

        Function actualizarTrazosPresentados has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function actualizarTrazosPresentados(etiquetas) {
          var etiquetasP = []
          var i = 0
          trazosPresentados.forEach(function(t) {
            etiquetasP.push(t.name)
        Severity: Major
        Found in app/javascript/plotly_actos.js - About 2 hrs to fix

          Function actualizarTrazosPresentados has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function actualizarTrazosPresentados(etiquetas) {
            var etiquetasP = []
            var i = 0
            trazosPresentados.forEach(function(t) {
              etiquetasP.push(t.name)
          Severity: Major
          Found in app/packs/plotly_actos.js - About 2 hrs to fix

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

                    if @victimacolectiva.save
                      respond_to do |format|
                        format.js { render json: {
                          'victimacolectiva' => @victimacolectiva.id.to_s,
                          'grupoper' => @grupoper.id.to_s,
            Severity: Major
            Found in app/controllers/sivel2_gen/victimascolectivas_controller.rb and 1 other location - About 2 hrs to fix
            app/controllers/sivel2_gen/victimas_controller.rb on lines 30..51

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

            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 @victima.save
                      respond_to do |format|
                        format.js { render json: {
                          'victima' => @victima.id.to_s,
                          'persona' => @persona.id.to_s,
            Severity: Major
            Found in app/controllers/sivel2_gen/victimas_controller.rb and 1 other location - About 2 hrs to fix
            app/controllers/sivel2_gen/victimascolectivas_controller.rb on lines 33..52

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

            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 procesar_datos has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function procesar_datos(filas, variable) {
            
              var contenedorFiltros = document.querySelector('.filtros'),
                selectorCategoria= contenedorFiltros.querySelector('#presponsable'),
                campoFechaini = contenedorFiltros.querySelector('#fechaini'),
            Severity: Major
            Found in app/javascript/plotly_actos.js - About 2 hrs to fix

              Function procesar_datos has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function procesar_datos(filas, variable) {
              
                var contenedorFiltros = document.querySelector('.filtros'),
                  selectorCategoria= contenedorFiltros.querySelector('#presponsable'),
                  campoFechaini = contenedorFiltros.querySelector('#fechaini'),
              Severity: Major
              Found in app/packs/plotly_actos.js - About 2 hrs to fix

                Method actos_individuales has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def actos_individuales
                      authorize! :contar, Sivel2Gen::Caso
                
                      @rutacsv = File.join(Rails.root, 'public/somosdefensores/siaddhh/csv/actos_individuales.csv').to_s
                
                
                Severity: Minor
                Found in app/controllers/fil23_gen/graficar_plotly_controller.rb - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language