immaterial-design/immaterial-design-ripple

View on GitHub

Showing 8 of 10 total issues

Function createRenderSchedule has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

export function createRenderSchedule(x, y, width, height, options = {}) {
  const opts = Object.create(options);
  if (opts.pixelSize === undefined) {
    opts.pixelSize = 1;
  }
Severity: Minor
Found in src/utility.js - About 3 hrs 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 play has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

  static play(x, y, width, height, options = {}) {
    const opts = objectAssign({
      pixelSize: Math.floor(height / 10),
      bitCrash: 7,
      pixelated: true,
Severity: Minor
Found in src/index.js - About 3 hrs 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 play has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  static play(x, y, width, height, options = {}) {
    const opts = objectAssign({
      pixelSize: Math.floor(height / 10),
      bitCrash: 7,
      pixelated: true,
Severity: Minor
Found in src/index.js - About 1 hr to fix

    Function createRenderSchedule has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function createRenderSchedule(x, y, width, height, options = {}) {
      const opts = Object.create(options);
      if (opts.pixelSize === undefined) {
        opts.pixelSize = 1;
      }
    Severity: Minor
    Found in src/utility.js - About 1 hr to fix

      Function promise has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          const promise = new Promise((resolve) => {
            let frame = 0;
            const render = () => {
              if (promise.disabled) {
                return resolve(context);
      Severity: Minor
      Found in src/index.js - About 1 hr to fix

        Function constructor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          constructor(element, options = {}) {
            super();
        
            /**
            * @public
        Severity: Minor
        Found in src/index.js - About 1 hr to fix

          Function render has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                const render = () => {
                  if (promise.disabled) {
                    return resolve(context);
                  }
          
          
          Severity: Minor
          Found in src/index.js - About 1 hr to fix

            Function createRenderSchedule has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            export function createRenderSchedule(x, y, width, height, options = {}) {
            Severity: Minor
            Found in src/utility.js - About 35 mins to fix
              Severity
              Category
              Status
              Source
              Language