michaltakac/mathworldvr

View on GitHub

Showing 12 of 120 total issues

Function OrbitControls has a Cognitive Complexity of 123 (exceeds 5 allowed). Consider refactoring.
Open

THREE.OrbitControls = function ( object, domElement ) {

    this.object = object;

    this.domElement = ( domElement !== undefined ) ? domElement : document;
Severity: Minor
Found in src/lib/components/orbit-controls.js - About 2 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

Function OrbitControls has 425 lines of code (exceeds 25 allowed). Consider refactoring.
Open

THREE.OrbitControls = function ( object, domElement ) {

    this.object = object;

    this.domElement = ( domElement !== undefined ) ? domElement : document;
Severity: Major
Found in src/lib/components/orbit-controls.js - About 2 days to fix

    File orbit-controls.js has 560 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * @author qiao / https://github.com/qiao
     * @author mrdoob / http://mrdoob.com
     * @author alteredq / http://alteredqualia.com/
     * @author WestLangley / http://github.com/WestLangley
    Severity: Major
    Found in src/lib/components/orbit-controls.js - About 1 day to fix

      Function update has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        update: function(oldData) {
          var scene = this.el.object3D;
          // Equation parser
          var equation = 'f(x,y) = ' + this.data.equation;
      
      
      Severity: Minor
      Found in src/lib/components/parametricfunction.js - About 1 hr to fix

        Function update has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            this.update = function() {
        
                var offset = new THREE.Vector3();
        
                // so camera.up is the orbit axis
        Severity: Minor
        Found in src/lib/components/orbit-controls.js - About 1 hr to fix

          Function tick has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            tick: (function () {
              var position = new THREE.Vector3(),
                  meshPosition = new THREE.Vector3();
              return function () {
                var el = this.el,
          Severity: Minor
          Found in src/lib/components/sphere-collider.js - About 1 hr to fix

            Function update has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    return function update () {
            
                        var position = scope.object.position;
            
                        offset.copy( position ).sub( scope.target );
            Severity: Minor
            Found in src/lib/components/orbit-controls.js - About 1 hr to fix

              Function render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  const {
                    id, position, width, height, buttonColor, text, textColor, textWidth,
                  } = this.props
                  const { depth, opacity } = this.state
              Severity: Minor
              Found in src/components/CalcButton/index.js - About 1 hr to fix

                Function update has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  update: function(oldData) {
                    var scene = this.el.object3D;
                    // Equation parser
                    var equation = 'f(x,y) = ' + this.data.equation;
                
                
                Severity: Minor
                Found in src/lib/components/parametricfunction.js - About 45 mins 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

                Avoid too many return statements within this function.
                Open

                                if ( state !== STATE.TOUCH_DOLLY ) return; // is this needed?...
                Severity: Major
                Found in src/lib/components/orbit-controls.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  if ( scope.enablePan === false ) return;
                  Severity: Major
                  Found in src/lib/components/orbit-controls.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    if ( state !== STATE.TOUCH_PAN ) return; // is this needed?...
                    Severity: Major
                    Found in src/lib/components/orbit-controls.js - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language