BabylonJS/Spector.js

View on GitHub

Showing 306 of 572 total issues

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

function start() {
  canvas = document.getElementById("renderCanvas");

  initWebGL(canvas);      // Initialize the GL context

Severity: Major
Found in sample/js/depthRange.js and 11 other locations - About 6 hrs to fix
sample/js/customLog.js on lines 52..78
sample/js/customMarker.js on lines 52..78
sample/js/customMetadata.js on lines 50..76
sample/js/customShaderName.js on lines 54..80
sample/js/scissorClear.js on lines 54..80
sample/js/setTimeout.js on lines 54..80
sample/js/simple.js on lines 63..89
sample/js/simpleNoCommand.js on lines 50..76
sample/js/stencilBits.js on lines 54..80
sample/js/uniformArray.js on lines 46..72
sample/js/uniformCommand.js on lines 52..78

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

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

function start() {
  canvas = document.getElementById("renderCanvas");

  initWebGL(canvas);      // Initialize the GL context

Severity: Major
Found in sample/js/simple.js and 11 other locations - About 6 hrs to fix
sample/js/customLog.js on lines 52..78
sample/js/customMarker.js on lines 52..78
sample/js/customMetadata.js on lines 50..76
sample/js/customShaderName.js on lines 54..80
sample/js/depthRange.js on lines 50..76
sample/js/scissorClear.js on lines 54..80
sample/js/setTimeout.js on lines 54..80
sample/js/simpleNoCommand.js on lines 50..76
sample/js/stencilBits.js on lines 54..80
sample/js/uniformArray.js on lines 46..72
sample/js/uniformCommand.js on lines 52..78

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

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

function start() {
  canvas = document.getElementById("renderCanvas");

  initWebGL(canvas);      // Initialize the GL context

Severity: Major
Found in sample/js/stencilBits.js and 11 other locations - About 6 hrs to fix
sample/js/customLog.js on lines 52..78
sample/js/customMarker.js on lines 52..78
sample/js/customMetadata.js on lines 50..76
sample/js/customShaderName.js on lines 54..80
sample/js/depthRange.js on lines 50..76
sample/js/scissorClear.js on lines 54..80
sample/js/setTimeout.js on lines 54..80
sample/js/simple.js on lines 63..89
sample/js/simpleNoCommand.js on lines 50..76
sample/js/uniformArray.js on lines 46..72
sample/js/uniformCommand.js on lines 52..78

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

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

function start() {
  canvas = document.getElementById("renderCanvas");

  initWebGL(canvas);      // Initialize the GL context

Severity: Major
Found in sample/js/uniformArray.js and 11 other locations - About 6 hrs to fix
sample/js/customLog.js on lines 52..78
sample/js/customMarker.js on lines 52..78
sample/js/customMetadata.js on lines 50..76
sample/js/customShaderName.js on lines 54..80
sample/js/depthRange.js on lines 50..76
sample/js/scissorClear.js on lines 54..80
sample/js/setTimeout.js on lines 54..80
sample/js/simple.js on lines 63..89
sample/js/simpleNoCommand.js on lines 50..76
sample/js/stencilBits.js on lines 54..80
sample/js/uniformCommand.js on lines 52..78

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

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

function start() {
  canvas = document.getElementById("renderCanvas");

  initWebGL(canvas);      // Initialize the GL context

Severity: Major
Found in sample/js/setTimeout.js and 11 other locations - About 6 hrs to fix
sample/js/customLog.js on lines 52..78
sample/js/customMarker.js on lines 52..78
sample/js/customMetadata.js on lines 50..76
sample/js/customShaderName.js on lines 54..80
sample/js/depthRange.js on lines 50..76
sample/js/scissorClear.js on lines 54..80
sample/js/simple.js on lines 63..89
sample/js/simpleNoCommand.js on lines 50..76
sample/js/stencilBits.js on lines 54..80
sample/js/uniformArray.js on lines 46..72
sample/js/uniformCommand.js on lines 52..78

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

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

function start() {
  canvas = document.getElementById("renderCanvas");

  initWebGL(canvas);      // Initialize the GL context

Severity: Major
Found in sample/js/customLog.js and 11 other locations - About 6 hrs to fix
sample/js/customMarker.js on lines 52..78
sample/js/customMetadata.js on lines 50..76
sample/js/customShaderName.js on lines 54..80
sample/js/depthRange.js on lines 50..76
sample/js/scissorClear.js on lines 54..80
sample/js/setTimeout.js on lines 54..80
sample/js/simple.js on lines 63..89
sample/js/simpleNoCommand.js on lines 50..76
sample/js/stencilBits.js on lines 54..80
sample/js/uniformArray.js on lines 46..72
sample/js/uniformCommand.js on lines 52..78

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

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

function start() {
  canvas = document.getElementById("renderCanvas");

  initWebGL(canvas);      // Initialize the GL context

Severity: Major
Found in sample/js/scissorClear.js and 11 other locations - About 6 hrs to fix
sample/js/customLog.js on lines 52..78
sample/js/customMarker.js on lines 52..78
sample/js/customMetadata.js on lines 50..76
sample/js/customShaderName.js on lines 54..80
sample/js/depthRange.js on lines 50..76
sample/js/setTimeout.js on lines 54..80
sample/js/simple.js on lines 63..89
sample/js/simpleNoCommand.js on lines 50..76
sample/js/stencilBits.js on lines 54..80
sample/js/uniformArray.js on lines 46..72
sample/js/uniformCommand.js on lines 52..78

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

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

function start() {
  canvas = document.getElementById("renderCanvas");

  initWebGL(canvas);      // Initialize the GL context

Severity: Major
Found in sample/js/uniformCommand.js and 11 other locations - About 6 hrs to fix
sample/js/customLog.js on lines 52..78
sample/js/customMarker.js on lines 52..78
sample/js/customMetadata.js on lines 50..76
sample/js/customShaderName.js on lines 54..80
sample/js/depthRange.js on lines 50..76
sample/js/scissorClear.js on lines 54..80
sample/js/setTimeout.js on lines 54..80
sample/js/simple.js on lines 63..89
sample/js/simpleNoCommand.js on lines 50..76
sample/js/stencilBits.js on lines 54..80
sample/js/uniformArray.js on lines 46..72

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

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 (imageAspectRatio < 1) {
                            this.captureCanvas.width =
                                VisualState.captureBaseSize * imageAspectRatio;
                            this.captureCanvas.height =
                                VisualState.captureBaseSize;
Severity: Major
Found in src/backend/states/context/visualState.ts and 1 other location - About 5 hrs to fix
src/backend/states/drawCalls/drawCallTextureInputState.ts on lines 173..184

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

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 (imageAspectRatio < 1) {
                    this.captureCanvas.width = VisualState.captureBaseSize * imageAspectRatio;
                    this.captureCanvas.height = VisualState.captureBaseSize;
                }
                else if (imageAspectRatio > 1) {
Severity: Major
Found in src/backend/states/drawCalls/drawCallTextureInputState.ts and 1 other location - About 5 hrs to fix
src/backend/states/context/visualState.ts on lines 269..284

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

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

export class DrawArraysInstancedAngle extends BaseCommand {
    public static readonly commandName = "drawArraysInstancedANGLE";

    protected get spiedCommandName(): string {
        return DrawArraysInstancedAngle.commandName;
Severity: Major
Found in src/backend/commands/drawArraysInstancedAngle.ts and 1 other location - About 5 hrs to fix
src/backend/commands/drawArraysInstanced.ts on lines 4..20

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

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

export class DrawArraysInstanced extends BaseCommand {
    public static readonly commandName = "drawArraysInstanced";

    protected get spiedCommandName(): string {
        return DrawArraysInstanced.commandName;
Severity: Major
Found in src/backend/commands/drawArraysInstanced.ts and 1 other location - About 5 hrs to fix
src/backend/commands/drawArraysInstancedAngle.ts on lines 4..20

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

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

function makeOrtho(left, right, bottom, top, znear, zfar)
{
    var tx = - (right + left) / (right - left);
    var ty = - (top + bottom) / (top - bottom);
    var tz = - (zfar + znear) / (zfar - znear);
Severity: Major
Found in sample/assets/js/glUtils.js and 1 other location - About 4 hrs to fix
sample/assets/js/glUtils.js on lines 132..144

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

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

function makeOrtho(left, right,
                   bottom, top,
                   znear, zfar)
{
    var tx = -(right+left)/(right-left);
Severity: Major
Found in sample/assets/js/glUtils.js and 1 other location - About 4 hrs to fix
sample/assets/js/glUtils.js on lines 182..192

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

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

function getShader(gl, source, isVertex) {
  var shader = gl.createShader(isVertex ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER);
  gl.shaderSource(shader, source);
  gl.compileShader(shader);

Severity: Major
Found in sample/js/customMarker.js and 12 other locations - About 4 hrs to fix
sample/js/customLog.js on lines 340..353
sample/js/customMetadata.js on lines 342..355
sample/js/customShaderName.js on lines 338..351
sample/js/depthRange.js on lines 345..358
sample/js/scissorClear.js on lines 346..359
sample/js/setTimeout.js on lines 346..359
sample/js/simple.js on lines 347..360
sample/js/simpleNoCommand.js on lines 334..347
sample/js/stencilBits.js on lines 338..351
sample/js/transient.js on lines 345..358
sample/js/uniformArray.js on lines 297..310
sample/js/uniformCommand.js on lines 337..350

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

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

function getShader(gl, source, isVertex) {
  var shader = gl.createShader(isVertex ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER);
  gl.shaderSource(shader, source);
  gl.compileShader(shader);

Severity: Major
Found in sample/js/stencilBits.js and 12 other locations - About 4 hrs to fix
sample/js/customLog.js on lines 340..353
sample/js/customMarker.js on lines 341..354
sample/js/customMetadata.js on lines 342..355
sample/js/customShaderName.js on lines 338..351
sample/js/depthRange.js on lines 345..358
sample/js/scissorClear.js on lines 346..359
sample/js/setTimeout.js on lines 346..359
sample/js/simple.js on lines 347..360
sample/js/simpleNoCommand.js on lines 334..347
sample/js/transient.js on lines 345..358
sample/js/uniformArray.js on lines 297..310
sample/js/uniformCommand.js on lines 337..350

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

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

function getShader(gl, source, isVertex) {
  var shader = gl.createShader(isVertex ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER);
  gl.shaderSource(shader, source);
  gl.compileShader(shader);

Severity: Major
Found in sample/js/transient.js and 12 other locations - About 4 hrs to fix
sample/js/customLog.js on lines 340..353
sample/js/customMarker.js on lines 341..354
sample/js/customMetadata.js on lines 342..355
sample/js/customShaderName.js on lines 338..351
sample/js/depthRange.js on lines 345..358
sample/js/scissorClear.js on lines 346..359
sample/js/setTimeout.js on lines 346..359
sample/js/simple.js on lines 347..360
sample/js/simpleNoCommand.js on lines 334..347
sample/js/stencilBits.js on lines 338..351
sample/js/uniformArray.js on lines 297..310
sample/js/uniformCommand.js on lines 337..350

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

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

function getShader(gl, source, isVertex) {
  var shader = gl.createShader(isVertex ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER);
  gl.shaderSource(shader, source);
  gl.compileShader(shader);

Severity: Major
Found in sample/js/uniformArray.js and 12 other locations - About 4 hrs to fix
sample/js/customLog.js on lines 340..353
sample/js/customMarker.js on lines 341..354
sample/js/customMetadata.js on lines 342..355
sample/js/customShaderName.js on lines 338..351
sample/js/depthRange.js on lines 345..358
sample/js/scissorClear.js on lines 346..359
sample/js/setTimeout.js on lines 346..359
sample/js/simple.js on lines 347..360
sample/js/simpleNoCommand.js on lines 334..347
sample/js/stencilBits.js on lines 338..351
sample/js/transient.js on lines 345..358
sample/js/uniformCommand.js on lines 337..350

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

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

function getShader(gl, source, isVertex) {
  var shader = gl.createShader(isVertex ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER);
  gl.shaderSource(shader, source);
  gl.compileShader(shader);

Severity: Major
Found in sample/js/customShaderName.js and 12 other locations - About 4 hrs to fix
sample/js/customLog.js on lines 340..353
sample/js/customMarker.js on lines 341..354
sample/js/customMetadata.js on lines 342..355
sample/js/depthRange.js on lines 345..358
sample/js/scissorClear.js on lines 346..359
sample/js/setTimeout.js on lines 346..359
sample/js/simple.js on lines 347..360
sample/js/simpleNoCommand.js on lines 334..347
sample/js/stencilBits.js on lines 338..351
sample/js/transient.js on lines 345..358
sample/js/uniformArray.js on lines 297..310
sample/js/uniformCommand.js on lines 337..350

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

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

function getShader(gl, source, isVertex) {
  var shader = gl.createShader(isVertex ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER);
  gl.shaderSource(shader, source);
  gl.compileShader(shader);

Severity: Major
Found in sample/js/scissorClear.js and 12 other locations - About 4 hrs to fix
sample/js/customLog.js on lines 340..353
sample/js/customMarker.js on lines 341..354
sample/js/customMetadata.js on lines 342..355
sample/js/customShaderName.js on lines 338..351
sample/js/depthRange.js on lines 345..358
sample/js/setTimeout.js on lines 346..359
sample/js/simple.js on lines 347..360
sample/js/simpleNoCommand.js on lines 334..347
sample/js/stencilBits.js on lines 338..351
sample/js/transient.js on lines 345..358
sample/js/uniformArray.js on lines 297..310
sample/js/uniformCommand.js on lines 337..350

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

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

Severity
Category
Status
Source
Language