BabylonJS/Spector.js

View on GitHub

Showing 572 of 572 total issues

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

function drawScene() {
  // Clear the canvas before we start drawing on it.
  gl.clearColor(0, 0, 0, 1);
  gl.clearDepth(1.0);
  gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
Severity: Major
Found in sample/js/uniformCommand.js and 1 other location - About 2 days to fix
sample/js/customShaderName.js on lines 228..301

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

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 ./OBJ/objFileLoader.ts has 488 lines of code (exceeds 25 allowed). Consider refactoring.
Open

/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OBJFileLoader", function() { return OBJFileLoader; });
Severity: Major
Found in sample/assets/js/babylon.objFileLoader.js - About 2 days to fix

    Function OBJFileLoader has 483 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var OBJFileLoader = /** @class */ (function () {
        /**
         * Creates loader for .OBJ files
         *
         * @param meshLoadOptions options for loading and parsing OBJ/MTL files.
    Severity: Major
    Found in sample/assets/js/babylon.objFileLoader.js - About 2 days to fix

      Function _parseSolid has 381 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          OBJFileLoader.prototype._parseSolid = function (meshesNames, scene, data, rootUrl) {
              var _this = this;
              var positions = []; //values for the positions of vertices
              var normals = []; //Values for the normals
              var uvs = []; //Values for the textures
      Severity: Major
      Found in sample/assets/js/babylon.objFileLoader.js - About 1 day to fix

        File webglConstants.ts has 716 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // tslint:disable:max-file-line-count
        // tslint:disable:interface-name
        // tslint:disable:max-line-length
        // tslint:disable:variable-name
        
        
        Severity: Major
        Found in src/backend/types/webglConstants.ts - About 1 day to fix

          File resultView.ts has 708 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // Import application Styles.
          import "../styles/resultView.scss";
          
          import { Observable } from "../../shared/utils/observable";
          import { ICapture } from "../../shared/capture/capture";
          Severity: Major
          Found in src/embeddedFrontend/resultView/resultView.ts - About 1 day to fix

            File babylon.objFileLoader.js has 644 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            (function webpackUniversalModuleDefinition(root, factory) {
                if(typeof exports === 'object' && typeof module === 'object')
                    module.exports = factory(require("babylonjs"));
                else if(typeof define === 'function' && define.amd)
                    define("babylonjs-loaders", ["babylonjs"], factory);
            Severity: Major
            Found in sample/assets/js/babylon.objFileLoader.js - About 1 day to fix

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

              function initShaders() {
                var fragmentShader = getShader(gl, fragmentShaderSource, false);
                var vertexShader = getShader(gl, vertexShaderSource, true);
              
                // Create the shader program
              Severity: Major
              Found in sample/js/simple.js and 3 other locations - About 1 day to fix
              sample/js/scissorClear.js on lines 316..340
              sample/js/setTimeout.js on lines 316..340
              sample/js/stencilBits.js on lines 308..332

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

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

              function initShaders() {
                var fragmentShader = getShader(gl, fragmentShaderSource, false);
                var vertexShader = getShader(gl, vertexShaderSource, true);
              
                // Create the shader program
              Severity: Major
              Found in sample/js/scissorClear.js and 3 other locations - About 1 day to fix
              sample/js/setTimeout.js on lines 316..340
              sample/js/simple.js on lines 317..341
              sample/js/stencilBits.js on lines 308..332

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

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

              function initShaders() {
                var fragmentShader = getShader(gl, fragmentShaderSource, false);
                var vertexShader = getShader(gl, vertexShaderSource, true);
              
                // Create the shader program
              Severity: Major
              Found in sample/js/stencilBits.js and 3 other locations - About 1 day to fix
              sample/js/scissorClear.js on lines 316..340
              sample/js/setTimeout.js on lines 316..340
              sample/js/simple.js on lines 317..341

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

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

              function initShaders() {
                var fragmentShader = getShader(gl, fragmentShaderSource, false);
                var vertexShader = getShader(gl, vertexShaderSource, true);
              
                // Create the shader program
              Severity: Major
              Found in sample/js/setTimeout.js and 3 other locations - About 1 day to fix
              sample/js/scissorClear.js on lines 316..340
              sample/js/simple.js on lines 317..341
              sample/js/stencilBits.js on lines 308..332

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

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

              function initShaders() {
                var fragmentShader = getShader(gl, fragmentShaderSource, false);
                var vertexShader = getShader(gl, vertexShaderSource, true);
              
                // Create the shader program
              Severity: Major
              Found in sample/js/uniformCommand.js and 6 other locations - About 1 day to fix
              sample/js/customLog.js on lines 310..334
              sample/js/customMarker.js on lines 311..335
              sample/js/customShaderName.js on lines 308..332
              sample/js/depthRange.js on lines 315..339
              sample/js/simpleNoCommand.js on lines 304..328
              sample/js/transient.js on lines 315..339

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

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

              function initShaders() {
                var fragmentShader = getShader(gl, fragmentShaderSource, false);
                var vertexShader = getShader(gl, vertexShaderSource, true);
              
                // Create the shader program
              Severity: Major
              Found in sample/js/simpleNoCommand.js and 6 other locations - About 1 day to fix
              sample/js/customLog.js on lines 310..334
              sample/js/customMarker.js on lines 311..335
              sample/js/customShaderName.js on lines 308..332
              sample/js/depthRange.js on lines 315..339
              sample/js/transient.js on lines 315..339
              sample/js/uniformCommand.js on lines 307..331

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

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

              function initShaders() {
                var fragmentShader = getShader(gl, fragmentShaderSource, false);
                var vertexShader = getShader(gl, vertexShaderSource, true);
              
                // Create the shader program
              Severity: Major
              Found in sample/js/customShaderName.js and 6 other locations - About 1 day to fix
              sample/js/customLog.js on lines 310..334
              sample/js/customMarker.js on lines 311..335
              sample/js/depthRange.js on lines 315..339
              sample/js/simpleNoCommand.js on lines 304..328
              sample/js/transient.js on lines 315..339
              sample/js/uniformCommand.js on lines 307..331

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

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

              function initShaders() {
                var fragmentShader = getShader(gl, fragmentShaderSource, false);
                var vertexShader = getShader(gl, vertexShaderSource, true);
              
                // Create the shader program
              Severity: Major
              Found in sample/js/transient.js and 6 other locations - About 1 day to fix
              sample/js/customLog.js on lines 310..334
              sample/js/customMarker.js on lines 311..335
              sample/js/customShaderName.js on lines 308..332
              sample/js/depthRange.js on lines 315..339
              sample/js/simpleNoCommand.js on lines 304..328
              sample/js/uniformCommand.js on lines 307..331

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

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

              function initShaders() {
                var fragmentShader = getShader(gl, fragmentShaderSource, false);
                var vertexShader = getShader(gl, vertexShaderSource, true);
              
                // Create the shader program
              Severity: Major
              Found in sample/js/depthRange.js and 6 other locations - About 1 day to fix
              sample/js/customLog.js on lines 310..334
              sample/js/customMarker.js on lines 311..335
              sample/js/customShaderName.js on lines 308..332
              sample/js/simpleNoCommand.js on lines 304..328
              sample/js/transient.js on lines 315..339
              sample/js/uniformCommand.js on lines 307..331

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

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

              function initShaders() {
                var fragmentShader = getShader(gl, fragmentShaderSource, false);
                var vertexShader = getShader(gl, vertexShaderSource, true);
              
                // Create the shader program
              Severity: Major
              Found in sample/js/customLog.js and 6 other locations - About 1 day to fix
              sample/js/customMarker.js on lines 311..335
              sample/js/customShaderName.js on lines 308..332
              sample/js/depthRange.js on lines 315..339
              sample/js/simpleNoCommand.js on lines 304..328
              sample/js/transient.js on lines 315..339
              sample/js/uniformCommand.js on lines 307..331

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

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

              function initShaders() {
                var fragmentShader = getShader(gl, fragmentShaderSource, false);
                var vertexShader = getShader(gl, vertexShaderSource, true);
              
                // Create the shader program
              Severity: Major
              Found in sample/js/customMarker.js and 6 other locations - About 1 day to fix
              sample/js/customLog.js on lines 310..334
              sample/js/customShaderName.js on lines 308..332
              sample/js/depthRange.js on lines 315..339
              sample/js/simpleNoCommand.js on lines 304..328
              sample/js/transient.js on lines 315..339
              sample/js/uniformCommand.js on lines 307..331

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

              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

              File contentScript.js has 514 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              var debug = false;
              
              //_______________________________EXTENSION POLYFILL_____________________________________
              window.browser = (function () {
                  return window.msBrowser ||
              Severity: Major
              Found in extensions/contentScript.js - About 1 day to fix

                File ace-ext-searchbox.js has 482 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"], function(require, exports, module) {
                "use strict";
                
                var dom = require("../lib/dom");
                var lang = require("../lib/lang");
                Severity: Minor
                Found in vendors/ace-ext-searchbox.js - About 7 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language