mrdoob/three.js

View on GitHub

Showing 7,845 of 7,845 total issues

File lottie_canvas.module.js has 13285 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const lottie = {};

if (typeof document !== 'undefined') {

const svgNS = 'http://www.w3.org/2000/svg';
Severity: Major
Found in examples/jsm/libs/lottie_canvas.module.js - About 1 mo to fix

    File mmdparser.module.js has 10746 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * @author Takahiro / https://github.com/takahirox
     *
     * Simple CharsetEncoder.
     */
    Severity: Major
    Found in examples/jsm/libs/mmdparser.module.js - About 1 mo to fix

      File opentype.module.js has 9607 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * https://opentype.js.org v1.3.4 | (c) Frederik De Bleser and other contributors | MIT License | Uses tiny-inflate by Devon Govett and string.prototype.codepointat polyfill by Mathias Bynens
       */
      
      /*! https://mths.be/codepointat v0.2.0 by @mathias */
      Severity: Major
      Found in examples/jsm/libs/opentype.module.js - About 1 mo to fix

        File codemirror.js has 7857 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // CodeMirror, copyright (c) by Marijn Haverbeke and others
        // Distributed under an MIT license: https://codemirror.net/LICENSE
        
        // This is CodeMirror (https://codemirror.net), a code editor
        // implemented in JavaScript on top of the browser's DOM.
        Severity: Major
        Found in editor/js/libs/codemirror/codemirror.js - About 3 wks to fix

          Function WebGLTextures has a Cognitive Complexity of 1059 (exceeds 5 allowed). Consider refactoring.
          Open

          function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ) {
          
              const multisampledRTTExt = extensions.has( 'WEBGL_multisampled_render_to_texture' ) ? extensions.get( 'WEBGL_multisampled_render_to_texture' ) : null;
              const supportsInvalidateFramebuffer = typeof navigator === 'undefined' ? false : /OculusBrowser/g.test( navigator.userAgent );
          
          
          Severity: Minor
          Found in src/renderers/webgl/WebGLTextures.js - About 3 wks to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function parse has a Cognitive Complexity of 1002 (exceeds 5 allowed). Consider refactoring.
          Open

              parse( text, path ) {
          
                  function getElementsByTagName( xml, name ) {
          
                      // Non recursive xml.getElementsByTagName() ...
          Severity: Minor
          Found in examples/jsm/loaders/ColladaLoader.js - About 2 wks 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

          File esprima.js has 6001 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          (function webpackUniversalModuleDefinition(root, factory) {
          /* istanbul ignore next */
              if(typeof exports === 'object' && typeof module === 'object')
                  module.exports = factory();
              else if(typeof define === 'function' && define.amd)
          Severity: Major
          Found in editor/js/libs/esprima.js - About 2 wks to fix

            Function parse has a Cognitive Complexity of 721 (exceeds 5 allowed). Consider refactoring.
            Open

                parse( data, path ) {
            
                    const nodeMap = {};
            
                    function generateVRMLTree( data ) {
            Severity: Minor
            Found in examples/jsm/loaders/VRMLLoader.js - About 2 wks 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

            File threejs.js has 5030 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            (function(mod) {
              if (typeof exports == "object" && typeof module == "object") // CommonJS
                return mod(require("tern/lib/infer"), require("tern/lib/tern"));
              if (typeof define == "function" && define.amd) // AMD
                return define([ "tern/lib/infer", "tern/lib/tern" ], mod);
            Severity: Major
            Found in editor/js/libs/tern-threejs/threejs.js - About 2 wks to fix

              Function dataManager has a Cognitive Complexity of 697 (exceeds 5 allowed). Consider refactoring.
              Open

              const dataManager = (function () {
                var _counterId = 1;
                var processes = [];
                var workerFn;
                var workerInstance;
              Severity: Minor
              Found in examples/jsm/libs/lottie_canvas.module.js - About 2 wks to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function Parser has 2764 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var Parser = (function () {
                      function Parser(code, options, delegate) {
                          if (options === void 0) { options = {}; }
                          this.config = {
                              range: (typeof options.range === 'boolean') && options.range,
              Severity: Major
              Found in editor/js/libs/esprima.js - About 1 wk to fix

                Function parse has a Cognitive Complexity of 584 (exceeds 5 allowed). Consider refactoring.
                Open

                    parse( buffer ) {
                
                        const USHORT_RANGE = ( 1 << 16 );
                        const BITMAP_SIZE = ( USHORT_RANGE >> 3 );
                
                
                Severity: Minor
                Found in examples/jsm/loaders/EXRLoader.js - About 1 wk to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function parse has 2294 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    parse( text, path ) {
                
                        function getElementsByTagName( xml, name ) {
                
                            // Non recursive xml.getElementsByTagName() ...
                Severity: Major
                Found in examples/jsm/loaders/ColladaLoader.js - About 1 wk to fix

                  Function getMeasures has a Cognitive Complexity of 551 (exceeds 5 allowed). Consider refactoring.
                  Open

                  TextAnimatorProperty.prototype.getMeasures = function (documentData, lettersChangedFlag) {
                    this.lettersChangedFlag = lettersChangedFlag;
                    if (!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
                      return;
                    }
                  Severity: Minor
                  Found in examples/jsm/libs/lottie_canvas.module.js - About 1 wk to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function constructor has a Cognitive Complexity of 550 (exceeds 5 allowed). Consider refactoring.
                  Open

                      constructor( parameters = {} ) {
                  
                          const {
                              canvas = createCanvasElement(),
                              context = null,
                  Severity: Minor
                  Found in src/renderers/WebGLRenderer.js - About 1 wk to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function parse has a Cognitive Complexity of 541 (exceeds 5 allowed). Consider refactoring.
                  Open

                      parse( text ) {
                  
                          const scope = this;
                  
                          function parseNode( node, style ) {
                  Severity: Minor
                  Found in examples/jsm/loaders/SVGLoader.js - About 1 wk to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function parse has a Cognitive Complexity of 481 (exceeds 5 allowed). Consider refactoring.
                  Open

                      parse( data ) {
                  
                          function parseASCII( data ) {
                  
                              // connectivity of the triangles
                  Severity: Minor
                  Found in examples/jsm/loaders/VTKLoader.js - About 1 wk 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 4 locations. Consider refactoring.
                  Open

                          ja: {
                  
                              'menubar/file': 'ファイル',
                              'menubar/file/new': '新規',
                              'menubar/file/import': 'インポート',
                  Severity: Major
                  Found in editor/js/Strings.js and 3 other locations - About 1 wk to fix
                  editor/js/Strings.js on lines 7..358
                  editor/js/Strings.js on lines 360..711
                  editor/js/Strings.js on lines 713..1064

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

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

                          fr: {
                  
                              'menubar/file': 'Fichier',
                              'menubar/file/new': 'Nouveau',
                              'menubar/file/import': 'Importer',
                  Severity: Major
                  Found in editor/js/Strings.js and 3 other locations - About 1 wk to fix
                  editor/js/Strings.js on lines 7..358
                  editor/js/Strings.js on lines 713..1064
                  editor/js/Strings.js on lines 1066..1417

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

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

                          zh: {
                  
                              'menubar/file': '文件',
                              'menubar/file/new': '新建',
                              'menubar/file/import': '导入',
                  Severity: Major
                  Found in editor/js/Strings.js and 3 other locations - About 1 wk to fix
                  editor/js/Strings.js on lines 7..358
                  editor/js/Strings.js on lines 360..711
                  editor/js/Strings.js on lines 1066..1417

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

                  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