Showing 79 of 271 total issues
File Scroller.js
has 961 lines of code (exceeds 250 allowed). Consider refactoring. Open
var Control = require('../core/Control'),
Tween = require('../utils/Tween'),
Scrollable = require('./Scrollable'),
ScrollBar = require('./ScrollBar');
// LayoutAlignment = require('../../external/pixi-layout/src/layout/LayoutAlignment');
Function layout
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
TiledLayout.prototype.layout = function (items, maxWidth, maxHeight) {
var _rows = this._orientation === TiledLayout.ORIENTATION_ROWS;
if(items.length === 0) {
return [0, 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
File InputControl.js
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
var Skinable = require('../core/Skinable'),
InputWrapper = require('../utils/InputWrapper');
/**
* InputControl used for TextInput, TextArea and everything else that
Function layout
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
TiledLayout.prototype.layout = function (items, maxWidth, maxHeight) {
var _rows = this._orientation === TiledLayout.ORIENTATION_ROWS;
if(items.length === 0) {
return [0, 0];
}
File Scrollable.js
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
var Skinable = require('../core/Skinable'),
ScrollThumb = require('./ScrollThumb'),
SliderData = require('../utils/SliderData');
/**
Function refreshPageCount
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Scroller.prototype.refreshPageCount = function () {
if (this._snapToPages) {
var horizontalScrollRange = this._maxHorizontalScrollPosition - this._minHorizontalScrollPosition;
var roundedDownRange;
if (horizontalScrollRange === Number.POSITIVE_INFINITY) {
- 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 check
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def check(theme_assets):
themes = os.listdir(theme_assets)
for theme in themes:
scale_9_file = os.path.join(theme_assets, theme, theme+'_scale_9.json')
if not os.path.exists(scale_9_file):
- 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 main
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def main():
parser = argparse.ArgumentParser(
description='Convert theme from feathers for gown.js.')
parser.add_argument('feathers_path', type=str,
help='path to feathers directory')
- 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 handleEvent
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Button.prototype.handleEvent = function(type) {
if (!this._enabled) {
return;
}
if (type === Button.DOWN || type === Button.TOUCHSTART) {
- 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 a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function mouseWheelSupport(stage, enable) {
var canvas = stage.canvas;
if (enable || enable === undefined) {
if (GOWN._mouseWheelHandler !== undefined) {
return;
- 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 ScaleContainer
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ScaleContainer(texture, rect, middleWidth, centerHeight) {
PIXI.Container.call( this );
/**
* The rectangle with position and dimensions of the center piece.
Function parseData
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
ThemeParser.prototype.parseData = function(data) {
this.hoverSkin = data.hoverSkin;
this.thumbSkin = data.thumbSkin;
this.themeScale = data.themeScale || 1.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 LoginDialog
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
var LoginDialog = function() {
GOWN.Control.call(this);
// background
this.bg = new GOWN.shapes.Rect(0x515151, 0.7, 200, 350, 5);
this.addChild(this.bg);
Function exports
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(destination, source) {
for (var key in source) {
if (source.hasOwnProperty(key)) {
if(key === 'defineProperty') {
for (var name in source[key]) {
- 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 checkForDrag
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Scroller.prototype.checkForDrag = function (currentTouch) {
if (this._isScrollingStopped) {
return;
}
var horizontalMoved = Math.abs(currentTouch.x - this._startTouch.x);
- 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 Scroller
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Scroller(theme) {
Control.call(this);
this.setTheme(theme);
this.interactive = true;
Function Application
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Application(config, screenMode, parentId, width, height, renderer, stage) {
screenMode = screenMode || Application.SCREEN_MODE_RESIZE;
var fullscreen = false;
var element = document.getElementById(parentId);
if (screenMode === Application.SCREEN_MODE_RESIZE) {
Function Application
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function Application(config, screenMode, parentId, width, height, renderer, stage) {
screenMode = screenMode || Application.SCREEN_MODE_RESIZE;
var fullscreen = false;
var element = document.getElementById(parentId);
if (screenMode === Application.SCREEN_MODE_RESIZE) {
- 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 updateTransform
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
updateTransform: function() {
var wt = this.worldTransform;
var scaleX = 1;
var scaleY = 1;
- 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 itemRendererChangeHandler
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
List.prototype.itemRendererChangeHandler = function(itemRenderer, value) {
// TODO: update selected item
var i;
this._selectedIndices.length = 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"