spritejs/sprite-timeline

View on GitHub

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 = {};
Severity: Minor
Found in src/index.js - About 2 hrs to fix

    File index.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {createNowTime, formatDelay} from './utils';
    
    const _nowtime = createNowTime();
    
    const defaultOptions = {
    Severity: Minor
    Found in src/index.js - About 2 hrs to fix

      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,
      Severity: Minor
      Found in src/index.js - About 1 hr to fix

        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,
        Severity: Minor
        Found in src/index.js - About 1 hr to fix

        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 = {};
            }
        Severity: Minor
        Found in src/index.js - About 1 hr to fix

          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();
          Severity: Major
          Found in src/index.js - About 1 hr to fix

            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;
            Severity: Minor
            Found in src/index.js - About 55 mins to fix

            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 = {};
                }
            Severity: Minor
            Found in src/index.js - About 25 mins to fix

            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

            Severity
            Category
            Status
            Source
            Language