Showing 300 of 562 total issues
Avoid deeply nested control flow statements. Open
Open
for (y = 0; y < splitClasses.length; y++) {
cssClass = splitClasses[y].trim();
if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) {
existingClasses += cssClass + ' ';
}
Avoid deeply nested control flow statements. Open
Open
if (tmp && tmp.parentHistoryId === hist.parentHistoryId) {
direction = DIRECTION_SWAP;
}
Avoid deeply nested control flow statements. Open
Open
if (!foundHistoryId) {
return true;
}
Function create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
create: function(navViewCtrl, viewLocals, enteringView, leavingView, renderStart, renderEnd) {
Function render
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
self.render = function(registerData, viewLocals, enteringView, leavingView, renderStart, renderEnd) {
Avoid deeply nested control flow statements. Open
Open
if (initHeight) viewportProperties.height = '0';
Avoid deeply nested control flow statements. Open
Open
if (initHeight) viewportProperties.height = '0';
Function rectContains
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
rectContains: function(x, y, x1, y1, x2, y2) {
Avoid deeply nested control flow statements. Open
Open
if (!self.__enableScrollX && self.__refreshHeight != null) {
// hide the refresher when it's behind the header bar in case of header transparency
if (scrollTop < 0) {
self.__refreshHidden = false;
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def __init__(self, email=None, password=None, display_name=None,
facebook=None, github=None, google=None, linkedin=None,
twitter=None, bitbucket=None):
if email:
self.email = email.lower()
- 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 (isArray(encoded)) {
result += map(encoded, encodeDashes).join("-");
} else {
result += encodeURIComponent(encoded);
}
Avoid deeply nested control flow statements. Open
Open
if (!self.__refreshActive) {
self.__startDeceleration(timeStamp);
}
Function start
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
start: function(stepCallback, verifyCallback, completedCallback, duration, easingMethod, root) {
Avoid deeply nested control flow statements. Open
Open
} else if (scrollTop > maxScrollTop) {
scrollTop = maxScrollTop;
} else {
Function bitbucket
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def bitbucket():
access_token_url = 'https://bitbucket.org/site/oauth2/access_token'
users_api_url = 'https://api.bitbucket.org/2.0/user'
auth_encoded = base64.b64encode(
"{0}:{1}".format(request.json['clientId'],
- 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
} else if (version == 7) {
//iPhone == 7.0 WebView
viewportProperties.height = DEVICE_HEIGHT;
}
Consider simplifying this complex logical expression. Open
Open
if ( !(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || element.attr('target')) ) {
// HACK: This is to allow ng-clicks to be processed before the transition is initiated:
var transition = $timeout(function() {
$state.go(ref.state, params, options);
});
Consider simplifying this complex logical expression. Open
Open
if ((isBackShown && isNavBackShown && isBackEnabled) !== isBackElementShown) {
isBackElementShown = isBackShown && isNavBackShown && isBackEnabled;
ele = getEle(BACK_BUTTON);
ele && ele.classList[ isBackElementShown ? 'remove' : 'add' ](HIDE);
}
Consider simplifying this complex logical expression. Open
Open
if (!self.options.freeze && scrollParent === self.__container) {
self.hintResize();
self.scrollBy(
(e.wheelDeltaX || e.deltaX || 0) / self.options.wheelDampen,
Consider simplifying this complex logical expression. Open
Open
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') {
Object.defineProperty(HTMLElement.prototype, 'classList', {
get: function() {
var self = this;
function update(fn) {