angular/angular.js

View on GitHub
src/ngMock/angular-mocks.js

Summary

Maintainability
F
2 wks
Test Coverage

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

'use strict';

/* global routeToRegExp: false */

/**
Severity: Major
Found in src/ngMock/angular-mocks.js - About 3 days to fix

    Function createHttpBackendMock has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring.
    Open

    function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
      var definitions = [],
          expectations = [],
          matchLatestDefinition = false,
          responses = [],
    Severity: Minor
    Found in src/ngMock/angular-mocks.js - About 1 day 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 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 src/ngMock/angular-mocks.js - About 1 day to fix

      Function MockHttpExpectation has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
      Open

      function MockHttpExpectation(expectedMethod, expectedUrl, expectedData, expectedHeaders,
                                   expectedKeys) {
      
        this.data = expectedData;
        this.headers = expectedHeaders;
      Severity: Minor
      Found in src/ngMock/angular-mocks.js - About 6 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 $IntervalProvider has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

      angular.mock.$IntervalProvider = function() {
        this.$get = ['$browser', '$$intervalFactory',
             function($browser,   $$intervalFactory) {
          var repeatFns = [],
              nextRepeatId = 0,
      Severity: Minor
      Found in src/ngMock/angular-mocks.js - About 4 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 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 src/ngMock/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 src/ngMock/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 src/ngMock/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 src/ngMock/angular-mocks.js - About 3 hrs to fix

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

              angular.mock.dump = function(object) {
                return serialize(object);
              
                function serialize(object) {
                  var out;
              Severity: Minor
              Found in src/ngMock/angular-mocks.js - 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 $Browser has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

              angular.mock.$Browser = function($log, $$taskTrackerFactory) {
                var self = this;
                var taskTracker = $$taskTrackerFactory($log);
              
                this.isMock = true;
              Severity: Minor
              Found in src/ngMock/angular-mocks.js - 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 $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 src/ngMock/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 src/ngMock/angular-mocks.js - About 2 hrs to fix

                  Function $RootScopeDecorator has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                  angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
                  
                    var $rootScopePrototype = Object.getPrototypeOf($delegate);
                  
                    $rootScopePrototype.$countChildScopes = countChildScopes;
                  Severity: Minor
                  Found in src/ngMock/angular-mocks.js - 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 $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 src/ngMock/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 src/ngMock/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 src/ngMock/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 src/ngMock/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 src/ngMock/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 src/ngMock/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 src/ngMock/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 src/ngMock/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 src/ngMock/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 src/ngMock/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 src/ngMock/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 src/ngMock/angular-mocks.js - About 1 hr to fix

                                          Function $LogProvider has a Cognitive Complexity of 9 (exceeds 5 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: Minor
                                          Found in src/ngMock/angular-mocks.js - About 55 mins 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 MockXhr has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                          function MockXhr() {
                                          
                                            // hack for testing $http, $httpBackend
                                            MockXhr.$$lastInstance = this;
                                          
                                          
                                          Severity: Minor
                                          Found in src/ngMock/angular-mocks.js - About 45 mins 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 expect has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                            $httpBackend.expect = function(method, url, data, headers, keys) {
                                          Severity: Minor
                                          Found in src/ngMock/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 src/ngMock/angular-mocks.js - About 35 mins 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 src/ngMock/angular-mocks.js - About 35 mins to fix

                                                Function ComponentControllerProvider has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    function ComponentControllerProvider($compileProvider) {
                                                  this.$get = ['$controller','$injector', '$rootScope', function($controller, $injector, $rootScope) {
                                                    return function $componentController(componentName, locals, bindings, ident) {
                                                      // get all directives associated to the component name
                                                      var directives = $injector.get(componentName + 'Directive');
                                                Severity: Minor
                                                Found in src/ngMock/angular-mocks.js - About 35 mins 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

                                                Avoid too many return statements within this function.
                                                Open

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

                                                  Avoid too many return statements within this function.
                                                  Open

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

                                                    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 src/ngMock/angular-mocks.js and 1 other location - About 1 hr to fix
                                                    src/ngMock/angular-mocks.js on lines 309..318

                                                    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 src/ngMock/angular-mocks.js and 1 other location - About 1 hr to fix
                                                    src/ngMock/angular-mocks.js on lines 271..280

                                                    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

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

                                                        if (match[9]) {
                                                          tzHour = toInt(match[9] + match[10]);
                                                          tzMin = toInt(match[9] + match[11]);
                                                        }
                                                    Severity: Major
                                                    Found in src/ngMock/angular-mocks.js and 1 other location - About 1 hr to fix
                                                    src/ng/filter/filters.js on lines 595..598

                                                    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 57.

                                                    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 src/ngMock/angular-mocks.js and 1 other location - About 1 hr to fix
                                                    src/ngMock/angular-mocks.js on lines 1957..1960

                                                    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 src/ngMock/angular-mocks.js and 1 other location - About 1 hr to fix
                                                    src/ngMock/angular-mocks.js on lines 1773..1776

                                                    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

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

                                                    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, 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 src/ngMock/angular-mocks.js and 1 other location - About 50 mins to fix
                                                    src/ngMock/angular-mocks.js on lines 2066..2073

                                                    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 src/ngMock/angular-mocks.js and 1 other location - About 50 mins to fix
                                                    src/ngMock/angular-mocks.js on lines 2077..2084

                                                    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 src/ngMock/angular-mocks.js and 1 other location - About 50 mins to fix
                                                    src/ngMock/angular-mocks.js on lines 944..949

                                                    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