CaffGeek/MBACNationals

View on GitHub
Web.Admin/z-scripts/angular-mocks.js

Summary

Maintainability
F
1 wk
Test Coverage

File angular-mocks.js has 940 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license AngularJS v1.4.3
 * (c) 2010-2015 Google, Inc. http://angularjs.org
 * License: MIT
 */
Severity: Major
Found in Web.Admin/z-scripts/angular-mocks.js - About 2 days to fix

    Function createHttpBackendMock has 151 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
      var definitions = [],
          expectations = [],
          responses = [],
          responsesPush = angular.bind(responses, responses.push),
    Severity: Major
    Found in Web.Admin/z-scripts/angular-mocks.js - About 6 hrs to fix

      Function TzDate has 94 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      angular.mock.TzDate = function(offset, timestamp) {
        var self = new Date(0);
        if (angular.isString(timestamp)) {
          var tsStr = timestamp;
      
      
      Severity: Major
      Found in Web.Admin/z-scripts/angular-mocks.js - About 3 hrs to fix

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

        angular.mock.$IntervalProvider = function() {
          this.$get = ['$browser', '$rootScope', '$q', '$$q',
               function($browser,   $rootScope,   $q,   $$q) {
            var repeatFns = [],
                nextRepeatId = 0,
        Severity: Major
        Found in Web.Admin/z-scripts/angular-mocks.js - About 2 hrs to fix

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

                 function($browser,   $rootScope,   $q,   $$q) {
              var repeatFns = [],
                  nextRepeatId = 0,
                  now = 0;
          
          
          Severity: Major
          Found in Web.Admin/z-scripts/angular-mocks.js - About 2 hrs to fix

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

              function $httpBackend(method, url, data, callback, headers, timeout, withCredentials) {
                var xhr = new MockXhr(),
                    expectation = expectations[0],
                    wasExpected = false;
            
            
            Severity: Major
            Found in Web.Admin/z-scripts/angular-mocks.js - About 2 hrs to fix

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

              angular.mock.$Browser = function() {
                var self = this;
              
                this.isMock = true;
                self.$$url = "http://server/";
              Severity: Major
              Found in Web.Admin/z-scripts/angular-mocks.js - About 2 hrs to fix

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

                angular.mock.$LogProvider = function() {
                  var debug = true;
                
                  function concat(array1, array2, index) {
                    return array1.concat(Array.prototype.slice.call(array2, index));
                Severity: Major
                Found in Web.Admin/z-scripts/angular-mocks.js - About 2 hrs to fix

                  Function animate has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    .config(['$provide', function($provide) {
                  
                      var reflowQueue = [];
                      $provide.value('$$animateReflow', function(fn) {
                        var index = reflowQueue.length;
                  Severity: Minor
                  Found in Web.Admin/z-scripts/angular-mocks.js - About 1 hr to fix

                    Function dump has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    angular.mock.dump = function(object) {
                      return serialize(object);
                    
                      function serialize(object) {
                        var out;
                    Severity: Minor
                    Found in Web.Admin/z-scripts/angular-mocks.js - About 1 hr to fix

                      Function $interval has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          var $interval = function(fn, delay, count, invokeApply) {
                            var hasParams = arguments.length > 4,
                                args = hasParams ? Array.prototype.slice.call(arguments, 4) : [],
                                iteration = 0,
                                skipApply = (angular.isDefined(invokeApply) && !invokeApply),
                      Severity: Minor
                      Found in Web.Admin/z-scripts/angular-mocks.js - About 1 hr to fix

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

                          this.$get = function() {
                            var $log = {
                              log: function() { $log.log.logs.push(concat([], arguments, 0)); },
                              warn: function() { $log.warn.logs.push(concat([], arguments, 0)); },
                              info: function() { $log.info.logs.push(concat([], arguments, 0)); },
                        Severity: Minor
                        Found in Web.Admin/z-scripts/angular-mocks.js - About 1 hr to fix

                          Function inject has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            window.inject = angular.mock.inject = function() {
                              var blockFns = Array.prototype.slice.call(arguments, 0);
                              var errorForStack = new Error('Declaration Location');
                              return isSpecRunning() ? workFn.call(currentSpec) : workFn;
                              /////////////////////
                          Severity: Minor
                          Found in Web.Admin/z-scripts/angular-mocks.js - About 1 hr to fix

                            Function MockXhr has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function MockXhr() {
                            
                              // hack for testing $http, $httpBackend
                              MockXhr.$$lastInstance = this;
                            
                            
                            Severity: Minor
                            Found in Web.Admin/z-scripts/angular-mocks.js - About 1 hr to fix

                              Function MockHttpExpectation has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function MockHttpExpectation(method, url, data, headers) {
                              
                                this.data = data;
                                this.headers = headers;
                              
                              
                              Severity: Minor
                              Found in Web.Admin/z-scripts/angular-mocks.js - About 1 hr to fix

                                Function $RootScopeDecorator has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
                                
                                  var $rootScopePrototype = Object.getPrototypeOf($delegate);
                                
                                  $rootScopePrototype.$countChildScopes = countChildScopes;
                                Severity: Minor
                                Found in Web.Admin/z-scripts/angular-mocks.js - About 1 hr to fix

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

                                      function workFn() {
                                        var modules = currentSpec.$modules || [];
                                        var strictDi = !!currentSpec.$injectorStrict;
                                        modules.unshift('ngMock');
                                        modules.unshift('ng');
                                  Severity: Minor
                                  Found in Web.Admin/z-scripts/angular-mocks.js - About 1 hr to fix

                                    Function $ExceptionHandlerProvider has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    angular.mock.$ExceptionHandlerProvider = function() {
                                      var handler;
                                    
                                      /**
                                       * @ngdoc method
                                    Severity: Minor
                                    Found in Web.Admin/z-scripts/angular-mocks.js - About 1 hr to fix

                                      Function serialize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        function serialize(object) {
                                          var out;
                                      
                                          if (angular.isElement(object)) {
                                            object = angular.element(object);
                                      Severity: Minor
                                      Found in Web.Admin/z-scripts/angular-mocks.js - About 1 hr to fix

                                        Function $httpBackend has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                          function $httpBackend(method, url, data, callback, headers, timeout, withCredentials) {
                                        Severity: Major
                                        Found in Web.Admin/z-scripts/angular-mocks.js - About 50 mins to fix

                                          Consider simplifying this complex logical expression.
                                          Open

                                          if (window.jasmine || window.mocha) {
                                          
                                            var currentSpec = null,
                                                annotatedFunctions = [],
                                                isSpecRunning = function() {
                                          Severity: Major
                                          Found in Web.Admin/z-scripts/angular-mocks.js - About 40 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                return true;
                                            Severity: Major
                                            Found in Web.Admin/z-scripts/angular-mocks.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                  return data == d;
                                              Severity: Major
                                              Found in Web.Admin/z-scripts/angular-mocks.js - About 30 mins to fix

                                                There are no issues that match your filters.

                                                Category
                                                Status