angular/angular.js

View on GitHub
src/ngRoute/route.js

Summary

Maintainability
F
5 days
Test Coverage

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

function $RouteProvider() {
  isArray = angular.isArray;
  isObject = angular.isObject;
  isDefined = angular.isDefined;
  noop = angular.noop;
Severity: Minor
Found in src/ngRoute/route.js - About 2 days 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 $RouteProvider has 283 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function $RouteProvider() {
  isArray = angular.isArray;
  isObject = angular.isObject;
  isDefined = angular.isDefined;
  noop = angular.noop;
Severity: Major
Found in src/ngRoute/route.js - About 1 day to fix

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

          function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce, $browser) {
    
        /**
         * @ngdoc service
         * @name $route
    Severity: Major
    Found in src/ngRoute/route.js - About 1 day to fix

      File route.js has 303 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      
      /* global routeToRegExp: false */
      /* global shallowCopy: false */
      
      
      Severity: Minor
      Found in src/ngRoute/route.js - About 3 hrs to fix

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

            function commitRoute() {
              var lastRoute = $route.current;
              var nextRoute = preparedRoute;
        
              if (preparedRouteIsUpdateOnly) {
        Severity: Minor
        Found in src/ngRoute/route.js - About 1 hr to fix

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

              function getRedirectionData(route) {
                var data = {
                  route: route,
                  hasRedirection: false
                };
          Severity: Minor
          Found in src/ngRoute/route.js - About 1 hr to fix

            Function $get has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce, $browser) {
            Severity: Major
            Found in src/ngRoute/route.js - About 1 hr to fix

              There are no issues that match your filters.

              Category
              Status