nemesiscodex/openfonacide

View on GitHub

Showing 350 of 970 total issues

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

        Function point has 112 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function point(zr, effectList, shape, zlevel) {
                var effect = shape.effect;
                var color = effect.color || shape.style.strokeColor || shape.style.color;
                var shadowColor = effect.shadowColor || color;
                var size = effect.scaleSize;
        Severity: Major
        Found in static/js/dncp/util/ecEffect.js - About 4 hrs to fix

          Function query_prioridad has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

          def query_prioridad(tipo, rango, ubicacion, estado, documentos, reportadas):
              begin_query = ('SELECT DISTINCT codigo_establecimiento FROM (')
              union = False
          
              query_estado = ''
          Severity: Minor
          Found in openfonacide/filtros.py - About 4 hrs 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

          File serializers.py has 346 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          from rest_framework import serializers
          
          from openfonacide.models import *
          from openfonacide.utils import conversion
          
          
          Severity: Minor
          Found in openfonacide/serializers.py - About 4 hrs to fix

            Function showInfoPopUp has 101 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                            $scope.showInfoPopUp = function (id, idInstitucion) {
                                //   $('#map').css('width', '100%');
                                $scope.establecimiento = id;
                                if (!$location.$$search.establecimiento) {
                                    sidebarInicialized = false;
            Severity: Major
            Found in static/js/frontend.MapController.js - About 4 hrs to fix

              Function do_import has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

              def do_import(lines_list=None, tipo=None):
                  header_flag = True
                  header = list()
                  reader = csv.reader(lines_list.splitlines())
                  for row in reader:
              Severity: Minor
              Found in openfonacide/management/commands/actualizar_datasets.py - About 3 hrs 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 insert has 97 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  insert : kwargs(function (obj, values, axis) {
                      var data = this._array;
                      var isObjScalar = false;
                      if (typeof(obj) === 'number') {
                          obj = [obj];
              Severity: Major
              Found in static/js/dncp/util/ndarray.js - About 3 hrs to fix

                Function beneficiarios_pedidos has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                Open

                def beneficiarios_pedidos(periodo, prioridades, ubicaciones, estados, dncp, ret):
                    union = False
                    cursor = connection.cursor()
                
                    estado = estados.get('estado')
                Severity: Minor
                Found in openfonacide/resumen.py - About 3 hrs 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 elegibles has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                Open

                def elegibles(periodo, prioridades, ubicaciones, estados, dncp, ret):
                    query = 'SELECT count(DISTINCT codigo_institucion) FROM ('
                    cursor = connection.cursor()
                    estado = estados.get('estado')
                    documentos = estados.get('informes')
                Severity: Minor
                Found in openfonacide/resumen.py - About 3 hrs 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 mapa has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function mapa (datos) {
                
                
                
                function changeData(data, tipo_abastecimiento){
                Severity: Major
                Found in static/js/agua.js - About 3 hrs to fix

                  Function changeTab has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          changeTab: function(tabPath) {
                            var
                              pushStateAvailable = (window.history && window.history.pushState),
                              shouldIgnoreLoad   = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
                              remoteContent      = (settings.auto || $.isPlainObject(settings.apiSettings) ),
                  Severity: Major
                  Found in static/components/tab.js - About 3 hrs to fix

                    Function hide has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                              hide: function(callback, $subMenu) {
                                var
                                  $currentMenu = $subMenu || $menu,
                                  duration = ($subMenu)
                                    ? (settings.duration * 0.9)
                    Severity: Major
                    Found in static/components/dropdown.js - About 3 hrs to fix

                      File models.py has 297 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # encoding: utf-8
                      """
                      OpenFonacide Models
                      Modelo de datos utilizado en OpenFonacide
                      """
                      Severity: Minor
                      Found in openfonacide/models.py - About 3 hrs to fix

                        Function _navigate has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            CBPGridGallery.prototype._navigate = function( dir ) {
                                if( this.isAnimating ) return;
                                if( dir === 'next' && this.current === this.itemsCount - 1 ||  dir === 'prev' && this.current === 0  ) {
                                    this._closeSlideshow();
                                    return;
                        Severity: Major
                        Found in static/js/cbpGridGallery.js - About 3 hrs to fix

                          Function get has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def get(self, request, *args, **kwargs):
                                  codigo_establecimiento = kwargs.get('codigo_establecimiento')
                                  query = request.GET.get('q')
                                  periodo = request.GET.get('periodo')
                                  offset = request.GET.get('offset')
                          Severity: Minor
                          Found in openfonacide/views.py - About 3 hrs 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 filtros has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def filtros(request):
                              prioridades = request.GET.get('prioridades')
                          
                              ubicacion = request.GET.get('ubicacion')
                              reportadas = request.GET.get('reportadas')
                          Severity: Minor
                          Found in openfonacide/filtros.py - About 3 hrs 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 _load has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                      _load = function() {
                                          if (!_loaded) {
                                              _loaded = TRUE;
                                              _options();
                                              $('a[rel*="address:"]').address();
                          Severity: Major
                          Found in static/js/jquery.address.js - About 3 hrs to fix

                            Function buildPath has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    buildPath : function (ctx, style) {
                                        var pointList = style.pointList;
                                        var len = pointList.length;
                                        if (len === 0) {
                                            return;
                            Severity: Major
                            Found in static/js/dncp/util/shape/Symbol.js - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language