nus-mtp/sashimi-note

View on GitHub

Showing 117 of 330 total issues

Function rename has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

Folder.prototype.rename = function rename(newFolderName) {
  if (!(this instanceof Folder)) {
    throw new Error(ERROR_NOT_FOLDER_INSTANCE);
  }

Severity: Minor
Found in sashimi-webapp/src/logic/filemanager/data/folder.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

Avoid too many return statements within this function.
Open

        return true;

    Avoid too many return statements within this function.
    Open

      return true;

      Avoid too many return statements within this function.
      Open

            return [`{\\quad\\text{${symbol.input}}\\quad}`, str];
      Severity: Major
      Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return storage.renameFile(this.id, newFileName)
            .then(() => {
              const oldFileName = this.name;
              this.name = newFileName;
              this.path = this.path.replace(oldFileName, newFileName);
        Severity: Major
        Found in sashimi-webapp/src/logic/filemanager/data/file.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return [symbol.output, str];
          Severity: Major
          Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return DO_NOTHING;
            Severity: Major
            Found in sashimi-webapp/src/logic/renderer/core.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return [newFrag, str];
              Severity: Major
              Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                          return [node, result[1]];
                Severity: Major
                Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return [node, result[1]];
                  Severity: Major
                  Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return false;

                      Avoid too many return statements within this function.
                      Open

                            return BREAK_PAGE;
                      Severity: Major
                      Found in sashimi-webapp/src/logic/renderer/core.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return new Promise((resolve, reject) => reject(ERROR_SAME_FOLDER_NAME));
                        Severity: Major
                        Found in sashimi-webapp/src/logic/filemanager/data/folder.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return storage.renameFolder(this.id, newFolderName)
                              .then(() => {
                                const oldFolderName = this.name;
                                this.name = newFolderName;
                                this.path = this.path.replace(oldFolderName, newFolderName);
                          Severity: Major
                          Found in sashimi-webapp/src/logic/filemanager/data/folder.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return [`\\sqrt{${result[0]}}`, result[1]];
                            Severity: Major
                            Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    if (result2[0]==null) return [`{${AMTgetTeXsymbol(symbol)}}`, str];
                              Severity: Major
                              Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return [`{${AMTgetTeXsymbol(symbol)}}`, str];
                                Severity: Major
                                Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return [`${AMTgetTeXsymbol(symbol)}{${result[0]}}`, result[1]];
                                  Severity: Major
                                  Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return [`{${AMTgetTeXsymbol(symbol)}{${result[0]}}}`, result[1]];
                                    Severity: Major
                                    Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                            return [newFrag, result2[1]];
                                      Severity: Major
                                      Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language