angular/angular.js

View on GitHub

Showing 2,008 of 4,250 total issues

Function $HttpProvider has 308 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function $HttpProvider() {
  /**
   * @ngdoc property
   * @name $httpProvider#defaults
   * @description
Severity: Major
Found in src/ng/http.js - About 1 day to fix

    Function qFactory has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
    Open

    function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {
      var $qMinErr = minErr('$q', TypeError);
      var queueSize = 0;
      var checkQueue = [];
    
    
    Severity: Minor
    Found in src/ng/q.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

    File input.js has 664 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    /* global
      VALID_CLASS: false,
      INVALID_CLASS: false,
    Severity: Major
    Found in src/ng/directive/input.js - About 1 day to fix

      Function ngOptionsDirective has 296 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var ngOptionsDirective = ['$compile', '$document', '$parse', function($compile, $document, $parse) {
      
        function parseOptionsExpression(optionsExp, selectElement, scope) {
      
          var match = optionsExp.match(NG_OPTIONS_REGEXP);
      Severity: Major
      Found in src/ng/directive/ngOptions.js - About 1 day to fix

        Function $SanitizeProvider has 294 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function $SanitizeProvider() {
          var hasBeenInstantiated = false;
          var svgEnabled = false;
        
          this.$get = ['$$sanitizeUri', function($$sanitizeUri) {
        Severity: Major
        Found in src/ngSanitize/sanitize.js - About 1 day to fix

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

          function $SceDelegateProvider() {
            this.SCE_CONTEXTS = SCE_CONTEXTS;
          
            // Resource URLs can also be trusted by policy.
            var trustedResourceUrlList = ['self'],
          Severity: Minor
          Found in src/ng/sce.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 $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 SelectController has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
            Open

                    ['$element', '$scope', /** @this */ function($element, $scope) {
            
              var self = this,
                  optionsMap = new NgMap();
            
            
            Severity: Minor
            Found in src/ng/directive/select.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 ResourceProvider has 273 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              provider('$resource', function ResourceProvider() {
                var PROTOCOL_AND_IPV6_REGEX = /^https?:\/\/\[[^\]]*][^/]*/;
            
                var provider = this;
            
            
            Severity: Major
            Found in src/ngResource/resource.js - About 1 day to fix

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

                    function($browser, $httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector, $sce) {
              
                  var defaultCache = $cacheFactory('$http');
              
                  /**
              Severity: Major
              Found in src/ng/http.js - About 1 day to fix

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

                    this.$get = ['$http', '$log', '$q', '$timeout', function($http, $log, $q, $timeout) {
                
                      var noop = angular.noop,
                          forEach = angular.forEach,
                          extend = angular.extend,
                Severity: Major
                Found in src/ngResource/resource.js - About 1 day to fix

                  File rootScope.js has 596 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  'use strict';
                  
                  /**
                   * DESIGN NOTES
                   *
                  Severity: Major
                  Found in src/ng/rootScope.js - About 1 day to fix

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

                    var $$AnimateCssDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) {
                      $$animationProvider.drivers.push('$$animateCssDriver');
                    
                      var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';
                      var NG_ANIMATE_ANCHOR_CLASS_NAME = 'ng-anchor';
                    Severity: Minor
                    Found in src/ngAnimate/animateCssDriver.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 Browser has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function Browser(window, document, $log, $sniffer, $$taskTrackerFactory) {
                      var self = this,
                          location = window.location,
                          history = window.history,
                          setTimeout = window.setTimeout,
                    Severity: Minor
                    Found in src/ng/browser.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 createInjector has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function createInjector(modulesToLoad, strictDi) {
                      strictDi = (strictDi === true);
                      var INSTANTIATING = {},
                          providerSuffix = 'Provider',
                          path = [],
                    Severity: Minor
                    Found in src/auto/injector.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 orderByFilter has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function orderByFilter($parse) {
                      return function(array, sortPredicate, reverseOrder, compareFn) {
                    
                        if (array == null) return array;
                        if (!isArrayLike(array)) {
                    Severity: Minor
                    Found in src/ng/filter/orderBy.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 qFactory has 235 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {
                      var $qMinErr = minErr('$q', TypeError);
                      var queueSize = 0;
                      var checkQueue = [];
                    
                    
                    Severity: Major
                    Found in src/ng/q.js - About 1 day to fix

                      Function copy has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function copy(source, destination, maxDepth) {
                        var stackSource = [];
                        var stackDest = [];
                        maxDepth = isValidObjectMaxDepth(maxDepth) ? maxDepth : NaN;
                      
                      
                      Severity: Minor
                      Found in src/Angular.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 $$AnimateJsProvider has 230 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var $$AnimateJsProvider = ['$animateProvider', /** @this */ function($animateProvider) {
                        this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',
                             function($injector,   $$AnimateRunner,   $$jqLite) {
                      
                          var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
                      Severity: Major
                      Found in src/ngAnimate/animateJs.js - About 1 day to fix

                        File animateCss.js has 546 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        'use strict';
                        
                        /* exported $AnimateCssProvider */
                        
                        var ANIMATE_TIMER_KEY = '$$animateCss';
                        Severity: Major
                        Found in src/ngAnimate/animateCss.js - About 1 day to fix
                          Severity
                          Category
                          Status
                          Source
                          Language