nemesiscodex/openfonacide

View on GitHub

Showing 970 of 970 total issues

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

                if tipo is None or tipo == 'barrio':
                    cursor.execute(
                        base_query +
                        " WHERE inst.nombre_barrio_localidad like '%%" + escapelike(
                            query.upper()) + "%%' AND inst.periodo=%s",
Severity: Major
Found in openfonacide/views.py and 4 other locations - About 5 hrs to fix
openfonacide/views.py on lines 450..460
openfonacide/views.py on lines 463..473
openfonacide/views.py on lines 476..485
openfonacide/views.py on lines 488..497

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

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

   function changeData1(data){


    
    for(var i = 0; i < data.length; i++){
Severity: Major
Found in static/js/dncp/chart3.js and 1 other location - About 5 hrs to fix
static/js/dncp/chart4.js on lines 1..20

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

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

   function changeData(data){
    
    for(var i = 0; i < data.length; i++){
        if(data[i].hasOwnProperty("cantidad")){
            data[i]["value"] = data[i]["cantidad"];
Severity: Major
Found in static/js/dncp/chart4.js and 1 other location - About 5 hrs to fix
static/js/dncp/chart3.js on lines 1..28

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

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

File resumen.py has 397 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import json
from django.db import connection
from multiprocessing import Process, Queue
from django.http import JsonResponse

Severity: Minor
Found in openfonacide/resumen.py - About 5 hrs to fix

    File smartSteps.js has 393 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    
    /**
     * echarts 值轴分段刻度计算方法
     *
     * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。
    Severity: Minor
    Found in static/js/dncp/util/smartSteps.js - About 5 hrs to fix

      File ecEffect.js has 393 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * echarts图表特效基类
       *
       * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。
       * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
      Severity: Minor
      Found in static/js/dncp/util/ecEffect.js - About 5 hrs to fix

        File 0006_auto_20141130_2241.py has 392 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        from __future__ import unicode_literals
        
        from django.db import models, migrations
        
        
        Severity: Minor
        Found in openfonacide/migrations/0006_auto_20141130_2241.py - About 5 hrs to fix

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

              enable: {
                console: function() {
                  module.console(true);
                },
                debug: function(modules, modifyExisting) {
          Severity: Major
          Found in static/components/site.js and 1 other location - About 5 hrs to fix
          static/components/site.js on lines 204..218

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

          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

              disable: {
                console: function() {
                  module.console(false);
                },
                debug: function(modules, modifyExisting) {
          Severity: Major
          Found in static/components/site.js and 1 other location - About 5 hrs to fix
          static/components/site.js on lines 189..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 141.

          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

          File params.js has 387 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * 地图参数
           * key为地图类型: {
           *     getGeoJson: 地图数据加载
           * } 
          Severity: Minor
          Found in static/js/dncp/util/mapData/params.js - About 5 hrs to fix

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

            Severity: Major
            Found in openfonacide/migrations/0015_auto_20141213_1846.py and 2 other locations - About 5 hrs to fix
            openfonacide/migrations/0036_auto_20150405_0226.py on lines 0..23
            openfonacide/migrations/0043_auto_20150513_0321.py on lines 0..23

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

            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

            Severity: Major
            Found in openfonacide/migrations/0043_auto_20150513_0321.py and 2 other locations - About 5 hrs to fix
            openfonacide/migrations/0015_auto_20141213_1846.py on lines 0..23
            openfonacide/migrations/0036_auto_20150405_0226.py on lines 0..23

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

            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

            Severity: Major
            Found in openfonacide/migrations/0036_auto_20150405_0226.py and 2 other locations - About 5 hrs to fix
            openfonacide/migrations/0015_auto_20141213_1846.py on lines 0..23
            openfonacide/migrations/0043_auto_20150513_0321.py on lines 0..23

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

            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 (axis < len-1) {
                            if (range[2] > 0) {
                                for (var i = range[0]; i < range[1]; i += range[2]) {
                                    setPiece(axis+1,  offset + stride * i);
                                }
            Severity: Major
            Found in static/js/dncp/util/ndarray.js and 1 other location - About 5 hrs to fix
            static/js/dncp/util/ndarray.js on lines 1721..1745

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

            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 (axis < len-1) {
                            if (range[2] > 0) {
                                for (var i = range[0]; i < range[1]; i += range[2]) {
                                    getPiece(axis+1,  offset + stride * i);
                                }
            Severity: Major
            Found in static/js/dncp/util/ndarray.js and 1 other location - About 5 hrs to fix
            static/js/dncp/util/ndarray.js on lines 1799..1831

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

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

                    $scope.actualizarResumen = function(){
                      $scope.loading = true;
                      $scope.sin_datos = false;
                      var resumen = {};
                      resumen.anios = $scope.anioSelected;
            Severity: Major
            Found in static/js/frontend.ResumenController.js - About 5 hrs to fix

              Function loadLiquidFillGauge has 127 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function loadLiquidFillGauge(elementId, value, config) {
                  if(config == null) config = liquidFillGaugeDefaultSettings();
              
                  var gauge = d3.select("#" + elementId);
                  var radius = Math.min(parseInt(gauge.style("width")), parseInt(gauge.style("height")))/2;
              Severity: Major
              Found in static/js/liquidFillGauge.js - About 5 hrs to fix

                Function keydown has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          keydown: function(event) {
                            var
                              $currentlySelected = $item.not(className.filtered).filter('.' + className.selected).eq(0),
                              $activeItem        = $menu.children('.' + className.active).eq(0),
                              $selectedItem      = ($currentlySelected.length > 0)
                Severity: Major
                Found in static/components/dropdown.js - About 4 hrs to fix

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

                  def monto_adjudicaciones(filtro, opcion,  anio, ret):
                      query = ('SELECT  p.convocante, SUM(a.monto_total_adjudicado::float) monto_total '
                              'FROM openfonacide_adjudicacion a, openfonacide_planificacion p ' 
                              'WHERE a.id_llamado=p.id_llamado '
                              'AND p.etiquetas=\'fonacide\' AND  p.convocante  ' + opcion + 
                  Severity: Major
                  Found in openfonacide/infografiaDNCP.py and 2 other locations - About 4 hrs to fix
                  openfonacide/infografiaDNCP.py on lines 107..123
                  openfonacide/infografiaDNCP.py on lines 125..140

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

                  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

                  def procedimiento(filtro, opcion,  anio, ret):
                      query = ('SELECT  p.tipo_procedimiento, count(*) cantidad  '
                              'FROM  openfonacide_planificacion p '             
                              'WHERE p.etiquetas=\'fonacide\' AND  p.convocante  '+ opcion +
                              'AND anio=\''+ anio + '\' '
                  Severity: Major
                  Found in openfonacide/infografiaDNCP.py and 2 other locations - About 4 hrs to fix
                  openfonacide/infografiaDNCP.py on lines 87..104
                  openfonacide/infografiaDNCP.py on lines 125..140

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

                  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