BabylonJS/Spector.js

View on GitHub
sample/assets/js/babylon.objFileLoader.js

Summary

Maintainability
F
1 wk
Test Coverage

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

          Function ./OBJ/mtlFileLoader.ts has 122 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__, "MTLFileLoader", function() { return MTLFileLoader; });
          Severity: Major
          Found in sample/assets/js/babylon.objFileLoader.js - About 4 hrs to fix

            Function MTLFileLoader has 120 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var MTLFileLoader = /** @class */ (function () {
                function MTLFileLoader() {
                    /**
                     * All material loaded from the mtl will be set here
                     */
            Severity: Major
            Found in sample/assets/js/babylon.objFileLoader.js - About 4 hrs to fix

              Function parseMTL has 91 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  MTLFileLoader.prototype.parseMTL = function (scene, data, rootUrl) {
                      if (data instanceof ArrayBuffer) {
                          return;
                      }
                      //Split the lines from the file
              Severity: Major
              Found in sample/assets/js/babylon.objFileLoader.js - About 3 hrs to fix

                Function setData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        var setData = function (indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, positionVectorFromOBJ, textureVectorFromOBJ, normalsVectorFromOBJ, positionColorsFromOBJ) {
                            //Check if this tuple already exists in the list of tuples
                            var _index;
                            if (_this._meshLoadOptions.OptimizeWithUV) {
                                _index = isInArrayUV(tuplePosNorm, [
                Severity: Minor
                Found in sample/assets/js/babylon.objFileLoader.js - About 1 hr to fix

                  Function setData has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          var setData = function (indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, positionVectorFromOBJ, textureVectorFromOBJ, normalsVectorFromOBJ, positionColorsFromOBJ) {
                  Severity: Major
                  Found in sample/assets/js/babylon.objFileLoader.js - About 50 mins to fix

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

                        OBJFileLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress, fileName) {
                    Severity: Minor
                    Found in sample/assets/js/babylon.objFileLoader.js - About 45 mins to fix

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

                          OBJFileLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress, fileName) {
                      Severity: Minor
                      Found in sample/assets/js/babylon.objFileLoader.js - About 35 mins to fix

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

                            OBJFileLoader.prototype.loadAssetContainerAsync = function (scene, data, rootUrl, onProgress, fileName) {
                        Severity: Minor
                        Found in sample/assets/js/babylon.objFileLoader.js - About 35 mins to fix

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

                                      else if (key === "ks" && material) {
                                          // Specular color (color when light is reflected from shiny surface) using RGB values
                                          //value = "r g b"
                                          color = value.split(delimiter_pattern, 3).map(parseFloat);
                                          //color = [r,g,b]
                          Severity: Major
                          Found in sample/assets/js/babylon.objFileLoader.js and 2 other locations - About 1 hr to fix
                          sample/assets/js/babylon.objFileLoader.js on lines 223..332
                          sample/assets/js/babylon.objFileLoader.js on lines 231..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 60.

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

                                      else if (key === "kd" && material) {
                                          // Diffuse color (color under white light) using RGB values
                                          //value  = "r g b"
                                          color = value.split(delimiter_pattern, 3).map(parseFloat);
                                          //color = [r,g,b]
                          Severity: Major
                          Found in sample/assets/js/babylon.objFileLoader.js and 2 other locations - About 1 hr to fix
                          sample/assets/js/babylon.objFileLoader.js on lines 231..332
                          sample/assets/js/babylon.objFileLoader.js on lines 239..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 60.

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

                                      else if (key === "ka" && material) {
                                          // Ambient color (color under shadow) using RGB values
                                          //value = "r g b"
                                          color = value.split(delimiter_pattern, 3).map(parseFloat);
                                          //color = [r,g,b]
                          Severity: Major
                          Found in sample/assets/js/babylon.objFileLoader.js and 2 other locations - About 1 hr to fix
                          sample/assets/js/babylon.objFileLoader.js on lines 223..332
                          sample/assets/js/babylon.objFileLoader.js on lines 239..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 60.

                          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

                                              catch (e) {
                                                  babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].Warn("Error processing MTL file: '" + fileToLoad + "'");
                                                  if (_this._meshLoadOptions.MaterialLoadingFailsSilently) {
                                                      resolve();
                                                  }
                          Severity: Major
                          Found in sample/assets/js/babylon.objFileLoader.js and 1 other location - About 1 hr to fix
                          sample/assets/js/babylon.objFileLoader.js on lines 1195..1203

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

                          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 (pathOfFile, exception) {
                                              babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].Warn("Error downloading MTL file: '" + fileToLoad + "'");
                                              if (_this._meshLoadOptions.MaterialLoadingFailsSilently) {
                                                  resolve();
                                              }
                          Severity: Major
                          Found in sample/assets/js/babylon.objFileLoader.js and 1 other location - About 1 hr to fix
                          sample/assets/js/babylon.objFileLoader.js on lines 1186..1194

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

                          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

                                          normals.push(new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector3"](parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3])));
                          Severity: Minor
                          Found in sample/assets/js/babylon.objFileLoader.js and 1 other location - About 45 mins to fix
                          sample/assets/js/babylon.objFileLoader.js on lines 933..933

                          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

                                          positions.push(new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector3"](parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3])));
                          Severity: Minor
                          Found in sample/assets/js/babylon.objFileLoader.js and 1 other location - About 45 mins to fix
                          sample/assets/js/babylon.objFileLoader.js on lines 950..950

                          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

                          There are no issues that match your filters.

                          Category
                          Status