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
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 };
Function setupModuleLoader
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupModuleLoader(window) {
var $injectorMinErr = minErr('$injector');
var ngMinErr = minErr('ng');
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';
File route.js
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* global routeToRegExp: false */
/* global shallowCopy: false */
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) {
- Read upRead up
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);
- Read upRead up
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,
File ngOptions.js
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* exported ngOptionsDirective */
/* global jqLiteRemove */
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;
Function $get
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
function($$AnimateRunner, $rootScope) {
return {
enabled: noop,
on: noop,
off: noop,
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);
}
prototype
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
ASTCompiler.prototype = {
compile: function(ast) {
var self = this;
this.state = {
nextId: 0,
prototype
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
AST.prototype = {
ast: function(text) {
this.text = text;
this.tokens = this.lexer.lex(text);
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;
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) {
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
- Read upRead up
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);
- Read upRead up
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;
- Read upRead up
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: [],