Showing 371 of 463 total issues
Function invoke
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function invoke(fn, self, locals){
var args = [],
$inject = annotate(fn),
length, i,
key;
Function ngPluralizeDirective
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interpolate) {
var BRACE = /{}/g;
return {
restrict: 'EA',
link: function(scope, element, attr) {
Function compile
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
compile: function(element, attr) {
if (isUndefined(attr.value)) {
var interpolateFn = $interpolate(element.text(), true);
if (!interpolateFn) {
attr.$set('value', element.text());
Function bootstrap
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bootstrap(element, modules) {
var doBootstrap = function() {
element = jqLite(element);
modules = modules || [];
modules.unshift(['$provide', function($provide) {
Function JQLitePatchJQueryRemove
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function JQLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) {
var originalJqFn = jQuery.fn[name];
originalJqFn = originalJqFn.$original || originalJqFn;
removePatch.$original = originalJqFn;
jQuery.fn[name] = removePatch;
Function toggleClass
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
toggleClass: function( value, stateVal ) {
var type = typeof value;
if ( typeof stateVal === "boolean" && type === "string" ) {
return stateVal ? this.addClass( value ) : this.removeClass( value );
Function removeClass
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
removeClass: function( value ) {
var classes, elem, cur, clazz, j,
i = 0,
len = this.length,
proceed = arguments.length === 0 || typeof value === "string" && value;
Function addClass
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addClass: function( value ) {
var classes, elem, cur, clazz, j,
i = 0,
len = this.length,
proceed = typeof value === "string" && value;
Function $get
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function($injector, $interpolate, $exceptionHandler, $http, $templateCache, $parse,
$controller, $rootScope, $document) {
Function $AnchorScrollProvider
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function $AnchorScrollProvider() {
var autoScrollingEnabled = true;
this.disableAutoScrolling = function() {
Function finish
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
finish: function( type ) {
if ( type !== false ) {
type = type || "fx";
}
return this.each(function() {
Function bind
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Function.prototype.bind = function bind(that) { // .length is 1
// 1. Let Target be the this value.
var target = this;
// 2. If IsCallable(Target) is false, throw a TypeError exception.
if (typeof target != "function") {
Function MockHttpExpectation
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function MockHttpExpectation(method, url, data, headers) {
this.data = data;
this.headers = headers;
Function readInfo
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
fs.readFile(path.join(__dirname, "README.md"), "utf8", function readInfo(exception, source) {
if (exception) {
console.log(exception);
} else {
// Read the project page template.
- 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 cookies
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
cookies: function(name, value) {
if (name) {
if (value == undefined) {
delete this.cookieHash[name];
} else {
- 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 $new
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$new: function(isolate) {
var Child,
child;
if (isFunction(isolate)) {
Function readNumber
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function readNumber() {
var number = "";
var start = index;
while (index < text.length) {
var ch = lowercase(text.charAt(index));
Function pre
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
pre: function(scope, formElement, attr, controller) {
if (!attr.action) {
// we can't use jq events because if a form is destroyed during submission the default
// action is not prevented. see #1238
//
Function fix
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
Function propFilter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function propFilter( props, specialEasing ) {
var index, name, easing, value, hooks;
// camelCase, specialEasing and expand cssHook pass
for ( index in props ) {