angular/angular.js

View on GitHub

Showing 2,008 of 4,250 total issues

Function ngTranscludeDirective has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var ngTranscludeDirective = ['$compile', function($compile) {
  return {
    restrict: 'EAC',
    compile: function ngTranscludeCompile(tElement) {

Severity: Minor
Found in src/ng/directive/ngTransclude.js - About 1 hr to fix

    Function LocationHashbangUrl has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {
    
      parseAbsoluteUrl(appBase, this);
    
    
    
    Severity: Minor
    Found in src/ng/location.js - About 1 hr to fix

      Function $TimeoutProvider has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function $TimeoutProvider() {
        this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler',
             function($rootScope,   $browser,   $q,   $$q,   $exceptionHandler) {
      
          var deferreds = {};
      Severity: Minor
      Found in src/ng/timeout.js - About 1 hr to fix

        Function dump has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        angular.mock.dump = function(object) {
          return serialize(object);
        
          function serialize(object) {
            var out;
        Severity: Minor
        Found in src/ngMock/angular-mocks.js - About 1 hr to fix

          Function resolveElementClasses has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function resolveElementClasses(existing, toAdd, toRemove) {
            var ADD_CLASS = 1;
            var REMOVE_CLASS = -1;
          
            var flags = {};
          Severity: Minor
          Found in src/ngAnimate/shared.js - About 1 hr to fix

            Function processAllVersionsResponse has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  function processAllVersionsResponse(versions) {
            
                    var latestMap = {};
            
                    // When the docs are built on a tagged commit, yarn info won't include the latest release,
            Severity: Minor
            Found in docs/config/processors/versions-data.js - About 1 hr to fix

              Function link has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  link: function(scope, element, attr) {
                    var numberExp = attr.count,
                        whenExp = attr.$attr.when && element.attr(attr.$attr.when), // we have {{}} in attrs
                        offset = attr.offset || 0,
                        whens = scope.$eval(whenExp) || {},
              Severity: Minor
              Found in src/ng/directive/ngPluralize.js - About 1 hr to fix

                Function ngSwitchDirective has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var ngSwitchDirective = ['$animate', '$compile', function($animate, $compile) {
                  return {
                    require: 'ngSwitch',
                
                    // asks for $scope to fool the BC controller module
                Severity: Minor
                Found in src/ng/directive/ngSwitch.js - About 1 hr to fix

                  Function ngModelDirective has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var ngModelDirective = ['$rootScope', function($rootScope) {
                    return {
                      restrict: 'A',
                      require: ['ngModel', '^?form', '^?ngModelOptions'],
                      controller: NgModelController,
                  Severity: Minor
                  Found in src/ng/directive/ngModel.js - About 1 hr to fix

                    Function $CoreAnimateCssProvider has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var $CoreAnimateCssProvider = function() {
                      this.$get = ['$$rAF', '$q', '$$AnimateRunner', function($$rAF, $q, $$AnimateRunner) {
                    
                        return function(element, initialOptions) {
                          // all of the animation functions should create
                    Severity: Minor
                    Found in src/ng/animateCss.js - About 1 hr to fix

                      Function start has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              start: function() {
                                if (runner) {
                                  return runner;
                                }
                      
                      
                      Severity: Minor
                      Found in src/ngAnimate/animateJs.js - About 1 hr to fix

                        Function readString has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                          readString: function(quote) {
                            var start = this.index;
                            this.index++;
                            var string = '';
                            var rawString = quote;
                        Severity: Minor
                        Found in src/ng/parse.js - About 1 hr 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 isValidForStep has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function isValidForStep(viewValue, stepBase, step) {
                          // At this point `stepBase` and `step` are expected to be non-NaN values
                          // and `viewValue` is expected to be a valid stringified number.
                          var value = Number(viewValue);
                        
                        
                        Severity: Minor
                        Found in src/ng/directive/input.js - About 1 hr 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 readNumber has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                          readNumber: function() {
                            var number = '';
                            var start = this.index;
                            while (this.index < this.text.length) {
                              var ch = lowercase(this.text.charAt(this.index));
                        Severity: Minor
                        Found in src/ng/parse.js - About 1 hr 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 primary has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                          primary: function() {
                            var primary;
                            if (this.expect('(')) {
                              primary = this.filterChain();
                              this.consume(')');
                        Severity: Minor
                        Found in src/ng/parse.js - About 1 hr 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 $$TestabilityProvider has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function $$TestabilityProvider() {
                          this.$get = ['$rootScope', '$browser', '$location',
                               function($rootScope,   $browser,   $location) {
                        
                            /**
                        Severity: Minor
                        Found in src/ng/testability.js - About 1 hr 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 bindJQuery has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function bindJQuery() {
                          var originalCleanData;
                        
                          if (bindJQueryFired) {
                            return;
                        Severity: Minor
                        Found in src/Angular.js - About 1 hr 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 ruleInAngularExpression has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                        MessageFormatParser.prototype.ruleInAngularExpression = function ruleInAngularExpression() {
                          var match = this.searchRe(INTERESTING_OPERATORS_RE);
                          var position;
                          if (match == null) {
                            if (this.angularOperatorStack.length === 0) {
                        Severity: Minor
                        Found in src/ngMessageFormat/messageFormatParser.js - About 1 hr 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 createDateParser has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function createDateParser(regexp, mapping) {
                          return function(iso, previousDate) {
                            var parts, map;
                        
                            if (isDate(iso)) {
                        Severity: Minor
                        Found in src/ng/directive/input.js - About 1 hr to fix

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

                            this.$get = ['$parse', '$sceDelegate', function(
                                          $parse,   $sceDelegate) {
                              // Support: IE 9-11 only
                              // Prereq: Ensure that we're not running in IE<11 quirks mode.  In that mode, IE < 11 allow
                              // the "expression(javascript expression)" syntax which is insecure.
                          Severity: Minor
                          Found in src/ng/sce.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language