Showing 79 of 271 total issues
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 Rect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function Rect(color, alpha, width, height, radius) {
Function childIsRenderAble
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
LayoutGroup.prototype.childIsRenderAble = function(child, x, y, width, height) {
Function drawCursor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
InputControl.prototype.drawCursor = function () {
// TODO: use Tween instead!
if (this.hasFocus || this._mouseDown) {
var time = Date.now();
- 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 refreshRenderers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
List.prototype.refreshRenderers = function () {
//TODO: update only new renderer
// see ListDataViewPort --> refreshInactieRenderers
this._itemRenderer.length = 0;
if (this._dataProvider && this.viewPort) {
- 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 get_feathers_themes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_feathers_themes(feathers_themes_path):
theme_data = {}
themes = os.listdir(feathers_themes_path)
# find Base<name>.as-Files to extract scale_9_grid values
- 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 setCursorPos
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
InputWrapper.setCursorPos = function (pos) {
if (InputWrapper.hiddenInput) {
var elem = InputWrapper.hiddenInput;
if(elem.createTextRange) {
var range = elem.createTextRange();
- 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 onResize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ResizeManager.prototype.onResize = function (_event) {
if (!this.element && this.fullscreen === false) {
// we assume you have a fixed size?!
// TODO: do not add resizeManager in the first place?
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
Avoid too many return
statements within this function. Open
return false;
Function textToPixelPos
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
InputControl.prototype.textToPixelPos = function(textPos, position) {
var lines = this.getLines();
var x = 0;
for (var y = 0; y < lines.length; y++) {
var lineLength = lines[y].length;
- 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 handlePendingScroll
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Scroller.prototype.handlePendingScroll = function () {
if (!isNaN(this.pendingHorizontalScrollPosition) || !isNaN(this.pendingVerticalScrollPosition)) {
this.throwTo(this.pendingHorizontalScrollPosition, this.pendingVerticalScrollPosition, this.pendingScrollDuration);
this.pendingHorizontalScrollPosition = NaN;
this.pendingVerticalScrollPosition = NaN;
- 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 refreshMask
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Scroller.prototype.refreshMask = function () {
if (!this._clipContent) {
if (this._viewPort) {
this._viewPort.mask = null;
}
- 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 set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
set: function(inverse) {
if (inverse !== this._inverse) {
this._inverse = inverse;
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 addItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ToggleGroup.prototype.addItem = function(item) {
if (this._items.indexOf(item) === -1) {
this._items.push(item);
item.on(ToggleButton.CHANGE, this._toggleChanged, this);
// new radio button is selected, unselect the old one
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
redraw: function() {
// remove last skin after new one has been added
// (just before rendering, otherwise we would see nothing for a frame)
if (this._lastSkin) {
//this.removeChild(this._lastSkin);
- 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 setMaxLength
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
InputWrapper.setMaxLength = function(length) {
if (InputWrapper.hiddenInput) {
if (!length || length < 0) {
InputWrapper.hiddenInput.removeAttribute('maxlength');
} else {
- 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 textToLinePos
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
TextArea.prototype.textToLinePos = function(textPos, position) {
var lines = this.getLines();
var x = 0;
for (var y = 0; y < lines.length; y++) {
var lineLength = lines[y].length;
- 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 updateDimensions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Button.prototype.updateDimensions = function() {
var width = this.worldWidth;
var height = this.worldHeight;
if (this.hitArea) {
this.hitArea.width = width;
- 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 fromSkin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Skinable.prototype.fromSkin = function(name, callback) {
var skin;
if (this.skinCache[name]) {
skin = this.skinCache[name];
} else {
- 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"