Showing 79 of 271 total issues
Function refreshMinAndMaxScrollPositions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Scroller.prototype.refreshMinAndMaxScrollPositions = function () {
var visibleViewPortWidth = this.actualWidth - (this._viewPortOffset.left + this._viewPortOffset.right);
var visibleViewPortHeight = this.actualHeight - (this._viewPortOffset.top + this._viewPortOffset.bottom);
if (this.explicitPageWidth !== this.explicitPageWidth) { //isNaN
this.actualPageWidth = visibleViewPortWidth;
- 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 layout
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
LayoutAlignment.prototype.layout = function(items, maxWidth, maxHeight) {
var _hor = (this.alignment === LayoutAlignment.HORIZONTAL_ALIGNMENT);
// width/height the current layout takes
var width = 0;
- 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 mouseWheelSupport
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mouseWheelSupport(stage, enable) {
var canvas = stage.canvas;
if (enable || enable === undefined) {
if (GOWN._mouseWheelHandler !== undefined) {
return;
Function _positionTilable
has 40 lines of code (exceeds 25 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);
Function applyPercent
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
LayoutAlignment.prototype.applyPercent = function(items, explicit) {
var _hor = (this.alignment === LayoutAlignment.HORIZONTAL_ALIGNMENT);
var itemCount = items.length;
var remaining = explicit;
- 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 layout
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
LayoutAlignment.prototype.layout = function(items, maxWidth, maxHeight) {
var _hor = (this.alignment === LayoutAlignment.HORIZONTAL_ALIGNMENT);
// width/height the current layout takes
var width = 0;
Function checkForDrag
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Scroller.prototype.checkForDrag = function (currentTouch) {
if (this._isScrollingStopped) {
return;
}
var horizontalMoved = Math.abs(currentTouch.x - this._startTouch.x);
Function ScaleContainer
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function ScaleContainer(texture, rect, middleWidth, centerHeight) {
PIXI.Container.call( this );
/**
* The rectangle with position and dimensions of the center piece.
- 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 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
AutoComplete.prototype.drawResults = function (text) {
if (text.length < this._minAutoCompleteLength) {
this.results = [];
} else {
var lowerCaseText = text.toString().toLowerCase();
Function refreshPageCount
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Scroller.prototype.refreshPageCount = function () {
if (this._snapToPages) {
var horizontalScrollRange = this._maxHorizontalScrollPosition - this._minHorizontalScrollPosition;
var roundedDownRange;
if (horizontalScrollRange === Number.POSITIVE_INFINITY) {
Function refreshMinAndMaxScrollPositions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Scroller.prototype.refreshMinAndMaxScrollPositions = function () {
var visibleViewPortWidth = this.actualWidth - (this._viewPortOffset.left + this._viewPortOffset.right);
var visibleViewPortHeight = this.actualHeight - (this._viewPortOffset.top + this._viewPortOffset.bottom);
if (this.explicitPageWidth !== this.explicitPageWidth) { //isNaN
this.actualPageWidth = visibleViewPortWidth;
Function throwToPage
has 33 lines of code (exceeds 25 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;
Function handleEvent
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Button.prototype.handleEvent = function(type) {
if (!this._enabled) {
return;
}
if (type === Button.DOWN || type === Button.TOUCHSTART) {
Function applyPercent
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
LayoutAlignment.prototype.applyPercent = function(items, explicit) {
var _hor = (this.alignment === LayoutAlignment.HORIZONTAL_ALIGNMENT);
var itemCount = items.length;
var remaining = explicit;
Function updateTransform
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateTransform: function() {
var wt = this.worldTransform;
var scaleX = 1;
var scaleY = 1;
Function parseData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
ThemeParser.prototype.parseData = function(data) {
this.hoverSkin = data.hoverSkin;
this.thumbSkin = data.thumbSkin;
this.themeScale = data.themeScale || 1.0;
Function createInput
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
InputWrapper.createInput = function() {
if (!InputWrapper.hiddenInput) {
var input = document.createElement('input');
input.type = 'text';
input.tabindex = -1;
Function _drawSelectionBg
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
TextArea.prototype._drawSelectionBg = function (fromTextPos, toTextPos) {
this.textToPixelPos(fromTextPos, this._fromPos);
this.textToPixelPos(toTextPos, this._toPos);
this.selectionBg.beginFill(0x0080ff);
Function refreshScrollSteps
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Scroller.prototype.refreshScrollSteps = function () {
if (this.explicitHorizontalScrollStep !== this.explicitHorizontalScrollStep) //isNaN
{
if (this._viewPort) {
this.actualHorizontalScrollStep = this._viewPort.horizontalScrollStep;
- 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 throwTo
has a Cognitive Complexity of 10 (exceeds 5 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');
- 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"