gartz/pushStateTree

View on GitHub

Showing 17 of 21 total issues

File push-state-tree.js has 794 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//! push-state-tree - v0.16.0 - 2024-03-30
//* https://github.com/gartz/pushStateTree/
//* Copyright (c) 2024 Gabriel Reitz Giannattasio <g@rtz.sh>; Licensed 

var PushStateTree = {options: {VERSION: '0.16.0'}};
Severity: Major
Found in push-state-tree.js - About 1 day to fix

    File pushStateTree.js has 793 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    (function (root) {
      "use strict";
    
      var document = root.document;
      var window = root.window;
    Severity: Major
    Found in src/pushStateTree.js - About 1 day to fix

      Function exports has 223 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function(grunt) {
      
        grunt.initConfig({
          meta: {
            pkg: grunt.file.readJSON('package.json'),
      Severity: Major
      Found in Gruntfile.js - About 1 day to fix

        Function PushStateTree has 181 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function PushStateTree(options) {
            options = options || {};
            // Enforce the usage of PushState API, available on all modern browsers.
            // True by default
            options[USE_PUSH_STATE] = options[USE_PUSH_STATE] !== false;
        Severity: Major
        Found in src/pushStateTree.js - About 7 hrs to fix

          Function PushStateTree has 181 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function PushStateTree(options) {
              options = options || {};
              // Enforce the usage of PushState API, available on all modern browsers.
              // True by default
              options[USE_PUSH_STATE] = options[USE_PUSH_STATE] !== false;
          Severity: Major
          Found in push-state-tree.js - About 7 hrs to fix

            Function rulesDispatcher has 122 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                rulesDispatcher: function () {
                  // Will dispatch the right events in each rule
                  /*jshint validthis:true */
            
                  // Cache the URI, in case of an event try to change it
            Severity: Major
            Found in push-state-tree.js - About 4 hrs to fix

              Function rulesDispatcher has 122 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  rulesDispatcher: function () {
                    // Will dispatch the right events in each rule
                    /*jshint validthis:true */
              
                    // Cache the URI, in case of an event try to change it
              Severity: Major
              Found in src/pushStateTree.js - About 4 hrs to fix

                Function recursiveDispatcher has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      function recursiveDispatcher(uri, oldURI, ruleElement) {
                        if (!ruleElement.rule) return;
                
                        var useURI = uri;
                        var useOldURI = oldURI;
                Severity: Major
                Found in src/pushStateTree.js - About 3 hrs to fix

                  Function recursiveDispatcher has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        function recursiveDispatcher(uri, oldURI, ruleElement) {
                          if (!ruleElement.rule) return;
                  
                          var useURI = uri;
                          var useOldURI = oldURI;
                  Severity: Major
                  Found in push-state-tree.js - About 3 hrs to fix

                    Function createRule has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        createRule: function (options) {
                          // Create a pushstreamtree-rule element from a literal object
                    
                          var rule = document.createElement("pushstatetree-rule");
                    
                    
                    Severity: Major
                    Found in push-state-tree.js - About 2 hrs to fix

                      Function createRule has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          createRule: function (options) {
                            // Create a pushstreamtree-rule element from a literal object
                      
                            var rule = document.createElement("pushstatetree-rule");
                      
                      
                      Severity: Major
                      Found in src/pushStateTree.js - About 2 hrs to fix

                        Function removeEventListenerFunc has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            var removeEventListenerFunc = function (type, handler) {
                              if (!this.__bindedFunctions) {
                                this.__bindedFunctions = [];
                              }
                        
                        
                        Severity: Minor
                        Found in src/pushStateTree.js - About 1 hr to fix

                          Function removeEventListenerFunc has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              var removeEventListenerFunc = function (type, handler) {
                                if (!this.__bindedFunctions) {
                                  this.__bindedFunctions = [];
                                }
                          
                          
                          Severity: Minor
                          Found in push-state-tree.js - About 1 hr to fix

                            Function get has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  get: function () {
                                    if (cachedUri.url === root.location.href) return cachedUri.uri;
                            
                                    var ignoreHash = options[IGNORE_HASH];
                            
                            
                            Severity: Minor
                            Found in push-state-tree.js - About 1 hr to fix

                              Function get has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    get: function () {
                                      if (cachedUri.url === root.location.href) return cachedUri.uri;
                              
                                      var ignoreHash = options[IGNORE_HASH];
                              
                              
                              Severity: Minor
                              Found in src/pushStateTree.js - About 1 hr to fix

                                Function addEventListenerFunc has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    var addEventListenerFunc = function (type, handler) {
                                      if (!this.__bindedFunctions) {
                                        this.__bindedFunctions = [];
                                      }
                                
                                
                                Severity: Minor
                                Found in push-state-tree.js - About 1 hr to fix

                                  Function addEventListenerFunc has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      var addEventListenerFunc = function (type, handler) {
                                        if (!this.__bindedFunctions) {
                                          this.__bindedFunctions = [];
                                        }
                                  
                                  
                                  Severity: Minor
                                  Found in src/pushStateTree.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language