nemesiscodex/openfonacide

View on GitHub

Showing 350 of 970 total issues

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

          show: function(callback, $subMenu) {
            var
              $currentMenu = $subMenu || $menu,
              start = ($subMenu)
                ? function() {}
Severity: Major
Found in static/components/dropdown.js - About 3 hrs to fix

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

            stick: function(scroll) {
              var
                cachedPosition = scroll || $scroll.scrollTop(),
                cache          = module.cache,
                fits           = cache.fits,
    Severity: Major
    Found in static/components/sticky.js - About 3 hrs to fix

      Function handleKeyboard has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              handleKeyboard: function(event) {
                var
                  // force selector refresh
                  $result      = $module.find(selector.result),
                  $category    = $module.find(selector.category),
      Severity: Major
      Found in static/components/search.js - About 3 hrs to fix

        Function estado_de_obra has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        def estado_de_obra(request):
            if request.method != 'POST':
                return JsonResponse({'error': 'Método inválido.'}, status=405)
        
            estado = request.POST.get('estado')
        Severity: Minor
        Found in openfonacide/views.py - About 2 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 _albers has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function _albers() {
                var radians = Math.PI / 180;
                var origin = [0, 0];            //[-98, 38],
                var parallels = [29.5, 45.5];
                var scale = 1000;
        Severity: Major
        Found in static/js/dncp/util/projection/albers.js - About 2 hrs to fix

          Function query has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  query: function() {
          
                    if(module.is.disabled()) {
                      module.debug('Element is disabled API request aborted');
                      return;
          Severity: Major
          Found in static/components/api.js - About 2 hrs to fix

            Function grafica1 has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

               function grafica1( cantidades, nombres, anio, opcion,url) {
            
                // configure for module loader
                    require.config({
                        paths: {
            Severity: Major
            Found in static/js/dncp/chart1.js - About 2 hrs to fix

              Function get_options_bar has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function get_options_bar(titulo, subtitulo, legendData, legendSelected, categoryData, series){
                      return {
                          title : {
                              text: titulo,
                              subtext: subtitulo,
              Severity: Major
              Found in static/js/frontend.ResumenController.js - About 2 hrs to fix

                Function grafica2 has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                   function grafica2( cantidades, nombres, anio, opcion,url) {
                
                    // configure for module loader
                        require.config({
                            paths: {
                Severity: Major
                Found in static/js/dncp/chart2.js - About 2 hrs to fix

                  Function tipo_requerimiento has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def tipo_requerimiento(periodo, prioridades, ubicaciones, estados, dncp, ret):
                      query = ''
                      cursor = connection.cursor()
                      union = False
                      estado = estados.get('estado')
                  Severity: Minor
                  Found in openfonacide/resumen.py - About 2 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 normalizar_string has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def normalizar_string(self, cadena):
                          assert isinstance(cadena, unicode)
                          normalizada = cadena.upper()
                  
                          normalizada = normalizada.replace(u'Á', 'A')
                  Severity: Major
                  Found in openfonacide/matcher.py - About 2 hrs to fix

                    Function makeTicksList has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function makeTicksList() {
                            tickList = [];
                    
                            // Estimate max exponent and min exponent
                            var maxDataLog = fixAccurate(mathLog(absMax) / lnBase);
                    Severity: Major
                    Found in static/js/dncp/util/smartLogSteps.js - About 2 hrs to fix

                      Function bodyCSS has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                bodyCSS: function() {
                                  var
                                    width     = $module.outerWidth(),
                                    height    = $module.outerHeight(),
                                    direction = module.get.direction(),
                      Severity: Major
                      Found in static/components/sidebar.js - About 2 hrs to fix

                        Consider simplifying this complex logical expression.
                        Open

                                      if($scope.data.ubicaciones && typeof (obtenerUbicacion) == 'function'){
                                          var ubicaciones = $scope.data.ubicaciones;
                                          $scope.rDepartamentos = ubicaciones
                                              .filter(function(obj){return !!obj[0] && !obj[1] && !obj[2]})
                                              .map(function(obj){return obtenerUbicacion(obj, true, true);});
                        Severity: Critical
                        Found in static/js/frontend.ResumenController.js - About 2 hrs to fix

                          Function urlData has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                    urlData: function(url, urlData) {
                                      var
                                        requiredVariables,
                                        optionalVariables
                                      ;
                          Severity: Major
                          Found in static/components/api.js - About 2 hrs to fix

                            Function obtenerTextoUbicacion has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        $scope.obtenerTextoUbicacion = function(selected, excluirPadres, incluirHojaNoRaiz, separador){
                                            if(separador == undefined){
                                                separador = " ➜ ";
                                            }
                                            var seleccion = "";
                            Severity: Major
                            Found in static/js/frontend.directive.js - About 2 hrs to fix

                              Function get_series_bar has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function get_series_bar(data){
                                      function get_item_style(color){
                                          return {
                                              normal: {
                                                  color: color,
                              Severity: Major
                              Found in static/js/frontend.ResumenController.js - About 2 hrs to fix

                                Function create has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                                $scope.create = function () {
                                                    if (window.mapLoaded) {
                                                        $scope.inicializar();
                                                        $timeout(function () {
                                                            angular.element('.mapContainer').html(window.mapElement);
                                Severity: Major
                                Found in static/js/frontend.MapController.js - About 2 hrs to fix

                                  Function create has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          create: function() {
                                            var
                                              html      = $module.data(metadata.html)      || settings.html,
                                              variation = $module.data(metadata.variation) || settings.variation,
                                              title     = $module.data(metadata.title)     || settings.title,
                                  Severity: Major
                                  Found in static/components/popup.js - About 2 hrs to fix

                                    Function get_series_doble_pie has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function get_series_doble_pie(innerTitle, innerData, outerTittle, outerData){
                                            return [
                                                {
                                                    name: innerTitle,
                                                    type: 'pie',
                                    Severity: Major
                                    Found in static/js/frontend.ResumenController.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language