Showing 79 of 271 total issues
Function move
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ScrollThumb.prototype.move = function(x, y) {
if (this.scrollable.direction === GOWN.Scrollable.HORIZONTAL) {
if (isNaN(x)) {
return false;
}
- 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 applyFixedPercent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
LayoutAlignment.prototype.applyFixedPercent = function(items, explicit, alignment) {
var itemCount = items.length;
var i, item, itemPercent;
for (i = 0; i < itemCount; i++) {
item = items[i];
- 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 throwToPage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Scroller.prototype.throwToPage = function (targetHorizontalPageIndex, targetVerticalPageIndex, duration) {
duration = duration || 0.5;
var targetHorizontalScrollPosition = this._horizontalScrollPosition;
if (targetHorizontalPageIndex >= this._minHorizontalPageIndex) {
targetHorizontalScrollPosition = this.actualPageWidth * targetHorizontalPageIndex;
- 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 skinFromData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
ThemeParser.prototype.skinFromData = function(skinData, data) {
if (skinData.type === 'texture') {
var scale9;
if (skinData.scale9 && skinData.scale9 in data.grids) {
scale9 = this.getScale9(data.grids[skinData.scale9]);
Function throwTo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Scroller.prototype.throwTo = function (targetHorizontalScrollPosition, targetVerticalScrollPosition, duration) {
duration = duration || 500;
var verticalScrollPosition = this._throwToTween(targetHorizontalScrollPosition, 'horizontal');
var horizontalScrollPosition = this._throwToTween(targetVerticalScrollPosition, 'vertical');
Function refreshMask
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Scroller.prototype.refreshMask = function () {
if (!this._clipContent) {
if (this._viewPort) {
this._viewPort.mask = null;
}
Function _updateProgressSkin
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Scrollable.prototype._updateProgressSkin = function() {
if (!this.progressSkin) {
return;
}
if(this.direction === Scrollable.HORIZONTAL) {
Consider simplifying this complex logical expression. Open
if (this.verticalScrollBar && (this._measureViewPort || useActualBounds)) {
var scrollerHeight = useActualBounds ? this.actualHeight : this._explicitHeight;
var totalHeight = this._viewPort.height + this._viewPortOffset.top + this._viewPortOffset.bottom;
this._hasVerticalScrollBar =
forceScrollBars || this._verticalScrollPolicy === Scroller.SCROLL_POLICY_ON ||
Function _updateProgressSkin
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Scrollable.prototype._updateProgressSkin = function() {
if (!this.progressSkin) {
return;
}
if(this.direction === Scrollable.HORIZONTAL) {
- 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 _positionTilable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
ScaleContainer.prototype._positionTilable = function() {
// left / middle / right width
var lw = this.rect.x;
var mw = this.rect.width;
var rw = this.frame.width - (mw + lw);
- 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 drawResults
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
AutoComplete.prototype.drawResults = function (text) {
if (text.length < this._minAutoCompleteLength) {
this.results = [];
} else {
var lowerCaseText = text.toString().toLowerCase();
- 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 Application
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function Application(config, screenMode, parentId, width, height, renderer, stage) {
Function calculateViewPortOffsetsForFixedVerticalScrollBar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Scroller.prototype.calculateViewPortOffsetsForFixedVerticalScrollBar = function (forceScrollBars, useActualBounds) {
forceScrollBars = forceScrollBars || false;
useActualBounds = useActualBounds || false;
if (this.verticalScrollBar && (this._measureViewPort || useActualBounds)) {
var scrollerHeight = useActualBounds ? this.actualHeight : this._explicitHeight;
- 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
if (isinstance(value, dict)):
data.setdefault(key, value)
data[key].update(user_data[key])
else:
data[key] = value
Function Arrow
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function Arrow(color, alpha, tailWidth, tailHeight, width, height) {
Function pixelToTextPos
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
InputControl.prototype.pixelToTextPos = function(pixelPos) {
var textPos = 0;
var lines = this.getLines();
// calculate current line we are in
var currentLine = Math.min(
- 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 skinFromData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
ThemeParser.prototype.skinFromData = function(skinData, data) {
if (skinData.type === 'texture') {
var scale9;
if (skinData.scale9 && skinData.scale9 in data.grids) {
scale9 = this.getScale9(data.grids[skinData.scale9]);
- 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 redraw
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Scrollable.prototype.redraw = function() {
if (this.thumbFactoryInvalid) {
this.createThumb();
this.thumbFactoryInvalid = false;
}
- 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
if (data.configurable === undefined) {
// We change our default case, so that we can
// overwrite properties later on
data.configurable = true;
}
Function Line
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function Line(color, alpha, width, height, lineWidth, reverse) {