myems-admin/js/angular/angular-mocks.js

Summary

Maintainability
F
1 wk
Test Coverage

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

/**
 * @license AngularJS v1.8.3
 * (c) 2010-2020 Google LLC. http://angularjs.org
 * License: MIT
 */
Severity: Major
Found in myems-admin/js/angular/angular-mocks.js - About 3 days to fix

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

    function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
      var definitions = [],
          expectations = [],
          matchLatestDefinition = false,
          responses = [],
    Severity: Major
    Found in myems-admin/js/angular/angular-mocks.js - About 1 day to fix

      Function browserTrigger has 103 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        window.browserTrigger = function browserTrigger(element, eventType, eventData) {
          if (element && !element.nodeName) element = element[0];
          if (!element) return;
      
          eventData = eventData || {};
      Severity: Major
      Found in myems-admin/js/angular/angular-mocks.js - About 4 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 myems-admin/js/angular/angular-mocks.js - About 3 hrs to fix

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

          angular.mock.$Browser = function($log, $$taskTrackerFactory) {
            var self = this;
            var taskTracker = $$taskTrackerFactory($log);
          
            this.isMock = true;
          Severity: Major
          Found in myems-admin/js/angular/angular-mocks.js - About 3 hrs to fix

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

            function MockHttpExpectation(expectedMethod, expectedUrl, expectedData, expectedHeaders,
                                         expectedKeys) {
            
              this.data = expectedData;
              this.headers = expectedHeaders;
            Severity: Major
            Found in myems-admin/js/angular/angular-mocks.js - About 3 hrs to fix

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

                function $httpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {
              
                  var xhr = new MockXhr(),
                      expectation = expectations[0],
                      wasExpected = false;
              Severity: Major
              Found in myems-admin/js/angular/angular-mocks.js - About 3 hrs to fix

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

                angular.mock.$IntervalProvider = function() {
                  this.$get = ['$browser', '$$intervalFactory',
                       function($browser,   $$intervalFactory) {
                    var repeatFns = [],
                        nextRepeatId = 0,
                Severity: Major
                Found in myems-admin/js/angular/angular-mocks.js - About 2 hrs to fix

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

                         function($browser,   $$intervalFactory) {
                      var repeatFns = [],
                          nextRepeatId = 0,
                          now = 0,
                          setIntervalFn = function(tick, delay, deferred, skipApply) {
                  Severity: Major
                  Found in myems-admin/js/angular/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 myems-admin/js/angular/angular-mocks.js - About 2 hrs to fix

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

                      function MockXhr() {
                      
                        // hack for testing $http, $httpBackend
                        MockXhr.$$lastInstance = this;
                      
                      
                      Severity: Minor
                      Found in myems-admin/js/angular/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 myems-admin/js/angular/angular-mocks.js - About 1 hr to fix

                          Function inject has 43 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');
                              // IE10+ and PhanthomJS do not set stack trace information, until the error is thrown
                              if (!errorForStack.stack) {
                          Severity: Minor
                          Found in myems-admin/js/angular/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 myems-admin/js/angular/angular-mocks.js - About 1 hr to fix

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

                                  function WorkFn() {
                                    var modules = currentSpec.$modules || [];
                                    var strictDi = !!currentSpec.$injectorStrict;
                                    modules.unshift(['$injector', function($injector) {
                                      currentSpec.$providerInjector = $injector;
                              Severity: Minor
                              Found in myems-admin/js/angular/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 myems-admin/js/angular/angular-mocks.js - About 1 hr to fix

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

                                    function $httpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {
                                  Severity: Major
                                  Found in myems-admin/js/angular/angular-mocks.js - About 1 hr to fix

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

                                        function wrapResponse(wrapped) {
                                          if (!$browser && timeout) {
                                            if (timeout.then) {
                                              timeout.then(function() {
                                                handlePrematureEnd(angular.isDefined(timeout.$$timeoutId) ? 'timeout' : 'abort');
                                    Severity: Minor
                                    Found in myems-admin/js/angular/angular-mocks.js - About 1 hr to fix

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

                                        module.$$cleanup = function() {
                                          var injector = currentSpec.$injector;
                                      
                                          annotatedFunctions.forEach(function(fn) {
                                            delete fn.$inject;
                                      Severity: Minor
                                      Found in myems-admin/js/angular/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 myems-admin/js/angular/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 myems-admin/js/angular/angular-mocks.js - About 1 hr to fix

                                            Function when has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                              $httpBackend.when = function(method, url, data, headers, keys) {
                                            Severity: Minor
                                            Found in myems-admin/js/angular/angular-mocks.js - About 35 mins to fix

                                              Function expect has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                $httpBackend.expect = function(method, url, data, headers, keys) {
                                              Severity: Minor
                                              Found in myems-admin/js/angular/angular-mocks.js - About 35 mins to fix

                                                Function MockHttpExpectation has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                function MockHttpExpectation(expectedMethod, expectedUrl, expectedData, expectedHeaders,
                                                                             expectedKeys) {
                                                Severity: Minor
                                                Found in myems-admin/js/angular/angular-mocks.js - About 35 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                      return true;
                                                  Severity: Major
                                                  Found in myems-admin/js/angular/angular-mocks.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                        return expectedData == data;
                                                    Severity: Major
                                                    Found in myems-admin/js/angular/angular-mocks.js - About 30 mins to fix

                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                      Open

                                                      function routeToRegExp(path, opts) {
                                                        var keys = [];
                                                      
                                                        var pattern = path
                                                          .replace(/([().])/g, '\\$1')
                                                      Severity: Major
                                                      Found in myems-admin/js/angular/angular-mocks.js and 1 other location - About 1 day to fix
                                                      myems-admin/js/angular/angular-route.js on lines 49..78

                                                      Duplicated Code

                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                      Tuning

                                                      This issue has a mass of 231.

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                      Open

                                                          if (/transitionend/.test(eventType)) {
                                                            if (window.WebKitTransitionEvent) {
                                                              evnt = new window.WebKitTransitionEvent(eventType, eventData);
                                                              evnt.initEvent(eventType, eventData.bubbles, true);
                                                            } else {
                                                      Severity: Major
                                                      Found in myems-admin/js/angular/angular-mocks.js and 1 other location - About 4 hrs to fix
                                                      myems-admin/js/angular/angular-mocks.js on lines 3610..3659

                                                      Duplicated Code

                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                      Tuning

                                                      This issue has a mass of 128.

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                      Open

                                                          } else if (/animationend/.test(eventType)) {
                                                            if (window.WebKitAnimationEvent) {
                                                              evnt = new window.WebKitAnimationEvent(eventType, eventData);
                                                              evnt.initEvent(eventType, eventData.bubbles, true);
                                                            } else {
                                                      Severity: Major
                                                      Found in myems-admin/js/angular/angular-mocks.js and 1 other location - About 4 hrs to fix
                                                      myems-admin/js/angular/angular-mocks.js on lines 3598..3659

                                                      Duplicated Code

                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                      Tuning

                                                      This issue has a mass of 128.

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                      Open

                                                      angular.mock.$FlushPendingTasksProvider = function() {
                                                        this.$get = [
                                                          '$browser',
                                                          function($browser) {
                                                            return function $flushPendingTasks(delay) {
                                                      Severity: Major
                                                      Found in myems-admin/js/angular/angular-mocks.js and 1 other location - About 1 hr to fix
                                                      myems-admin/js/angular/angular-mocks.js on lines 363..372

                                                      Duplicated Code

                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                      Tuning

                                                      This issue has a mass of 65.

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                      Open

                                                      angular.mock.$VerifyNoPendingTasksProvider = function() {
                                                        this.$get = [
                                                          '$browser',
                                                          function($browser) {
                                                            return function $verifyNoPendingTasks(taskType) {
                                                      Severity: Major
                                                      Found in myems-admin/js/angular/angular-mocks.js and 1 other location - About 1 hr to fix
                                                      myems-admin/js/angular/angular-mocks.js on lines 325..334

                                                      Duplicated Code

                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                      Tuning

                                                      This issue has a mass of 65.

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                      Open

                                                        $httpBackend.whenRoute = function(method, url) {
                                                          var parsed = parseRouteUrl(url);
                                                          return $httpBackend.when(method, parsed.regexp, undefined, undefined, parsed.keys);
                                                        };
                                                      Severity: Major
                                                      Found in myems-admin/js/angular/angular-mocks.js and 1 other location - About 1 hr to fix
                                                      myems-admin/js/angular/angular-mocks.js on lines 2011..2014

                                                      Duplicated Code

                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                      Tuning

                                                      This issue has a mass of 56.

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                      Open

                                                        $httpBackend.expectRoute = function(method, url) {
                                                          var parsed = parseRouteUrl(url);
                                                          return $httpBackend.expect(method, parsed.regexp, undefined, undefined, parsed.keys);
                                                        };
                                                      Severity: Major
                                                      Found in myems-admin/js/angular/angular-mocks.js and 1 other location - About 1 hr to fix
                                                      myems-admin/js/angular/angular-mocks.js on lines 1827..1830

                                                      Duplicated Code

                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                      Tuning

                                                      This issue has a mass of 56.

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                      Open

                                                            $httpBackend[prefix + method] = function(url, data, headers, keys) {
                                                              assertArgDefined(arguments, 0, 'url');
                                                      
                                                              // Change url to `null` if `undefined` to stop it throwing an exception further down
                                                              if (angular.isUndefined(url)) url = null;
                                                      Severity: Minor
                                                      Found in myems-admin/js/angular/angular-mocks.js and 1 other location - About 50 mins to fix
                                                      myems-admin/js/angular/angular-mocks.js on lines 2120..2127

                                                      Duplicated Code

                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                      Tuning

                                                      This issue has a mass of 51.

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                      Open

                                                            animateJsConstructor.$closeAndFlush = function() {
                                                              runners.forEach(function(runner) {
                                                                runner.end();
                                                              });
                                                              runners = [];
                                                      Severity: Minor
                                                      Found in myems-admin/js/angular/angular-mocks.js and 1 other location - About 50 mins to fix
                                                      myems-admin/js/angular/angular-mocks.js on lines 1017..1022

                                                      Duplicated Code

                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                      Tuning

                                                      This issue has a mass of 51.

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                      Open

                                                            animateCssConstructor.$closeAndFlush = function() {
                                                              runners.forEach(function(runner) {
                                                                runner.end();
                                                              });
                                                              runners = [];
                                                      Severity: Minor
                                                      Found in myems-admin/js/angular/angular-mocks.js and 1 other location - About 50 mins to fix
                                                      myems-admin/js/angular/angular-mocks.js on lines 998..1003

                                                      Duplicated Code

                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                      Tuning

                                                      This issue has a mass of 51.

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                      Open

                                                           $httpBackend[prefix + method] = function(url, headers, keys) {
                                                              assertArgDefined(arguments, 0, 'url');
                                                      
                                                              // Change url to `null` if `undefined` to stop it throwing an exception further down
                                                              if (angular.isUndefined(url)) url = null;
                                                      Severity: Minor
                                                      Found in myems-admin/js/angular/angular-mocks.js and 1 other location - About 50 mins to fix
                                                      myems-admin/js/angular/angular-mocks.js on lines 2131..2138

                                                      Duplicated Code

                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                      Tuning

                                                      This issue has a mass of 51.

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

                                                      There are no issues that match your filters.

                                                      Category
                                                      Status