FelixMcFelix/laughing-ironman

View on GitHub

Showing 59 of 59 total issues

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

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

        current: function(){
            try{
                return this.stack[this.stack.length - 1];
            } catch(e){
                return undefined;
    Severity: Minor
    Found in src/MVM/MVM-DataModel.js and 1 other location - About 50 mins to fix
    src/MVM/MVM-DataModel.js on lines 176..182

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

    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

        peek: function(){
            try {
                return this.stack[this.stack.length-1];
            } catch (e){
                return undefined;
    Severity: Minor
    Found in src/MVM/MVM-DataModel.js and 1 other location - About 50 mins to fix
    src/MVM/MVM-DataModel.js on lines 26..32

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

    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

    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

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

                if(fs instanceof Palette.Shader){fsObj = fs;} else{fsObj = this.getShader(Palette.Shader.FS, fsName);}
    Severity: Minor
    Found in src/Palette/Manager.js and 1 other location - About 45 mins to fix
    src/Palette/Manager.js on lines 98..98

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

    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(vs instanceof Palette.Shader){vsObj = vs;} else{vsObj = this.getShader(Palette.Shader.VS, vsName);}
    Severity: Minor
    Found in src/Palette/Manager.js and 1 other location - About 45 mins to fix
    src/Palette/Manager.js on lines 99..99

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

    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

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

    Palette.Shader = function(gl, name, type, source, attrs){
    Severity: Minor
    Found in src/Palette/Shader.js - About 35 mins to fix

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

          add: function(operand, keys, value, predicate, extraSelector){
      Severity: Minor
      Found in src/Code Generator/SketchGenOperandTable.js - About 35 mins to fix

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

            draw: function(vs, fs, verts, conf1, conf2){
        Severity: Minor
        Found in src/Palette/Manager.js - About 35 mins to fix

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

          Sketch.SketchGenOperandTable.add("%", ["num", "num"],
                                        new Sketch.OpCheckValue("num", MVM.opCodes.FMOD)
                                      );
          Severity: Major
          Found in src/Code Generator/SketchGenOperandTable.js and 7 other locations - About 30 mins to fix
          src/Code Generator/SketchGenOperandTable.js on lines 149..151
          src/Code Generator/SketchGenOperandTable.js on lines 156..158
          src/Code Generator/SketchGenOperandTable.js on lines 163..165
          src/Code Generator/SketchGenOperandTable.js on lines 191..193
          src/Code Generator/SketchGenOperandTable.js on lines 198..200
          src/Code Generator/SketchGenOperandTable.js on lines 225..227
          src/Code Generator/SketchGenOperandTable.js on lines 232..234

          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 8 locations. Consider refactoring.
          Open

          Sketch.SketchGenOperandTable.add("&&", ["bool", "bool"],
                                        new Sketch.OpCheckValue("bool", MVM.opCodes.BAND)
                                      );
          Severity: Major
          Found in src/Code Generator/SketchGenOperandTable.js and 7 other locations - About 30 mins to fix
          src/Code Generator/SketchGenOperandTable.js on lines 149..151
          src/Code Generator/SketchGenOperandTable.js on lines 156..158
          src/Code Generator/SketchGenOperandTable.js on lines 163..165
          src/Code Generator/SketchGenOperandTable.js on lines 170..172
          src/Code Generator/SketchGenOperandTable.js on lines 198..200
          src/Code Generator/SketchGenOperandTable.js on lines 225..227
          src/Code Generator/SketchGenOperandTable.js on lines 232..234

          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 8 locations. Consider refactoring.
          Open

          Sketch.SketchGenOperandTable.add("?<", ["num", "num"],
                                        new Sketch.OpCheckValue("bool", MVM.opCodes.CMPLT)
                                      );
          Severity: Major
          Found in src/Code Generator/SketchGenOperandTable.js and 7 other locations - About 30 mins to fix
          src/Code Generator/SketchGenOperandTable.js on lines 149..151
          src/Code Generator/SketchGenOperandTable.js on lines 156..158
          src/Code Generator/SketchGenOperandTable.js on lines 163..165
          src/Code Generator/SketchGenOperandTable.js on lines 170..172
          src/Code Generator/SketchGenOperandTable.js on lines 191..193
          src/Code Generator/SketchGenOperandTable.js on lines 198..200
          src/Code Generator/SketchGenOperandTable.js on lines 232..234

          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 8 locations. Consider refactoring.
          Open

          Sketch.SketchGenOperandTable.add("||", ["bool", "bool"],
                                        new Sketch.OpCheckValue("bool", MVM.opCodes.BOR)
                                      );
          Severity: Major
          Found in src/Code Generator/SketchGenOperandTable.js and 7 other locations - About 30 mins to fix
          src/Code Generator/SketchGenOperandTable.js on lines 149..151
          src/Code Generator/SketchGenOperandTable.js on lines 156..158
          src/Code Generator/SketchGenOperandTable.js on lines 163..165
          src/Code Generator/SketchGenOperandTable.js on lines 170..172
          src/Code Generator/SketchGenOperandTable.js on lines 191..193
          src/Code Generator/SketchGenOperandTable.js on lines 225..227
          src/Code Generator/SketchGenOperandTable.js on lines 232..234

          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 8 locations. Consider refactoring.
          Open

          Sketch.SketchGenOperandTable.add("/", ["num", "num"],
                                        new Sketch.OpCheckValue("num", MVM.opCodes.FDIV)
                                      );
          Severity: Major
          Found in src/Code Generator/SketchGenOperandTable.js and 7 other locations - About 30 mins to fix
          src/Code Generator/SketchGenOperandTable.js on lines 149..151
          src/Code Generator/SketchGenOperandTable.js on lines 156..158
          src/Code Generator/SketchGenOperandTable.js on lines 170..172
          src/Code Generator/SketchGenOperandTable.js on lines 191..193
          src/Code Generator/SketchGenOperandTable.js on lines 198..200
          src/Code Generator/SketchGenOperandTable.js on lines 225..227
          src/Code Generator/SketchGenOperandTable.js on lines 232..234

          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 8 locations. Consider refactoring.
          Open

          Sketch.SketchGenOperandTable.add("-", ["num", "num"],
                                        new Sketch.OpCheckValue("num", MVM.opCodes.FSUB)
                                      );
          Severity: Major
          Found in src/Code Generator/SketchGenOperandTable.js and 7 other locations - About 30 mins to fix
          src/Code Generator/SketchGenOperandTable.js on lines 156..158
          src/Code Generator/SketchGenOperandTable.js on lines 163..165
          src/Code Generator/SketchGenOperandTable.js on lines 170..172
          src/Code Generator/SketchGenOperandTable.js on lines 191..193
          src/Code Generator/SketchGenOperandTable.js on lines 198..200
          src/Code Generator/SketchGenOperandTable.js on lines 225..227
          src/Code Generator/SketchGenOperandTable.js on lines 232..234

          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 8 locations. Consider refactoring.
          Open

          Sketch.SketchGenOperandTable.add("?>", ["num", "num"],
                                        new Sketch.OpCheckValue("bool", MVM.opCodes.CMPGT)
                                      );
          Severity: Major
          Found in src/Code Generator/SketchGenOperandTable.js and 7 other locations - About 30 mins to fix
          src/Code Generator/SketchGenOperandTable.js on lines 149..151
          src/Code Generator/SketchGenOperandTable.js on lines 156..158
          src/Code Generator/SketchGenOperandTable.js on lines 163..165
          src/Code Generator/SketchGenOperandTable.js on lines 170..172
          src/Code Generator/SketchGenOperandTable.js on lines 191..193
          src/Code Generator/SketchGenOperandTable.js on lines 198..200
          src/Code Generator/SketchGenOperandTable.js on lines 225..227

          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 8 locations. Consider refactoring.
          Open

          Sketch.SketchGenOperandTable.add("*", ["num", "num"],
                                        new Sketch.OpCheckValue("num", MVM.opCodes.FMUL)
                                      );
          Severity: Major
          Found in src/Code Generator/SketchGenOperandTable.js and 7 other locations - About 30 mins to fix
          src/Code Generator/SketchGenOperandTable.js on lines 149..151
          src/Code Generator/SketchGenOperandTable.js on lines 163..165
          src/Code Generator/SketchGenOperandTable.js on lines 170..172
          src/Code Generator/SketchGenOperandTable.js on lines 191..193
          src/Code Generator/SketchGenOperandTable.js on lines 198..200
          src/Code Generator/SketchGenOperandTable.js on lines 225..227
          src/Code Generator/SketchGenOperandTable.js on lines 232..234

          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

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

              establishType: function(shader){
                  var type = -1;
                  if(shader instanceof Palette.Shader){
                      type = Palette.ShaderFactory.SHADER_OBJECT;
                  } else if((shader.type != undefined) && (shader.name != undefined) && (shader.content || shader.src)){
          Severity: Minor
          Found in src/Palette/ShaderFactory.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