CrazySquirrel/AnimationFrame

View on GitHub

Showing 20 of 20 total issues

Function set has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

    set: (v) => {
      if (!root._AnimationFrame) {
        /**
         * root._AnimationFrame was empty and can be set
         */
Severity: Minor
Found in lib/AnimationFrame.ts - About 7 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

File AnimationFrame.ts has 390 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use strict";
/**
 * Import interfaces
 */
import IWindow from "../interfaces/IWindow";
Severity: Minor
Found in lib/AnimationFrame.ts - About 5 hrs to fix

Function parallelWatch has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

  public parallelWatch(): void {
    try {
      /**
       * If stack exist, it is an object and it is contains methods
       */
Severity: Minor
Found in lib/AnimationFrame.ts - About 2 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 set has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    set: (v) => {
      if (!root._AnimationFrame) {
        /**
         * root._AnimationFrame was empty and can be set
         */
Severity: Major
Found in lib/AnimationFrame.ts - About 2 hrs to fix

Function serialWatch has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

  public serialWatch(): void {
    try {
      /**
       * If stack exist, it is an object and it is contains methods
       */
Severity: Minor
Found in lib/AnimationFrame.ts - About 2 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 serialWatch has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public serialWatch(): void {
    try {
      /**
       * If stack exist, it is an object and it is contains methods
       */
Severity: Minor
Found in lib/AnimationFrame.ts - About 1 hr to fix

Function parallelWatch has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public parallelWatch(): void {
    try {
      /**
       * If stack exist, it is an object and it is contains methods
       */
Severity: Minor
Found in lib/AnimationFrame.ts - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

              if (
                  objCall &&
                  typeof objCall === "object" &&
                  objCall.context &&
                  objCall.callback &&
Severity: Critical
Found in lib/AnimationFrame.ts - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

                if (
                    objCall &&
                    typeof objCall === "object" &&
                    objCall.context &&
                    objCall.callback &&
Severity: Critical
Found in lib/AnimationFrame.ts - About 1 hr to fix

Avoid deeply nested control flow statements.
Open

                if (
                    objCall &&
                    typeof objCall === "object" &&
                    objCall.context &&
                    objCall.callback &&
Severity: Major
Found in lib/AnimationFrame.ts - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

              if (
                  objCall &&
                  typeof objCall === "object" &&
                  objCall.context &&
                  objCall.callback &&
Severity: Major
Found in lib/AnimationFrame.ts - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if (root._oldAnimationFrame.parallelStack.hasOwnProperty(ID)) {
              root._AnimationFrame.parallelSubscribe({
                callback: root._oldAnimationFrame.parallelStack[ID].callback,
                context: root._oldAnimationFrame.parallelStack[ID].context,
                params: root._oldAnimationFrame.parallelStack[ID].params,
Severity: Major
Found in lib/AnimationFrame.ts - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if (root._oldAnimationFrame.serialStack.hasOwnProperty(ID)) {
              root._AnimationFrame.serialSubscribe({
                callback: root._oldAnimationFrame.serialStack[ID].callback,
                context: root._oldAnimationFrame.serialStack[ID].context,
                params: root._oldAnimationFrame.serialStack[ID].params,
Severity: Major
Found in lib/AnimationFrame.ts - About 45 mins to fix

Function version_lt has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function version_lt(v1, v2) {
  if (
      typeof v1 === "string" &&
      typeof v2 === "string"
  ) {
Severity: Minor
Found in lib/AnimationFrame.ts - About 45 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 prepareParams has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  public prepareParams(_params): boolean|string {
    if (
        typeof _params === "object"
    ) {
      /**
Severity: Minor
Found in lib/AnimationFrame.ts - About 45 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

Avoid deeply nested control flow statements.
Open

          for (const ID in root._oldAnimationFrame.stack) {
            if (root._oldAnimationFrame.stack.hasOwnProperty(ID)) {
              root._AnimationFrame.subscribe(
                  root._oldAnimationFrame.stack[ID].context,
                  root._oldAnimationFrame.stack[ID].callback,
Severity: Major
Found in lib/AnimationFrame.ts - About 45 mins to fix

debug Regular Expression Denial of Service
Open

        "debug": {
          "version": "2.2.0",
          "dependencies": {
            "ms": {
              "version": "0.7.1"
Severity: Minor
Found in npm-shrinkwrap.json by nodesecurity

Regular Expression Denial of Service

Overview:

The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the o formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.

Recommendation:

Upgrade to version 2.6.9 or greater if you are on the 2.6.x series or 3.1.0 or greater.

debug Regular Expression Denial of Service
Open

        "debug": {
          "version": "2.2.0",
          "dependencies": {
            "ms": {
              "version": "0.7.1"
Severity: Minor
Found in npm-shrinkwrap.json by nodesecurity

Regular Expression Denial of Service

Overview:

The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the o formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.

Recommendation:

Upgrade to version 2.6.9 or greater if you are on the 2.6.x series or 3.1.0 or greater.

Function parallelUnsubscribe has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  public parallelUnsubscribe(ID: string): boolean {
    try {
      if (typeof ID === "string") {
        /**
         * If required method exist in the stack
Severity: Minor
Found in lib/AnimationFrame.ts - 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

Function serialUnsubscribe has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  public serialUnsubscribe(ID: string): boolean {
    try {
      if (typeof ID === "string") {
        /**
         * If required method exist in the stack
Severity: Minor
Found in lib/AnimationFrame.ts - 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