angular/angular.js

View on GitHub

Showing 2,008 of 4,250 total issues

prototype has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

ASTInterpreter.prototype = {
  compile: function(ast) {
    var self = this;
    findConstantAndWatchExpressions(ast, self.$filter);
    var assignable;
Severity: Minor
Found in src/ng/parse.js - About 3 hrs to fix

    Function compile has 75 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        compile: function(elem, attr) {
          if (attr.hasOwnProperty(ARIA_DISABLE_ATTR)) return;
    
          var shape = getShape(attr, elem);
    
    
    Severity: Major
    Found in src/ngAria/aria.js - About 3 hrs to fix

      File form.js has 291 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      
      /* global -nullFormCtrl, -PENDING_CLASS, -SUBMITTED_CLASS
       */
      var nullFormCtrl = {
      Severity: Minor
      Found in src/ng/directive/form.js - About 3 hrs to fix

        Function baseInputType has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
          var type = lowercase(element[0].type);
        
          // In composition mode, users are still inputting intermediate text buffer,
          // hold the listener until composition is done.
        Severity: Major
        Found in src/ng/directive/input.js - About 2 hrs to fix

          File shared.js has 289 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          'use strict';
          
          var ELEMENT_NODE = 1;
          var COMMENT_NODE = 8;
          
          
          Severity: Minor
          Found in src/ngAnimate/shared.js - About 2 hrs to fix

            Function compileNodes has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective,
                                        previousCompileContext) {
                  var linkFns = [],
                      // `nodeList` can be either an element's `.childNodes` (live NodeList)
                      // or a jqLite/jQuery collection or an array
            Severity: Major
            Found in src/ng/compile.js - About 2 hrs to fix

              Function $ControllerProvider has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function $ControllerProvider() {
                var controllers = {};
              
                /**
                 * @ngdoc method
              Severity: Major
              Found in src/ng/controller.js - About 2 hrs to fix

                Function outputLocale has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function outputLocale(localeInfo, localeID) {
                  var fallBackID = localeID.match(/[A-Za-z]+/)[0],
                      localeObj = localeInfo[localeID],
                      fallBackObj = localeInfo[fallBackID];
                
                
                Severity: Major
                Found in i18n/src/closureI18nExtractor.js - About 2 hrs to fix

                  Function addSetValidityMethod has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function addSetValidityMethod(context) {
                    var clazz = context.clazz,
                        set = context.set,
                        unset = context.unset;
                  
                  
                  Severity: Major
                  Found in src/ng/directive/form.js - About 2 hrs to fix

                    Function module has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        return function module(name, requires, configFn) {
                    
                          var info = {};
                    
                          var assertNotHasOwnProperty = function(name, context) {
                    Severity: Major
                    Found in src/loader.js - About 2 hrs to fix

                      File angularFiles.js has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      'use strict';
                      
                      var angularFiles = {
                        'angularSrc': [
                          'src/minErr.js',
                      Severity: Minor
                      Found in angularFiles.js - About 2 hrs to fix

                        Function ngIncludeDirective has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                          function($templateRequest,   $anchorScroll,   $animate) {
                          return {
                            restrict: 'ECA',
                            priority: 400,
                            terminal: true,
                        Severity: Major
                        Found in src/ng/directive/ngInclude.js - About 2 hrs to fix

                          Function registerOption has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            self.registerOption = function(optionScope, optionElement, optionAttrs, interpolateValueFn, interpolateTextFn) {
                          
                              if (optionAttrs.$attr.ngValue) {
                                // The value attribute is set by ngValue
                                var oldVal, hashedVal;
                          Severity: Major
                          Found in src/ng/directive/select.js - About 2 hrs to fix

                            Function ngMessageDirectiveFactory has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function ngMessageDirectiveFactory(isDefault) {
                              return ['$animate', function($animate) {
                                return {
                                  restrict: 'AE',
                                  transclude: 'element',
                            Severity: Major
                            Found in src/ngMessages/messages.js - About 2 hrs to fix

                              Function post has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      post: function(scope, elem, attr, ngModel) {
                                        var needsTabIndex = shouldAttachAttr('tabindex', 'tabindex', elem, false);
                              
                                        function ngAriaWatchModelValue() {
                                          return ngModel.$modelValue;
                              Severity: Major
                              Found in src/ngAria/aria.js - About 2 hrs to fix

                                Function ngIfDirective has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                                Open

                                var ngIfDirective = ['$animate', '$compile', function($animate, $compile) {
                                  return {
                                    multiElement: true,
                                    transclude: 'element',
                                    priority: 600,
                                Severity: Minor
                                Found in src/ng/directive/ngIf.js - About 2 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 ngPluralizeDirective has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                                Open

                                var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale, $interpolate, $log) {
                                  var BRACE = /{}/g,
                                      IS_WHEN = /^when(Minus)?(.+)$/;
                                
                                  return {
                                Severity: Minor
                                Found in src/ng/directive/ngPluralize.js - About 2 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 $LogProvider has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function $LogProvider() {
                                  var debug = true,
                                      self = this;
                                
                                  /**
                                Severity: Minor
                                Found in src/ng/log.js - About 2 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 $HttpParamSerializerJQLikeProvider has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function $HttpParamSerializerJQLikeProvider() {
                                  /**
                                   * @ngdoc service
                                   * @name $httpParamSerializerJQLike
                                   *
                                Severity: Minor
                                Found in src/ng/http.js - About 2 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 $$AnimateJsDriverProvider has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                                Open

                                var $$AnimateJsDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) {
                                  $$animationProvider.drivers.push('$$animateJsDriver');
                                  this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {
                                    return function initDriverFn(animationDetails) {
                                      if (animationDetails.from && animationDetails.to) {
                                Severity: Minor
                                Found in src/ngAnimate/animateJsDriver.js - About 2 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