Showing 8 of 10 total issues
Function createRenderSchedule
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
export function createRenderSchedule(x, y, width, height, options = {}) {
const opts = Object.create(options);
if (opts.pixelSize === undefined) {
opts.pixelSize = 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 play
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
static play(x, y, width, height, options = {}) {
const opts = objectAssign({
pixelSize: Math.floor(height / 10),
bitCrash: 7,
pixelated: true,
- 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 play
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static play(x, y, width, height, options = {}) {
const opts = objectAssign({
pixelSize: Math.floor(height / 10),
bitCrash: 7,
pixelated: true,
Function createRenderSchedule
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function createRenderSchedule(x, y, width, height, options = {}) {
const opts = Object.create(options);
if (opts.pixelSize === undefined) {
opts.pixelSize = 1;
}
Function promise
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const promise = new Promise((resolve) => {
let frame = 0;
const render = () => {
if (promise.disabled) {
return resolve(context);
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(element, options = {}) {
super();
/**
* @public
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const render = () => {
if (promise.disabled) {
return resolve(context);
}
Function createRenderSchedule
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
export function createRenderSchedule(x, y, width, height, options = {}) {