Showing 4 of 4 total issues
Function getImage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
PixelScreen.prototype.getImage = function (name) {
if (!name) return this.image;
if (!this.screens[name]) return;
var screen = this.screens[name]
- 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 createBalancedChannels
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
PixelScreen.prototype.createBalancedChannels = function (inputArray, expectedChannels) {
// return channels and flatten or cut channels
// if we have a difference in no. of channels
var array = [];
for (var k = 0; k < inputArray.length; k++) {
- 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 createImageArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function createImageArray (width, height, channels) {
var array = [];
for (var i = 0; i < height; i++) {
array.push([]);
for (var j = 0; j < width; j++) {
- 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 arrayToDMX
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
PixelScreen.prototype.arrayToDMX = function (input) {
var dmx = [];
for (var i = 0; i < input.length; i++) {
for (var j = 0; j < input[i].length; j++) {
for (var k = 0; k < input[i][j].length; k++) {
- 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"