angular/angular.js

View on GitHub

Showing 2,008 of 4,250 total issues

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

       function($injector,   $$AnimateRunner,   $$jqLite) {

    var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
         // $animateJs(element, 'enter');
    return function(element, event, classes, options) {
Severity: Major
Found in src/ngAnimate/animateJs.js - About 1 day to fix

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

      Function equals has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
      Open

      function equals(o1, o2) {
        if (o1 === o2) return true;
        if (o1 === null || o2 === null) return false;
        // eslint-disable-next-line no-self-compare
        if (o1 !== o1 && o2 !== o2) return true; // NaN === 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 $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

        Function createInjector has 212 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function createInjector(modulesToLoad, strictDi) {
          strictDi = (strictDi === true);
          var INSTANTIATING = {},
              providerSuffix = 'Provider',
              path = [],
        Severity: Major
        Found in src/auto/injector.js - About 1 day to fix

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

          function $ControllerProvider() {
            var controllers = {};
          
            /**
             * @ngdoc method
          Severity: Minor
          Found in src/ng/controller.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 createHttpBackendMock has 204 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
            var definitions = [],
                expectations = [],
                matchLatestDefinition = false,
                responses = [],
          Severity: Major
          Found in src/ngMock/angular-mocks.js - About 1 day to fix

            Function SelectController has 201 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    ['$element', '$scope', /** @this */ function($element, $scope) {
            
              var self = this,
                  optionsMap = new NgMap();
            
            
            Severity: Major
            Found in src/ng/directive/select.js - About 1 day to fix

              File animateQueue.js has 483 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              
              var NG_ANIMATE_ATTR_NAME = 'data-ng-animate';
              var NG_ANIMATE_PIN_DATA = '$ngAnimatePin';
              var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animateProvider) {
              Severity: Minor
              Found in src/ngAnimate/animateQueue.js - About 7 hrs to fix

                Function $ParseProvider has 187 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function $ParseProvider() {
                  var cache = createMap();
                  var literals = {
                    'true': true,
                    'false': false,
                Severity: Major
                Found in src/ng/parse.js - About 7 hrs to fix

                  Function $$AnimateCssDriverProvider has 187 lines of code (exceeds 25 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: Major
                  Found in src/ngAnimate/animateCssDriver.js - About 7 hrs to fix

                    Function exports has 185 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function(config, specificOptions) {
                      config.set({
                        frameworks: ['jasmine'],
                        autoWatch: true,
                        logLevel: config.LOG_INFO,
                    Severity: Major
                    Found in karma-shared.conf.js - About 7 hrs to fix

                      Function $$AnimateRunnerFactoryProvider has a Cognitive Complexity of 47 (exceeds 5 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: Minor
                      Found in src/ng/animateRunner.js - About 7 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 resourceFactory has 181 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            function resourceFactory(url, paramDefaults, actions, options) {
                              var route = new Route(url, options);
                      
                              actions = extend({}, provider.defaults.actions, actions);
                      
                      
                      Severity: Major
                      Found in src/ngResource/resource.js - About 7 hrs to fix

                        File Gruntfile.js has 467 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        'use strict';
                        
                        var serveFavicon = require('serve-favicon');
                        var serveStatic = require('serve-static');
                        var serveIndex = require('serve-index');
                        Severity: Minor
                        Found in Gruntfile.js - About 7 hrs to fix

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

                                 function($animateCss,   $rootScope,   $$AnimateRunner,   $rootElement,   $sniffer,   $$jqLite,   $document) {
                          
                              // only browsers that support these properties can render animations
                              if (!$sniffer.animations && !$sniffer.transitions) return noop;
                          
                          
                          Severity: Major
                          Found in src/ngAnimate/animateCssDriver.js - About 7 hrs to fix

                            Function queueAnimation has 173 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function queueAnimation(originalElement, event, initialOptions) {
                                  // we always make a copy of the options since
                                  // there should never be any side effects on
                                  // the input data when running `$animateCss`.
                                  var options = copy(initialOptions);
                            Severity: Major
                            Found in src/ngAnimate/animateQueue.js - About 6 hrs to fix

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

                                this.$get = ['$filter', function($filter) {
                                  var noUnsafeEval = csp().noUnsafeEval;
                                  var $parseOptions = {
                                        csp: noUnsafeEval,
                                        literals: copy(literals),
                              Severity: Major
                              Found in src/ng/parse.js - About 6 hrs to fix

                                Function MockHttpExpectation has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function MockHttpExpectation(expectedMethod, expectedUrl, expectedData, expectedHeaders,
                                                             expectedKeys) {
                                
                                  this.data = expectedData;
                                  this.headers = expectedHeaders;
                                Severity: Minor
                                Found in src/ngMock/angular-mocks.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 ngOptionsPostLink has 167 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function ngOptionsPostLink(scope, selectElement, attr, ctrls) {
                                
                                      var selectCtrl = ctrls[0];
                                      var ngModelCtrl = ctrls[1];
                                      var multiple = attr.multiple;
                                Severity: Major
                                Found in src/ng/directive/ngOptions.js - About 6 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language