Showing 246 of 804 total issues
Avoid deeply nested control flow statements. Open
Open
if(module.is.searchSelection()) {
module.remove.searchTerm();
}
Avoid deeply nested control flow statements. Open
Open
if(settings.selectOnKeydown && module.is.single()) {
module.set.selectedItem($nextItem);
}
Avoid deeply nested control flow statements. Open
Open
if(isChecked) {
values[name] = value || true;
}
else {
values[name] = false;
Avoid deeply nested control flow statements. Open
Open
if(!event.shiftKey) {
module.verbose('Selecting next label');
$label.removeClass(className.active);
}
else {
Avoid deeply nested control flow statements. Open
Open
if(hasActiveLabel) {
module.verbose('Removing active labels');
if(isLastLabel) {
if(isSearch && !isFocusedOnSearch) {
module.focusSearch();
Avoid deeply nested control flow statements. Open
Open
else if(module.is.bottom() ) {
// top edge
if( (scroll.bottom - element.height) <= element.top) {
module.debug('Bottom fixed rail has reached top of container');
Avoid deeply nested control flow statements. Open
Open
if( scroll.top <= element.top ) {
module.debug('Jumped from bottom fixed to top fixed, most likely used home/end button');
module.setInitialPosition();
}
else {
Function getPath
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
getPath: function(file, directory) {
var
configPath,
walk = function(directory) {
var
- 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
Avoid deeply nested control flow statements. Open
Open
if( scroll.top <= element.top ) {
module.debug('Fixed element reached top of container');
module.setInitialPosition();
}
else if( (element.height + scroll.top - elementScroll) >= context.bottom ) {
Function easeOutQuad
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
easeOutQuad: function (x, t, b, c, d) {
Function sendMsg
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function sendMsg(height,width,triggerEvent,msg,targetOrigin) {
Function trigger
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {
Function easeOutQuad
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
easeOutQuad: function (x, t, b, c, d) {
Avoid too many return
statements within this function. Open
Open
return $.extend({}, $.fn.transition.settings, {
animation : animation,
onComplete : duration
});
Avoid too many return
statements within this function. Open
Open
return settings.on;
Avoid too many return
statements within this function. Open
Open
return true;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return $.extend({}, $.fn.transition.settings, {
animation : animation
});
Avoid too many return
statements within this function. Open
Open
return true;
Avoid too many return
statements within this function. Open
Open
return true;