mrdoob/three.js

View on GitHub

Showing 7,845 of 7,845 total issues

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

        en: {

            'menubar/file': 'File',
            'menubar/file/new': 'New',
            'menubar/file/import': 'Import',
Severity: Major
Found in editor/js/Strings.js and 3 other locations - About 1 wk to fix
editor/js/Strings.js on lines 360..711
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

Function ExpressionManager has a Cognitive Complexity of 443 (exceeds 5 allowed). Consider refactoring.
Open

const ExpressionManager = (function () {
  'use strict';

  var ob = {};
  var Math = BMMath;
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 parse has 1779 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    parse( data, path ) {

        const nodeMap = {};

        function generateVRMLTree( data ) {
Severity: Major
Found in examples/jsm/loaders/VRMLLoader.js - About 1 wk to fix

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

    /**
     * https://github.com/sunag/flow
     */
    
    function __flow__addCSS( css ) {
    Severity: Major
    Found in playground/libs/flow.module.js - About 1 wk to fix

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

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

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

        UTIF._types = function() {
            var main = new Array(250);  main.fill(0);
            main = main.concat([0,0,0,0,4,3,3,3,3,3,0,0,3,0,0,0,3,0,0,2,2,2,2,4,3,0,0,3,4,4,3,3,5,5,3,2,5,5,0,0,0,0,4,4,0,0,3,3,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,2,2,3,5,5,3,0,3,3,4,4,4,3,4,0,0,0,0,0,0,0,0,0,3,3,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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 37384: 3, 37385: 3, 37386: 5, 37510: 7, 37520: 2, 37521: 2, 37522: 2, 40960: 7, 40961: 3, 40962: 4, 40963: 4, 40965: 4, 41486: 5, 41487: 5, 41488: 3, 41985: 3, 41986: 3, 41987: 3, 41988: 5, 41989: 3, 41990: 3, 41993: 3, 41994: 3, 41995: 7, 41996: 3, 42032: 2, 42033: 2, 42034: 5, 42036: 2, 42037: 2, 59932: 7};
            return {
        Severity: Major
        Found in examples/jsm/libs/utif.module.js and 1 other location - About 6 days to fix
        examples/jsm/loaders/LogLuvLoader.js on lines 241..257

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

        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

        UTIF._types = function () {
        
            var main = new Array( 250 ); main.fill( 0 );
            main = main.concat( [ 0, 0, 0, 0, 4, 3, 3, 3, 3, 3, 0, 0, 3, 0, 0, 0, 3, 0, 0, 2, 2, 2, 2, 4, 3, 0, 0, 3, 4, 4, 3, 3, 5, 5, 3, 2, 5, 5, 0, 0, 0, 0, 4, 4, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 3, 5, 5, 3, 0, 3, 3, 4, 4, 4, 3, 4, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0 ] );
            var rest = { 33432: 2, 33434: 5, 33437: 5, 34665: 4, 34850: 3, 34853: 4, 34855: 3, 34864: 3, 34866: 4, 36864: 7, 36867: 2, 36868: 2, 37121: 7, 37377: 10, 37378: 5, 37380: 10, 37381: 5, 37383: 3, 37384: 3, 37385: 3, 37386: 5, 37510: 7, 37520: 2, 37521: 2, 37522: 2, 40960: 7, 40961: 3, 40962: 4, 40963: 4, 40965: 4, 41486: 5, 41487: 5, 41488: 3, 41985: 3, 41986: 3, 41987: 3, 41988: 5, 41989: 3, 41990: 3, 41993: 3, 41994: 3, 41995: 7, 41996: 3, 42032: 2, 42033: 2, 42034: 5, 42036: 2, 42037: 2, 59932: 7 };
        Severity: Major
        Found in examples/jsm/loaders/LogLuvLoader.js and 1 other location - About 6 days to fix
        examples/jsm/libs/utif.module.js on lines 1159..1173

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

        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 WebGLProgram has a Cognitive Complexity of 336 (exceeds 5 allowed). Consider refactoring.
        Open

        function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
        
            // TODO Send this event to Three.js DevTools
            // console.log( 'WebGLProgram', cacheKey );
        
        
        Severity: Minor
        Found in src/renderers/webgl/WebGLProgram.js - About 6 days 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 GLTFLoader.js has 2474 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import {
            AnimationClip,
            Bone,
            Box3,
            BufferAttribute,
        Severity: Major
        Found in examples/jsm/loaders/GLTFLoader.js - About 6 days to fix

          Function WebGLUtils has a Cognitive Complexity of 331 (exceeds 5 allowed). Consider refactoring.
          Open

          function WebGLUtils( gl, extensions ) {
          
              function convert( p, colorSpace = NoColorSpace ) {
          
                  let extension;
          Severity: Minor
          Found in src/renderers/webgl/WebGLUtils.js - About 6 days 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 FBXLoader.js has 2373 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {
              AmbientLight,
              AnimationClip,
              Bone,
              BufferGeometry,
          Severity: Major
          Found in examples/jsm/loaders/FBXLoader.js - About 6 days to fix

            File ColladaLoader.js has 2360 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import {
                AmbientLight,
                AnimationClip,
                Bone,
                BufferGeometry,
            Severity: Major
            Found in examples/jsm/loaders/ColladaLoader.js - About 6 days to fix

              Function constructor has 1306 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                File acorn.js has 2316 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.acorn = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
                
                
                // The main exported interface (under `self.acorn` when in the
                // browser) is a `parse` function that takes a code string and
                Severity: Major
                Found in editor/js/libs/acorn/acorn.js - About 6 days to fix

                  Function PropertyFactory has a Cognitive Complexity of 313 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const PropertyFactory = (function () {
                    var initFrame = initialDefaultFrame;
                    var mathAbs = Math.abs;
                  
                    function interpolateValue(frameNum, caching) {
                  Severity: Minor
                  Found in examples/jsm/libs/lottie_canvas.module.js - About 6 days to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                  UTIF._binBE =
                  {
                      nextZero: function ( data, o ) {
                  
                          while ( data[ o ] != 0 ) o ++; return o;
                  Severity: Major
                  Found in examples/jsm/loaders/LogLuvLoader.js and 1 other location - About 6 days to fix
                  examples/jsm/libs/utif.module.js on lines 1510..1530

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

                  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

                  UTIF._binBE =
                  {
                      nextZero   : function(data, o) {  while(data[o]!=0) o++;  return o;  },
                      readUshort : function(buff, p) {  return (buff[p]<< 8) |  buff[p+1];  },
                      readShort  : function(buff, p) {  var a=UTIF._binBE.ui8;  a[0]=buff[p+1];  a[1]=buff[p+0];                                    return UTIF._binBE. i16[0];  },
                  Severity: Major
                  Found in examples/jsm/libs/utif.module.js and 1 other location - About 6 days to fix
                  examples/jsm/loaders/LogLuvLoader.js on lines 462..531

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

                  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

                  Consider simplifying this complex logical expression.
                  Open

                  if (typeof document !== 'undefined') {
                  
                  const svgNS = 'http://www.w3.org/2000/svg';
                  
                  let locationHref = '';
                  Severity: Critical
                  Found in examples/jsm/libs/lottie_canvas.module.js - About 6 days to fix

                    Function Strings has 1244 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function Strings( config ) {
                    
                        const language = config.getKey( 'language' );
                    
                        const values = {
                    Severity: Major
                    Found in editor/js/Strings.js - About 6 days to fix

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

                          constructor() {
                      
                              let _object, _objectCount, _objectPoolLength = 0,
                                  _vertex, _vertexCount, _vertexPoolLength = 0,
                                  _face, _faceCount, _facePoolLength = 0,
                      Severity: Minor
                      Found in examples/jsm/renderers/Projector.js - About 6 days to fix

                      Cognitive Complexity

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

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

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

                      Further reading

                      Severity
                      Category
                      Status
                      Source
                      Language