Showing 8 of 8 total issues
Timeline
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Timeline {
constructor(options, parent) {
if(options instanceof Timeline) {
parent = options;
options = {};
File index.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {createNowTime, formatDelay} from './utils';
const _nowtime = createNowTime();
const defaultOptions = {
Function _setTimer
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
[_setTimer](handler, time, id = Symbol('timerID')) {
time = formatDelay(time);
const timer = this[_timers].get(id);
let delay,
Function _setTimer
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
[_setTimer](handler, time, id = Symbol('timerID')) {
time = formatDelay(time);
const timer = this[_timers].get(id);
let delay,
- 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 constructor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(options, parent) {
if(options instanceof Timeline) {
parent = options;
options = {};
}
Consider simplifying this complex logical expression. Open
if(delay === 0
|| heading !== false && (to - from) * delay <= 0
|| from <= endTime && endTime <= to
|| from >= endTime && endTime >= to) {
handler();
Function seekTimeMark
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
seekTimeMark(entropy) {
const timeMark = this[_timeMark];
let l = 0,
r = timeMark.length - 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(options, parent) {
if(options instanceof Timeline) {
parent = options;
options = {};
}
- 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"