nus-mtp/sashimi-note

View on GitHub
sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js

Summary

Maintainability
F
2 wks
Test Coverage

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 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

    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 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 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

        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

          Function AMTparseIexpr has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

          function AMTparseIexpr(str) {
            let sym2;
            let node;
            let result;
            str = AMremoveCharsAndBlanks(str, 0);
          Severity: Minor
          Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - 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 AMprocessNodeR has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function AMprocessNodeR(n, linebreaks) {
            let mtch;
            let str;
            let arr;
            let frg;

            Function AMTparseIexpr has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function AMTparseIexpr(str) {
              let sym2;
              let node;
              let result;
              str = AMremoveCharsAndBlanks(str, 0);

              Function AMposition has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

              function AMposition(arr, str, n) {
              // return position >=n where str appears or would be inserted
              // assumes arr is sorted
                let i;
                if (n===0) {

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

              function AMparseMath(str) {
               // DLMOD to remove  , which editor adds on multiple spaces
                str = str.replace(/( |\u00a0| )/g, '');
                str = str.replace(/>/g, '>');
                str = str.replace(/&lt;/g, '<');

                Consider simplifying this complex logical expression.
                Open

                        if (st==='^' || st==='_' || st==='/' || st==='|' || st===','
                           || (symbol.input.length===1 && symbol.input.match(/\w/) && st!=='(')) {
                          return [`{${AMTgetTeXsymbol(symbol)}}`, str];
                        } else {
                          node = `{${AMTgetTeXsymbol(symbol)}{${result[0]}}}`;
                Severity: Critical
                Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if ((n.nodeType!==8 || linebreaks) &&
                      n.parentNode.nodeName!=='form' && n.parentNode.nodeName!=='FORM' &&
                      n.parentNode.nodeName!=='textarea' && n.parentNode.nodeName!=='TEXTAREA' &&
                      n.parentNode.nodeName!=='pre' && n.parentNode.nodeName!=='PRE') {
                        str = n.nodeValue;
                  Severity: Critical
                  Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 1 hr to fix

                    Function AMTremoveBrackets has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function AMTremoveBrackets(node) {
                      let st;
                      if (node.charAt(0)==='{' && node.charAt(node.length-1)==='}') {
                        let leftchop = 0;
                    
                    

                      Function AMprocessNode has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function AMprocessNode(n, linebreaks, spanclassAM) {
                        let frag;
                        let st;
                        if (spanclassAM!=null) {
                          frag = document.getElementsByTagName('span');

                      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 AMstrarr2docFrag has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function AMstrarr2docFrag(arr, linebreaks) {
                        const newFrag=document.createDocumentFragment();
                        let expr = false;
                        for (let i=0; i<arr.length; i+=1) {
                          if (expr) newFrag.appendChild(AMparseMath(arr[i]));

                      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

                                if (mxnestingd===0 && pos.length>0 && matrix) {
                                  for (i=0; i<pos.length-1; i+=1) {
                                    let subarr;
                                    if (i>0) mxout += '\\\\';
                                    if (i===0) {
                      Severity: Major
                      Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                  for (i=1; i<len-1; i+=1) {
                                    if (newFrag.charAt(i)===left) mxnestingd+=1;
                                    if (newFrag.charAt(i)===right) {
                                      mxnestingd-=1;
                                      if (mxnestingd===0 && newFrag.charAt(i+2)===',' && newFrag.charAt(i+3)==='{') {
                        Severity: Major
                        Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                    if (matrix) { newFrag = mxout; }
                          Severity: Major
                          Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                      if (config.AMusedelimiter2) {
                                        arr[i]=arr[i].replace(/AMescape2/g, config.AMdelimiter2).replace(/AMescape1/g, config.AMdelimiter1);
                                      } else {
                                        arr[i]=arr[i].replace(/AMescape1/g, config.AMdelimiter1);
                                      }
                            Severity: Major
                            Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 45 mins to fix

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

                              function AMparseMath(str) {
                               // DLMOD to remove &nbsp;, which editor adds on multiple spaces
                                str = str.replace(/(&nbsp;|\u00a0|&#160;)/g, '');
                                str = str.replace(/&gt;/g, '>');
                                str = str.replace(/&lt;/g, '<');
                              Severity: Minor
                              Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - 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

                              Consider simplifying this complex logical expression.
                              Open

                                if ((integ && k>1) || k>2) {
                                  st = str.slice(0, k-1);
                                  tagst = 'mn';
                                } else {
                                  k = 2;
                              Severity: Major
                              Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 40 mins to fix

                                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 [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 [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 [`\\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

                                                      Avoid too many return statements within this function.
                                                      Open

                                                            if (result[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 [`\\cancel{${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 (result[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 [node, 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 [`{\\left${symbol.rewriteleftright[0]}${result[0]}\\right${symbol.rewriteleftright[1]}}`, result[1]];
                                                                Severity: Major
                                                                Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                                  if (subpos[pos[i]].length===1) {
                                                                                    subarr = [newFrag.substr(pos[i]+7, pos[i+1]-pos[i]-15)];
                                                                                  } else {
                                                                                    subarr = [newFrag.substring(pos[i]+7, subpos[pos[i]][1])];
                                                                                    for (let j=2; j<subpos[pos[i]].length; j+=1) {
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 685..693

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 195.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                                } else if (subpos[pos[i]].length===1) { // var subarr = newFrag.substr(pos[i]+8,pos[i+1]-pos[i]-16).split(',');
                                                                                  subarr = [newFrag.substr(pos[i]+8, pos[i+1]-pos[i]-16)];
                                                                                } else {
                                                                                  subarr = [newFrag.substring(pos[i]+8, subpos[pos[i]][1])];
                                                                                  for (let j=2; j<subpos[pos[i]].length; j+=1) {
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 676..684

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 195.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                        } else if (typeof symbol.invisible == 'boolean' && symbol.invisible) { node = `{\\left.${result[0]}}`; } else {
                                                                          node = `{\\left${AMTgetTeXsymbol(symbol)}${result[0]}}`;
                                                                        }
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 774..776

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 77.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                          if (typeof symbol.invisible == 'boolean' && symbol.invisible) { node = `{${result[0]}}`; } else {
                                                                            node = `{${AMTgetTeXsymbol(symbol)}${result[0]}}`;
                                                                          }
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 777..779

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 77.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                        } else if (st==='\\rbrace}') {
                                                                          node = `{${node.substr(leftchop)}`;
                                                                          node = `${node.substr(0, node.length-14)}}`;
                                                                        }
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 440..446

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 61.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                        if (st==='\\right)}' || st==='\\right]}' || st==='\\right.}') {
                                                                          node = `{${node.substr(leftchop)}`;
                                                                          node = `${node.substr(0, node.length-8)}}`;
                                                                        } else if (st==='\\rbrace}') {
                                                                          node = `{${node.substr(leftchop)}`;
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 443..446

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 61.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                    while (st>='0' && st<='9' && k<=str.length) {
                                                                      st = str.slice(k, k+1);
                                                                      k+=1;
                                                                    }
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 524..527

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 58.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                        while (st>='0' && st<='9' && k<=str.length) {
                                                                          st = str.slice(k, k+1);
                                                                          k+=1;
                                                                        }
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 515..518

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 58.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                              if (newFrag.charAt(i)===']' || newFrag.charAt(i)===')' || newFrag.charAt(i)==='}') { mxanynestingd-=1; }
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 654..654

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 58.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                              if (newFrag.charAt(i)==='[' || newFrag.charAt(i)==='(' || newFrag.charAt(i)==='{') { mxanynestingd+=1; }
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 655..655

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 58.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                        if (result[0] == null) { // show box in place of missing argument
                                                                          result[0] = '{}';
                                                                        } else result[0] = AMTremoveBrackets(result[0]);
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 560..562

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 48.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                      if (result[0] == null) { // show box in place of missing argument
                                                                        result[0] = '{}';
                                                                      } else result[0] = AMTremoveBrackets(result[0]);
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 614..616

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 48.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                                    subarr = [newFrag.substr(pos[i]+7, pos[i+1]-pos[i]-15)];
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 686..686

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 45.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Open

                                                                                  subarr = [newFrag.substr(pos[i]+8, pos[i+1]-pos[i]-16)];
                                                                  sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 677..677

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 45.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  There are no issues that match your filters.

                                                                  Category
                                                                  Status