Parnswir/tie

View on GitHub

Showing 4 of 10 total issues

Function draw has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  draw (time) {
    if (!this.timeToDraw(time)) {
      requestAnimationFrame(this.draw.bind(this));
    } else {
      this.createEvent('beforeDraw', this);
Severity: Minor
Found in src/pipeline.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 _loadNested has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const _loadNested = async function (obj, maxDepth) {
  for (let property in obj) {
    if (obj.hasOwnProperty(property) && typeof(obj[property]) === 'object') {
      if (obj[property][JSONLoader.LOAD_PROPERTY()]) {
        let child = await _load(obj[property][JSONLoader.LOAD_PROPERTY()], maxDepth - 1);
Severity: Minor
Found in src/JSONLoader.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 execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  execute(options, engine, player) {
    const {blocking, executor} = this._actions[options.type] || {blocking: false, executor: noop};
    if (executor) {
      if (options.next) {
        if (blocking) {
Severity: Minor
Found in src/action.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 drawMessages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  drawMessages () {
    if (this._textMessages.length > 0) {
      this.engine.pause();
      const text = this._textMessages.splice(0, 1)[0];
      this.textMessage.innerHTML = text;
Severity: Minor
Found in src/extensions/TextOutput.js - About 35 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