sverweij/mscgen_js

View on GitHub

Showing 13 of 33 total issues

File uistate.js has 302 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
msc {
  hscale="1.2";

  html [label="index.html", textbgcolor="#ddf"]
Severity: Minor
Found in src/script/interpreter/uistate.js - About 3 hrs to fix

    Function _setupEvents has 47 lines of code (exceeds 30 allowed). Consider refactoring.
    Open

    function _setupEvents () {
      window.__btn_anim_home.addEventListener('click',
        function () {
          home()
          gaga.g('send', 'event', 'anim_home', 'button')
    Severity: Minor
    Found in src/script/interpreter/animator.js - About 1 hr to fix

      Function render has 39 lines of code (exceeds 30 allowed). Consider refactoring.
      Open

      function render (pSource, pLanguage) {
        preRenderReset()
        try {
          var lAST = getASTBare(pSource, pLanguage)
          if (state.getDebug()) {
      Severity: Minor
      Found in src/script/interpreter/uistate.js - About 1 hr to fix

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

        function save (pState, pSourceToo) {
          var lSourceToo = typeof pSourceToo === 'undefined' ? true : pSourceToo
          var lState = {
            autorender: pState.getAutoRender(),
            mirrorEntities: pState.getMirrorEntities(),
        Severity: Minor
        Found in src/script/utl/store.js - About 1 hr 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 load has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        function load (pState, pSourceToo) {
          var lState = getState()
          var lSourceToo = typeof pSourceToo === 'undefined' ? true : pSourceToo
        
          if (lState) {
        Severity: Minor
        Found in src/script/utl/store.js - About 1 hr 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 processParams has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function processParams () {
          var lParams = queryString.parse(window.location.search)
          setupGA(maps.sanitizeBooleanesque(lParams.donottrack))
        
          uistate.setDebug(maps.sanitizeBooleanesque(lParams.debug))
        Severity: Minor
        Found in src/script/interpreter/param-actions.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

        Function g has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          g: function (pCommand, pEvent, pCategory, pAction, pLabel, pValue) {
        Severity: Minor
        Found in src/script/utl/gaga.js - About 45 mins to fix

          Function _g has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function _g (pCommand, pEvent, pCategory, pAction, pLabel, pValue) {
          Severity: Minor
          Found in src/script/utl/gaga.js - About 45 mins to fix

            Function sourceIsURLable has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function sourceIsURLable (pLocation, pSource, pLanguage, pMirrorEntities, pNamedStyle) {
            Severity: Minor
            Found in src/script/utl/exporter.js - About 35 mins to fix

              Function toLocationString has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                toLocationString: function (pLocation, pSource, pLanguage, pMirrorEntities, pNamedStyle) {
              Severity: Minor
              Found in src/script/utl/exporter.js - About 35 mins to fix

                Function source2LocationString has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function source2LocationString (pLocation, pSource, pLanguage, pMirrorEntities, pNamedStyle) {
                Severity: Minor
                Found in src/script/utl/exporter.js - About 35 mins to fix

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

                    ajax: function (pURL, pSuccessFunction, pErrorFunction) {
                      var lHttpRequest = new XMLHttpRequest()
                      lHttpRequest.onreadystatechange = function (pEvent) {
                        if (pEvent.target.readyState === XMLHttpRequest.DONE) {
                          if (lHttpRequest.status === 200) {
                  Severity: Minor
                  Found in src/script/utl/domutl.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

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

                  function render (pSource, pLanguage) {
                    preRenderReset()
                    try {
                      var lAST = getASTBare(pSource, pLanguage)
                      if (state.getDebug()) {
                  Severity: Minor
                  Found in src/script/interpreter/uistate.js - 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