ncbo/bioportal_web_ui

View on GitHub
public/browse/lib/angular-mocks/angular-mocks.js

Summary

Maintainability
F
1 wk
Test Coverage

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

/**
 * @license AngularJS v1.3.5
 * (c) 2010-2014 Google, Inc. http://angularjs.org
 * License: MIT
 */
Severity: Major
Found in public/browse/lib/angular-mocks/angular-mocks.js - About 2 days to fix

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

    function createHttpBackendMock($rootScope, $delegate, $browser) {
      var definitions = [],
          expectations = [],
          responses = [],
          responsesPush = angular.bind(responses, responses.push),
    Severity: Major
    Found in public/browse/lib/angular-mocks/angular-mocks.js - About 5 hrs to fix

      Function TzDate has 93 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 public/browse/lib/angular-mocks/angular-mocks.js - About 3 hrs to fix

        Function $IntervalProvider has 67 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 public/browse/lib/angular-mocks/angular-mocks.js - About 2 hrs to fix

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

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

            Function $Browser has 60 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 public/browse/lib/angular-mocks/angular-mocks.js - About 2 hrs to fix

              Function $httpBackend has 57 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 public/browse/lib/angular-mocks/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 public/browse/lib/angular-mocks/angular-mocks.js - About 2 hrs 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 public/browse/lib/angular-mocks/angular-mocks.js - About 1 hr 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 public/browse/lib/angular-mocks/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 public/browse/lib/angular-mocks/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 public/browse/lib/angular-mocks/angular-mocks.js - About 1 hr to fix

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

                              var $interval = function(fn, delay, count, invokeApply) {
                                var iteration = 0,
                                    skipApply = (angular.isDefined(invokeApply) && !invokeApply),
                                    deferred = (skipApply ? $$q : $q).defer(),
                                    promise = deferred.promise;
                          Severity: Minor
                          Found in public/browse/lib/angular-mocks/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 public/browse/lib/angular-mocks/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 public/browse/lib/angular-mocks/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 public/browse/lib/angular-mocks/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 public/browse/lib/angular-mocks/angular-mocks.js - About 1 hr to fix

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

                                    angular.mock.$ExceptionHandlerProvider = function() {
                                      var handler;
                                    
                                      /**
                                       * @ngdoc method
                                    Severity: Minor
                                    Found in public/browse/lib/angular-mocks/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 public/browse/lib/angular-mocks/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 public/browse/lib/angular-mocks/angular-mocks.js - About 50 mins to fix

                                          Consider simplifying this complex logical expression.
                                          Open

                                          if (window.jasmine || window.mocha) {
                                          
                                            var currentSpec = null,
                                                isSpecRunning = function() {
                                                  return !!currentSpec;
                                          Severity: Major
                                          Found in public/browse/lib/angular-mocks/angular-mocks.js - About 40 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                return true;
                                            Severity: Major
                                            Found in public/browse/lib/angular-mocks/angular-mocks.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                  return data == d;
                                              Severity: Major
                                              Found in public/browse/lib/angular-mocks/angular-mocks.js - About 30 mins to fix

                                                There are no issues that match your filters.

                                                Category
                                                Status