angular/angular.js

View on GitHub

Showing 2,008 of 4,250 total issues

File http.js has 445 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var APPLICATION_JSON = 'application/json';
var CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'};
var JSON_START = /^\[|^\{(?!\{)/;
Severity: Minor
Found in src/ng/http.js - About 6 hrs to fix

    File location.js has 442 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    /* global stripHash: true */
    
    var PATH_MATCH = /^([^?#]*)(\?([^#]*))?(#(.*))?$/,
        DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};
    Severity: Minor
    Found in src/ng/location.js - About 6 hrs to fix

      Function rangeInputType has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

      function rangeInputType(scope, element, attr, ctrl, $sniffer, $browser) {
        badInputChecker(scope, element, attr, ctrl, 'range');
        numberFormatterParser(ctrl);
        baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
      
      
      Severity: Minor
      Found in src/ng/directive/input.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 $AnimateProvider has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

      var $AnimateProvider = ['$provide', /** @this */ function($provide) {
        var provider = this;
        var classNameFilter = null;
        var customFilter = null;
      
      
      Severity: Minor
      Found in src/ng/animate.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 $$AnimationProvider has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

      var $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {
        var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';
      
        var drivers = this.drivers = [];
      
      
      Severity: Minor
      Found in src/ngAnimate/animation.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 ngRepeatDirective has 164 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $animate, $compile) {
        var NG_REMOVED = '$$NG_REMOVED';
        var ngRepeatMinErr = minErr('ngRepeat');
      
        var updateScope = function(scope, index, valueIdentifier, value, keyIdentifier, key, arrayLength) {
      Severity: Major
      Found in src/ng/directive/ngRepeat.js - About 6 hrs to fix

        Function forEach has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

        function forEach(obj, iterator, context) {
          var key, length;
          if (obj) {
            if (isFunction(obj)) {
              for (key in obj) {
        Severity: Minor
        Found in src/Angular.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 $LocationProvider has 160 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function $LocationProvider() {
          var hashPrefix = '!',
              html5Mode = {
                enabled: false,
                requireBase: true,
        Severity: Major
        Found in src/ng/location.js - About 6 hrs to fix

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

          function $LocationProvider() {
            var hashPrefix = '!',
                html5Mode = {
                  enabled: false,
                  requireBase: true,
          Severity: Minor
          Found in src/ng/location.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

          File ngModel.js has 418 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          'use strict';
          
          /* global VALID_CLASS: true,
            INVALID_CLASS: true,
            PRISTINE_CLASS: true,
          Severity: Minor
          Found in src/ng/directive/ngModel.js - About 6 hrs to fix

            File messageFormatParser.js has 417 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            'use strict';
            
            // NOTE: ADVANCED_OPTIMIZATIONS mode.
            //
            // This file is compiled with Closure compiler's ADVANCED_OPTIMIZATIONS flag! Be wary of using
            Severity: Minor
            Found in src/ngMessageFormat/messageFormatParser.js - About 6 hrs to fix

              Function deepCompare has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
              Open

              function deepCompare(actual, expected, comparator, anyPropertyKey, matchAgainstAnyProp, dontMatchWholeObject) {
                var actualType = getTypeForFilter(actual);
                var expectedType = getTypeForFilter(expected);
              
                if ((expectedType === 'string') && (expected.charAt(0) === '!')) {
              Severity: Minor
              Found in src/ng/filter/filter.js - About 5 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 generatePagesDataProcessor has 145 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function generatePagesDataProcessor(log) {
              
              
                var navGroupMappers = {
                  api: function(areaPages, area) {
              Severity: Major
              Found in docs/config/processors/pages-data.js - About 5 hrs to fix

                Function publishExternalAPI has 144 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function publishExternalAPI(angular) {
                  extend(angular, {
                    'errorHandlingConfig': errorHandlingConfig,
                    'bootstrap': bootstrap,
                    'copy': copy,
                Severity: Major
                Found in src/AngularPublic.js - About 5 hrs to fix

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

                  function $AnchorScrollProvider() {
                  
                    var autoScrollingEnabled = true;
                  
                    /**
                  Severity: Minor
                  Found in src/ng/anchorScroll.js - About 5 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 $SceDelegateProvider has 143 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function $SceDelegateProvider() {
                    this.SCE_CONTEXTS = SCE_CONTEXTS;
                  
                    // Resource URLs can also be trusted by policy.
                    var trustedResourceUrlList = ['self'],
                  Severity: Major
                  Found in src/ng/sce.js - About 5 hrs to fix

                    Function nodeLinkFn has 140 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {
                            var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element,
                                attrs, scopeBindingInfo;
                    
                            if (compileNode === linkNode) {
                    Severity: Major
                    Found in src/ng/compile.js - About 5 hrs to fix

                      Function NgMessagesCtrl has 138 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            controller: ['$element', '$scope', '$attrs', function NgMessagesCtrl($element, $scope, $attrs) {
                              var ctrl = this;
                              var latestKey = 0;
                              var nextAttachId = 0;
                      
                      
                      Severity: Major
                      Found in src/ngMessages/messages.js - About 5 hrs to fix

                        Function $InterpolateProvider has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function $InterpolateProvider() {
                          var startSymbol = '{{';
                          var endSymbol = '}}';
                        
                          /**
                        Severity: Major
                        Found in src/ng/interpolate.js - About 5 hrs to fix

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

                          function $$IntervalFactoryProvider() {
                            this.$get = ['$browser', '$q', '$$q', '$rootScope',
                                 function($browser,   $q,   $$q,   $rootScope) {
                              return function intervalFactory(setIntervalFn, clearIntervalFn) {
                                return function intervalFn(fn, delay, count, invokeApply) {
                          Severity: Minor
                          Found in src/ng/intervalFactory.js - About 5 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

                          Severity
                          Category
                          Status
                          Source
                          Language