angular/angular.js

View on GitHub

Showing 2,008 of 4,250 total issues

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

function baseExtend(dst, objs, deep) {
  var h = dst.$$hashKey;

  for (var i = 0, ii = objs.length; i < ii; ++i) {
    var obj = objs[i];
Severity: Minor
Found in src/Angular.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 start has 135 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      function start() {
        if (animationClosed) return;
        if (!node.parentNode) {
          close();
          return;
Severity: Major
Found in src/ngAnimate/animateCss.js - About 5 hrs to fix

    Function initializeDirectiveBindings has 134 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {
          var removeWatchCollection = [];
          var initialChanges = {};
          var changes;
    
    
    Severity: Major
    Found in src/ng/compile.js - About 5 hrs to fix

      Function Browser has 132 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function Browser(window, document, $log, $sniffer, $$taskTrackerFactory) {
        var self = this,
            location = window.location,
            history = window.history,
            setTimeout = window.setTimeout,
      Severity: Major
      Found in src/ng/browser.js - About 5 hrs to fix

        Function ngRepeatCompile has 131 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            compile: function ngRepeatCompile($element, $attr) {
              var expression = $attr.ngRepeat;
              var ngRepeatEndComment = $compile.$$createComment('end ngRepeat', expression);
        
              var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);
        Severity: Major
        Found in src/ng/directive/ngRepeat.js - About 5 hrs to fix

          Function $$AnimateRunnerFactoryProvider has 131 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var $$AnimateRunnerFactoryProvider = /** @this */ function() {
            this.$get = ['$q', '$sniffer', '$$animateAsyncRun', '$$isDocumentHidden', '$timeout',
                 function($q,   $sniffer,   $$animateAsyncRun,   $$isDocumentHidden,   $timeout) {
          
              var INITIAL_STATE = 0;
          Severity: Major
          Found in src/ng/animateRunner.js - About 5 hrs to fix

            Function name has 131 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                      Resource[name] = function(a1, a2, a3, a4) {
                        var params = {}, data, onSuccess, onError;
            
                        switch (arguments.length) {
                          case 4:
            Severity: Major
            Found in src/ngResource/resource.js - About 5 hrs to fix

              Function sendStoredFile has 129 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function sendStoredFile(request, response) {
                // Request paths will be URI-encoded, so we need to decode them to match the file names in the
                // storage bucket. Failing to do so will result in a 404 error from the bucket and `index.html`
                // will be returned instead.
                // Example of path requiring decoding: `.../input%5Btext%5D.html` --> `.../input[text].html`
              Severity: Major
              Found in scripts/code.angularjs.org-firebase/functions/index.js - About 5 hrs to fix

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

                       function($q,   $sniffer,   $$animateAsyncRun,   $$isDocumentHidden,   $timeout) {
                
                    var INITIAL_STATE = 0;
                    var DONE_PENDING_STATE = 1;
                    var DONE_COMPLETE_STATE = 2;
                Severity: Major
                Found in src/ng/animateRunner.js - About 5 hrs to fix

                  Function recurse has 126 lines of code (exceeds 25 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: Major
                  Found in src/ng/parse.js - About 5 hrs to fix

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

                          function($rootScope, $browser, $sniffer, $rootElement, $window) {
                        var $location,
                            LocationMode,
                            baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to ''
                            initialUrl = $browser.url(),
                    Severity: Major
                    Found in src/ng/location.js - About 4 hrs to fix

                      Function createHttpBackend has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {
                        // TODO(vojta): fix the signature
                        return function(method, url, post, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {
                          url = url || $browser.url();
                      
                      
                      Severity: Major
                      Found in src/ng/httpBackend.js - About 4 hrs to fix

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

                          this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) {
                            var startSymbolLength = startSymbol.length,
                                endSymbolLength = endSymbol.length,
                                escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'),
                                escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g');
                        Severity: Major
                        Found in src/ng/interpolate.js - About 4 hrs to fix

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

                          var $$CoreAnimateQueueProvider = /** @this */ function() {
                            var postDigestQueue = new NgMap();
                            var postDigestElements = [];
                          
                            this.$get = ['$$AnimateRunner', '$rootScope',
                          Severity: Minor
                          Found in src/ng/animate.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 copy has 114 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function copy(source, destination, maxDepth) {
                            var stackSource = [];
                            var stackDest = [];
                            maxDepth = isValidObjectMaxDepth(maxDepth) ? maxDepth : NaN;
                          
                          
                          Severity: Major
                          Found in src/Angular.js - About 4 hrs to fix

                            Function parseOptionsExpression has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function parseOptionsExpression(optionsExp, selectElement, scope) {
                            
                                var match = optionsExp.match(NG_OPTIONS_REGEXP);
                                if (!(match)) {
                                  throw ngOptionsMinErr('iexp',
                            Severity: Major
                            Found in src/ng/directive/ngOptions.js - About 4 hrs to fix

                              Function addSetValidityMethod has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function addSetValidityMethod(context) {
                                var clazz = context.clazz,
                                    set = context.set,
                                    unset = context.unset;
                              
                              
                              Severity: Minor
                              Found in src/ng/directive/form.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 $get has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                this.$get = ['$injector', '$$sanitizeUri', function($injector, $$sanitizeUri) {
                              
                                  var htmlSanitizer = function htmlSanitizer(html) {
                                    throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');
                                  };
                              Severity: Major
                              Found in src/ng/sce.js - About 4 hrs to fix

                                Function sendReq has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function sendReq(config, reqData) {
                                      var deferred = $q.defer(),
                                          promise = deferred.promise,
                                          cache,
                                          cachedResp,
                                Severity: Major
                                Found in src/ng/http.js - About 4 hrs to fix

                                  Function orderByFilter has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function orderByFilter($parse) {
                                    return function(array, sortPredicate, reverseOrder, compareFn) {
                                  
                                      if (array == null) return array;
                                      if (!isArrayLike(array)) {
                                  Severity: Major
                                  Found in src/ng/filter/orderBy.js - About 4 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language