angular/angular.js

View on GitHub

Showing 2,008 of 4,250 total issues

File resource.js has 307 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var $resourceMinErr = angular.$$minErr('$resource');

// Helper functions and regex to lookup a dotted path on an object
Severity: Minor
Found in src/ngResource/resource.js - About 3 hrs to fix

    File select.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    /* exported selectDirective, optionDirective */
    
    var noopNgModelController = { $setViewValue: noop, $render: noop };
    Severity: Minor
    Found in src/ng/directive/select.js - About 3 hrs to fix

      Function setupModuleLoader has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function setupModuleLoader(window) {
      
        var $injectorMinErr = minErr('$injector');
        var ngMinErr = minErr('ng');
      
      
      Severity: Major
      Found in src/loader.js - About 3 hrs to fix

        Function DataController has 83 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        app.controller('DataController', function DataController($scope) {
        
          this.init = function() {
            this.numberOfTodos = 1000;
            this.implementation = 'tableOptimized';
        Severity: Major
        Found in benchmarks/ng-class-bp/app.js - About 3 hrs to fix

          File route.js has 303 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          'use strict';
          
          /* global routeToRegExp: false */
          /* global shallowCopy: false */
          
          
          Severity: Minor
          Found in src/ngRoute/route.js - About 3 hrs to fix

            Function classDirective has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

            function classDirective(name, selector) {
              name = 'ngClass' + name;
              var indexWatchExpression;
            
              return ['$parse', function($parse) {
            Severity: Minor
            Found in src/ng/directive/ngClass.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 createDateInputType has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

            function createDateInputType(type, regexp, parseDate, format) {
              return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {
                badInputChecker(scope, element, attr, ctrl, type);
                baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
            
            
            Severity: Minor
            Found in src/ng/directive/input.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 collectDirectives has 81 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {
                  var nodeType = node.nodeType,
                      attrsMap = attrs.$attr,
                      match,
                      nodeName,
            Severity: Major
            Found in src/ng/compile.js - About 3 hrs to fix

              File ngOptions.js has 301 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              
              /* exported ngOptionsDirective */
              
              /* global jqLiteRemove */
              Severity: Minor
              Found in src/ng/directive/ngOptions.js - About 3 hrs to fix

                Function $$runValidators has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  $$runValidators: function(modelValue, viewValue, doneCallback) {
                    this.$$currentValidationRunId++;
                    var localValidationRunId = this.$$currentValidationRunId;
                    var that = this;
                
                
                Severity: Major
                Found in src/ng/directive/ngModel.js - About 3 hrs to fix

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

                         function($$AnimateRunner,   $rootScope) {
                      return {
                        enabled: noop,
                        on: noop,
                        off: noop,
                  Severity: Major
                  Found in src/ng/animate.js - About 3 hrs to fix

                    Function cacheFactory has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function cacheFactory(cacheId, options) {
                          if (cacheId in caches) {
                            throw minErr('$cacheFactory')('iid', 'CacheId \'{0}\' is already taken!', cacheId);
                          }
                    
                    
                    Severity: Major
                    Found in src/ng/cacheFactory.js - About 3 hrs to fix

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

                      ASTCompiler.prototype = {
                        compile: function(ast) {
                          var self = this;
                          this.state = {
                            nextId: 0,
                      Severity: Minor
                      Found in src/ng/parse.js - About 3 hrs to fix

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

                        AST.prototype = {
                          ast: function(text) {
                            this.text = text;
                            this.tokens = this.lexer.lex(text);
                        
                        
                        Severity: Minor
                        Found in src/ng/parse.js - About 3 hrs to fix

                          Function $httpBackend has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function $httpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {
                          
                              var xhr = new MockXhr(),
                                  expectation = expectations[0],
                                  wasExpected = false;
                          Severity: Major
                          Found in src/ngMock/angular-mocks.js - About 3 hrs to fix

                            Function createInternalInjector has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function createInternalInjector(cache, factory) {
                            
                                function getService(serviceName, caller) {
                                  if (cache.hasOwnProperty(serviceName)) {
                                    if (cache[serviceName] === INSTANTIATING) {
                            Severity: Major
                            Found in src/auto/injector.js - About 3 hrs to fix

                              Function $CoreAnimateCssProvider has a Cognitive Complexity of 22 (exceeds 5 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 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 formatNumber has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
                              
                                if (!(isString(number) || isNumber(number)) || isNaN(number)) return '';
                              
                                var isInfinity = !isFinite(number);
                              Severity: Minor
                              Found in src/ng/filter/filters.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 createEventHandler has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function createEventHandler(element, events) {
                                var eventHandler = function(event, type) {
                                  // jQuery specific api
                                  event.isDefaultPrevented = function() {
                                    return event.defaultPrevented;
                              Severity: Minor
                              Found in src/jqLite.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 generateKeywordsProcessor has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              module.exports = function generateKeywordsProcessor(log, readFilesProcessor) {
                                return {
                                  ignoreWordsFile: undefined,
                                  areasToSearch: ['api', 'guide', 'misc', 'error', 'tutorial'],
                                  propertiesToIgnore: [],
                              Severity: Major
                              Found in docs/config/processors/keywords.js - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language