FelixMcFelix/laughing-ironman

View on GitHub

Showing 24 of 59 total issues

Function VM has a Cognitive Complexity of 257 (exceeds 5 allowed). Consider refactoring.
Open

MVM.VM = function(glctx, manager, codeStore, debugMode) {

    /*
    *    Struct layouts
    *    
Severity: Minor
Found in src/MVM/MVM.js - About 5 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

Function VM has 576 lines of code (exceeds 25 allowed). Consider refactoring.
Open

MVM.VM = function(glctx, manager, codeStore, debugMode) {

    /*
    *    Struct layouts
    *    
Severity: Major
Found in src/MVM/MVM.js - About 2 days to fix

    Function interpret has 524 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        this.interpret = function() {
            if(this.dead === true){
                return;
            }
    
    
    Severity: Major
    Found in src/MVM/MVM.js - About 2 days to fix

      File MVM.js has 629 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
      * Sketch Virtual Machine
      * Darren Findlay
      *
      * 15th January 2015
      Severity: Major
      Found in src/MVM/MVM.js - About 1 day to fix

        Function SketchGen has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

        Sketch.SketchGen = function(){
            var outBuffer = [];
            var programCounter = 0;
            var scopeStack = [];
            var stackPtr = 0;
        Severity: Minor
        Found in src/Code Generator/SketchGen.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 SketchGen has 110 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Sketch.SketchGen = function(){
            var outBuffer = [];
            var programCounter = 0;
            var scopeStack = [];
            var stackPtr = 0;
        Severity: Major
        Found in src/Code Generator/SketchGen.js - About 4 hrs to fix

          File SketchGenInstr.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* global Sketch */
          /* global MVM */
          
          //HELPERS
          var createNode = function(type, args){
          Severity: Minor
          Found in src/Code Generator/SketchGenInstr.js - About 3 hrs to fix

            Function fetchSetter has 79 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Palette.Program.fetchSetter = function(gl, type){
                //LAZY
                //I'LL DO THIS MORE ELEGANTLY ONE DAY.
                var oneParamFromArray = function(convertFunc){
                    return function(ptr, array){
            Severity: Major
            Found in src/Palette/Program.js - About 3 hrs to fix

              Function restoreDefaultConfig has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  restoreDefaultConfig: function(mode){
                      var attrPointer;
                      var shaderPointer;
              
                      for(var j=0; j<2; j++){
              Severity: Minor
              Found in src/Palette/Program.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 setConfig has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  setConfig: function(mode, conf){
                      var attrPointer;
                      var shaderPointer;
              
                      for(var j=0; j<2; j++){
              Severity: Minor
              Found in src/Palette/Program.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 compile has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  compile: function(text){
                      if(this.readyLock>0){
                          alert("Sketch driver is still loading shaders - be patient!" +
                          " If it's been excessively long then you may have tried to add a malformed shader.");
                          return false;
              Severity: Minor
              Found in src/Sketch/Driver.js - About 1 hr to fix

                Function passAttrstoProg has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    passAttrstoProg: function(){
                        var attrPointer;
                
                        for(var j=0; j<2; j++){
                            if(!j){attrPointer = this.attrs.vs;}
                Severity: Minor
                Found in src/Palette/Program.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 prepareAttrStores has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    prepareAttrStores: function(){
                        this.context.useProgram(this.program);
                        var shaderPointer;
                        var attrPointer;
                
                Severity: Minor
                Found in src/Palette/Program.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 draw has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    draw: function(verts, conf1, conf2){
                        this.context.useProgram(this.program);
                        if(!conf1) conf1 = {};
                        var tempDrawMode = this.drawMode;
                        if(verts !== null){
                Severity: Minor
                Found in src/Palette/Program.js - About 1 hr to fix

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

                      draw: function(verts, conf1, conf2){
                          this.context.useProgram(this.program);
                          if(!conf1) conf1 = {};
                          var tempDrawMode = this.drawMode;
                          if(verts !== null){
                  Severity: Minor
                  Found in src/Palette/Program.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 lookup has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      lookup: function(operand, keys){
                          try{
                              var k = this.store[operand];
                  
                              for(var i = 0; i< keys.length; i++){
                  Severity: Minor
                  Found in src/Code Generator/SketchGenOperandTable.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 lookup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      lookup: function(operand, keys){
                          try{
                              var k = this.store[operand];
                  
                              for(var i = 0; i< keys.length; i++){
                  Severity: Minor
                  Found in src/Code Generator/SketchGenOperandTable.js - About 1 hr to fix

                    Function prepareAttrStores has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        prepareAttrStores: function(){
                            this.context.useProgram(this.program);
                            var shaderPointer;
                            var attrPointer;
                    
                    Severity: Minor
                    Found in src/Palette/Program.js - About 1 hr to fix

                      Function getProgram has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          getProgram: function(vs, fs){
                              var vsName = this.getShaderName(vs);
                              var fsName = this.getShaderName(fs);
                              var vsObj;
                              var fsObj;
                      Severity: Minor
                      Found in src/Palette/Manager.js - About 55 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 compile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          compile: function(text){
                              if(this.readyLock>0){
                                  alert("Sketch driver is still loading shaders - be patient!" +
                                  " If it's been excessively long then you may have tried to add a malformed shader.");
                                  return false;
                      Severity: Minor
                      Found in src/Sketch/Driver.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

                      Severity
                      Category
                      Status
                      Source
                      Language