angular/angular.js

View on GitHub

Showing 2,008 of 4,250 total issues

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 findConstantAndWatchExpressions has 106 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function findConstantAndWatchExpressions(ast, $filter, parentIsPure) {
  var allConstants;
  var argsToWatch;
  var isStatelessFilter;

Severity: Major
Found in src/ng/parse.js - About 4 hrs to fix

    Function $watchCollection has 105 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          $watchCollection: function(obj, listener) {
            // Mark the interceptor as
            // ... $$pure when literal since the instance will change when any input changes
            $watchCollectionInterceptor.$$pure = $parse(obj).literal;
            // ... $stateful when non-literal since we must read the state of the collection
    Severity: Major
    Found in src/ng/rootScope.js - About 4 hrs to fix

      Function generateVersionDocProcessor has 105 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function generateVersionDocProcessor(gitData) {
        return {
          $runAfter: ['generatePagesDataProcessor'],
          $runBefore: ['rendering-docs'],
          // Remove rogue builds that are in the npm repository but not on code.angularjs.org
      Severity: Major
      Found in docs/config/processors/versions-data.js - About 4 hrs 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 src/ngMock/browserTrigger.js - About 4 hrs to fix

          Function LocationHashbangUrl has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {
          
            parseAbsoluteUrl(appBase, this);
          
          
          
          Severity: Minor
          Found in src/ng/location.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 rangeInputType has 101 lines of code (exceeds 25 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: Major
          Found in src/ng/directive/input.js - About 4 hrs to fix

            Function initializeBinding has 101 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  forEach(bindings, function initializeBinding(definition, scopeName) {
                    var attrName = definition.attrName,
                    optional = definition.optional,
                    mode = definition.mode, // @, =, <, or &
                    lastValue,
            Severity: Major
            Found in src/ng/compile.js - About 4 hrs to fix

              File animation.js has 335 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              
              /* exported $$AnimationProvider */
              
              var $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {
              Severity: Minor
              Found in src/ngAnimate/animation.js - About 4 hrs to fix

                Function ngModule has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function ngModule($provide) {
                      // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.
                      $provide.provider({
                        $$sanitizeUri: $$SanitizeUriProvider
                      });
                Severity: Major
                Found in src/AngularPublic.js - About 4 hrs to fix

                  Function classDirective has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function classDirective(name, selector) {
                    name = 'ngClass' + name;
                    var indexWatchExpression;
                  
                    return ['$parse', function($parse) {
                  Severity: Major
                  Found in src/ng/directive/ngClass.js - About 4 hrs to fix

                    Function $http has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function $http(requestConfig) {
                    
                          if (!isObject(requestConfig)) {
                            throw minErr('$http')('badreq', 'Http request configuration must be an object.  Received: {0}', requestConfig);
                          }
                    Severity: Major
                    Found in src/ng/http.js - About 4 hrs to fix

                      Function $AnimateProvider has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var $AnimateProvider = ['$provide', /** @this */ function($provide) {
                        var provider = this;
                        var classNameFilter = null;
                        var customFilter = null;
                      
                      
                      Severity: Major
                      Found in src/ng/animate.js - About 4 hrs to fix

                        Function $process has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            $process: function(docs) {
                        
                              var ignoredBuilds = this.ignoredBuilds;
                              var currentVersion = require('../../../build/version.json');
                              var output = exec('yarn info angular versions --json', { silent: true }).stdout.split('\n')[0];
                        Severity: Major
                        Found in docs/config/processors/versions-data.js - About 3 hrs to fix

                          Function recurse has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                          Open

                            recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {
                              var left, right, self = this, args, expression, computed;
                              recursionFn = recursionFn || noop;
                              if (!skipWatchIdCheck && isDefined(ast.watchId)) {
                                intoId = intoId || this.nextId();
                          Severity: Minor
                          Found in src/ng/parse.js - About 3 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 findConstantAndWatchExpressions has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function findConstantAndWatchExpressions(ast, $filter, parentIsPure) {
                            var allConstants;
                            var argsToWatch;
                            var isStatelessFilter;
                          
                          
                          Severity: Minor
                          Found in src/ng/parse.js - About 3 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 recurse has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                          Open

                            recurse: function(ast, context, create) {
                              var left, right, self = this, args;
                              if (ast.input) {
                                return this.inputs(ast.input, ast.watchId);
                              }
                          Severity: Minor
                          Found in src/ng/parse.js - About 3 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 filters.js has 329 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          'use strict';
                          
                          var MAX_DIGITS = 22;
                          var DECIMAL_SEP = '.';
                          var ZERO_CHAR = '0';
                          Severity: Minor
                          Found in src/ng/filter/filters.js - About 3 hrs to fix

                            Function compileTemplateUrl has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function compileTemplateUrl(directives, $compileNode, tAttrs,
                                    $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {
                                  var linkQueue = [],
                                      afterTemplateNodeLinkFn,
                                      afterTemplateChildLinkFn,
                            Severity: Major
                            Found in src/ng/compile.js - About 3 hrs to fix

                              Function $CacheFactoryProvider has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function $CacheFactoryProvider() {
                              
                                this.$get = function() {
                                  var caches = {};
                              
                              
                              Severity: Major
                              Found in src/ng/cacheFactory.js - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language