wahanegi/vibereport

View on GitHub
app/javascript/components/UI/rich-text/rich-text.js

Summary

Maintainability
A
3 hrs
Test Coverage

RichText has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

export default class RichText {
  
  static filtrationById = ( separatorArr, mainArr ) => {
    if ( !separatorArr?.length ) {return mainArr}
    return mainArr.filter(item=> !separatorArr.some(({ id }) => id === item.id))
Severity: Minor
Found in app/javascript/components/UI/rich-text/rich-text.js - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

          if (str[cursorPosition] === "&" && str[cursorPosition + 1] === "n" && str[cursorPosition + 2] === "b"
              && str[cursorPosition + 3] === "s" && str[cursorPosition + 4] === "p" && str[cursorPosition + 5] === ";") {
            str = str.slice(0, cursorPosition) + str.slice(cursorPosition + 6);
          } else {
            str = str.slice(0, cursorPosition) + str.slice(cursorPosition + 1);
    Severity: Major
    Found in app/javascript/components/UI/rich-text/rich-text.js - About 40 mins to fix

      Avoid too many return statements within this function.
      Open

                return 0;
      Severity: Major
      Found in app/javascript/components/UI/rich-text/rich-text.js - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status