nus-mtp/sashimi-note

View on GitHub

Showing 117 of 330 total issues

Function AMTparseExpr has a Cognitive Complexity of 155 (exceeds 5 allowed). Consider refactoring.
Open

function AMTparseExpr(str, rightbracket) {
  let symbol;
  let node;
  let result;
  let i;
Severity: Minor
Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 3 days 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 ASCIIMathTeXImg.js has 888 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
ASCIIMathTeXImg.js
Based on ASCIIMathML, Version 1.4.7 Aug 30, 2005, (c) Peter Jipsen http://www.chapman.edu/~jipsen
Modified with TeX conversion for IMG rendering Sept 6, 2006 (c) David Lippman http://www.pierce.ctc.edu/dlippman
  Updated to match ver 2.2 Mar 3, 2014
Severity: Major
Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 2 days to fix

    Function sqlCommands has 315 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function sqlCommands() {
      this.linkDatabaseToIndexedDB = function linkDatabaseToIndexedDB(databaseName) {
        return new Promise((resolve, reject) => {
          databaseName = resolveSQLInjection(databaseName);
          const databaseRequestStr = stringManipulator.stringConcat(
    Severity: Major
    Found in sashimi-webapp/src/database/sql-related/sqlCommands.js - About 1 day to fix

      File sqlCommands.spec.js has 673 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import SqlCommands from 'src/database/sql-related/sqlCommands';
      import SqlArray from 'src/database/generated-data/sqlArray';
      import StringManipulator from 'src/database/stringManipulation';
      import exceptions from 'src/database/exceptions';
      import defaultFeatureFile from 'src/../static/data/features.txt';

        Function AMTparseSexpr has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
        Open

        function AMTparseSexpr(str) { // parses str and returns [node,tailstr]
          let symbol;
          let node;
          let result;
          let i;
        Severity: Minor
        Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 1 day 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 sqlCommands.js has 528 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import StringManipulator from 'src/database/stringManipulation';
        import constants from 'src/database/constants';
        import DateTime from 'src/database/generated-data/dateTime';
        import exceptions from 'src/database/exceptions';
        
        
        Severity: Major
        Found in sashimi-webapp/src/database/sql-related/sqlCommands.js - About 1 day to fix

          Function AMprocessNodeR has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

          function AMprocessNodeR(n, linebreaks) {
            let mtch;
            let str;
            let arr;
            let frg;
          Severity: Minor
          Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 5 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 hideShowBlock has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
          Open

          function hideShowBlock(state, startLine, endLine, silent) {
            let nextLine; // next line counter, to keep track of line number
            let token;  // token for use to pass into renderer to generate HTML
            let category = ''; // variable to store conditional hiding for different document types
            let hasCategory = false;

          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 AMTparseSexpr has 137 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function AMTparseSexpr(str) { // parses str and returns [node,tailstr]
            let symbol;
            let node;
            let result;
            let i;
          Severity: Major
          Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 5 hrs to fix

            Function AMTparseExpr has 119 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function AMTparseExpr(str, rightbracket) {
              let symbol;
              let node;
              let result;
              let i;
            Severity: Major
            Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 4 hrs to fix

              Function default has 88 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function(navInstance) {
                // Event handlers
                this.eventFn = {
                  gesture: {
                    dragstart(event) {

                Function hideShowBlock has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function hideShowBlock(state, startLine, endLine, silent) {
                  let nextLine; // next line counter, to keep track of line number
                  let token;  // token for use to pass into renderer to generate HTML
                  let category = ''; // variable to store conditional hiding for different document types
                  let hasCategory = false;

                  Function regexHelper has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function regexHelper(diff, exp, act) {
                    const ignoredAttr = ['id', 'marker-end', 'x1', 'x2', 'x', 'y1', 'y2', 'y', 'width',
                      'height', 'd', 'dy', 'r', 'style', 'viewBox', 'transform', 'points'];
                    const missedArray = [];
                  
                  
                  Severity: Major
                  Found in sashimi-webapp/test/unit/specs/logic/diagramsRenderer.spec.js - About 3 hrs to fix

                    Function addDomStyling has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    DocumentNavigator.prototype.addDomStyling = function addDomStyling() {
                      // Reset parent height to force DOM relayout
                      // [1] Initialise layout properties
                      const containerReference = this.el.container;
                      const containerRefStyle = domUtils.getComputedStyle(containerReference);
                    Severity: Major
                    Found in sashimi-webapp/src/logic/inputHandler/DocumentNavigator/index.js - About 3 hrs to fix

                      Function AMgetSymbol has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function AMgetSymbol(str) {
                      // return maximal initial substring of str that appears in names
                      // return null if there is none
                        let k = 0; // new pos
                        let j = 0; // old pos
                      Severity: Minor
                      Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.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 AMTremoveBrackets has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function AMTremoveBrackets(node) {
                        let st;
                        if (node.charAt(0)==='{' && node.charAt(node.length-1)==='}') {
                          let leftchop = 0;
                      
                      
                      Severity: Minor
                      Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.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

                      File diagramsRenderer.spec.js has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import domCompare from 'dom-compare';
                      import DiagramsRenderer from 'src/logic/renderer/diagrams';
                      import documentPackager from 'src/logic/documentPackager';
                      import diagramsInput from './reference/diagrams/diagramsInput.txt';
                      import diagramsRenderedOutput from './reference/diagrams/diagramsRenderedOutput.txt';
                      Severity: Minor
                      Found in sashimi-webapp/test/unit/specs/logic/diagramsRenderer.spec.js - About 3 hrs to fix

                        Function default has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export default function(navInstance) {
                          // Event handlers
                          this.eventFn = {
                            gesture: {
                              dragstart(event) {

                        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 process has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        DiagramsRenderer.prototype.process = function process(ele) {
                          const observerConfig = { childList: true };
                          // get all pre tags with class name = sequence
                          const seqDiagrams = ele.querySelectorAll('pre.sequence');
                          // get all pre tags with class name = flow
                        Severity: Major
                        Found in sashimi-webapp/src/logic/renderer/diagrams.js - About 2 hrs to fix

                          Function AMgetSymbol has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function AMgetSymbol(str) {
                          // return maximal initial substring of str that appears in names
                          // return null if there is none
                            let k = 0; // new pos
                            let j = 0; // old pos
                          Severity: Major
                          Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language