SimonHFrost/Rainbow_Slice

View on GitHub

Showing 72 of 72 total issues

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

THREE.OrbitControls = function ( object, domElement ) {

    this.object = object;
    this.domElement = ( domElement !== undefined ) ? domElement : document;

Severity: Minor
Found in public/resources/lib/OrbitControls.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 315 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 public/resources/lib/OrbitControls.js - About 1 day to fix

    Function Movement has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

    window.Movement = (function () {
      "use strict";
      function Movement(sceneObjects, player) {
        this.sceneObjects = sceneObjects;
        this.player = player;
    Severity: Minor
    Found in public/dynamic/movement.js - About 4 hrs 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 BoundaryCollisionDetector has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

    window.BoundaryCollisionDetector = (function () {
      "use strict";
      function BoundaryCollisionDetector(sceneObjects, scene, player) {
        this.FLOOR_DIMENSIONS = 3000;
        this.RAY_OFFSET = -200;
    Severity: Minor
    Found in public/collisionDetectors/boundaryCollisionDetector.js - About 4 hrs 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

        var islandVectors = [
          new THREE.Vector3(-8000,floor,500),
          new THREE.Vector3(-7000,floor,-3000),
          new THREE.Vector3(-1500,floor,-5000),
          new THREE.Vector3(-1000,floor,-8000),
    Severity: Major
    Found in public/setup/islandInitializer.js and 1 other location - About 4 hrs to fix
    public/setup/islandInitializer.js on lines 46..55

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

    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

        var bottomVectors = [
          new THREE.Vector3(-8000,islandFloor,500),
          new THREE.Vector3(-7000,islandFloor,-3000),
          new THREE.Vector3(-1500,islandFloor,-5000),
          new THREE.Vector3(-1000,islandFloor,-8000),
    Severity: Major
    Found in public/setup/islandInitializer.js and 1 other location - About 4 hrs to fix
    public/setup/islandInitializer.js on lines 22..31

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

    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 BoundaryCollisionDetector has 100 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    window.BoundaryCollisionDetector = (function () {
      "use strict";
      function BoundaryCollisionDetector(sceneObjects, scene, player) {
        this.FLOOR_DIMENSIONS = 3000;
        this.RAY_OFFSET = -200;
    Severity: Major
    Found in public/collisionDetectors/boundaryCollisionDetector.js - About 4 hrs to fix

      Function IslandInitializer has 100 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      window.IslandInitializer = (function() {
        "use strict";
        function IslandInitializer(materials) {
          this.materials = materials;
        }
      Severity: Major
      Found in public/setup/islandInitializer.js - About 4 hrs to fix

        Function Enemy has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

        window.Enemy = (function() {
          "use strict";
          function Enemy(sceneObjects, scene, size, positionX, positionZ, updatableObjects, player, materials) {
            this.FIRE_RATE = 0.05;
            this.FIRE_FAILURE_RATE = 0.4;
        Severity: Minor
        Found in public/sceneObjects/enemy.js - About 3 hrs 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 OrbitControls.js has 318 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: Minor
        Found in public/resources/lib/OrbitControls.js - About 3 hrs to fix

          Function Enemy has 90 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          window.Enemy = (function() {
            "use strict";
            function Enemy(sceneObjects, scene, size, positionX, positionZ, updatableObjects, player, materials) {
              this.FIRE_RATE = 0.05;
              this.FIRE_FAILURE_RATE = 0.4;
          Severity: Major
          Found in public/sceneObjects/enemy.js - About 3 hrs to fix

            Function BulletCollisionDetector has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

            window.BulletCollisionDetector = (function () {
              "use strict";
              function BulletCollisionDetector(sceneObjects, scene, story, player, playerWidth, enemyWidth) {
                this.sceneObjects = sceneObjects;
                this.scene = scene;
            Severity: Minor
            Found in public/collisionDetectors/bulletCollisionDetector.js - About 3 hrs 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 SceneObjects has 75 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            window.SceneObjects = (function() {
              "use strict";
            
              function SceneObjects(scene, camera, materials) {
                this.FLOOR = -100;
            Severity: Major
            Found in public/sceneObjects/sceneObjects.js - About 3 hrs to fix

              Function Movement has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              window.Movement = (function () {
                "use strict";
                function Movement(sceneObjects, player) {
                  this.sceneObjects = sceneObjects;
                  this.player = player;
              Severity: Major
              Found in public/dynamic/movement.js - About 2 hrs to fix

                Function MeshLoader has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                window.MeshLoader = (function() {
                  "use strict";
                
                  function MeshLoader(sceneObjects, player, morphs) {
                    this.FLOOR = 0;
                Severity: Major
                Found in public/setup/meshLoader.js - About 2 hrs to fix

                  Function EnemySpawner has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  window.EnemySpawner = (function(){
                    "use strict";
                    function EnemySpawner(sceneObjects, scene, meshLoader, updatableObjects, player, materials, enemyWidth) {
                      this.MAX_ENEMIES = 15;
                      this.SPAWN_RATE = 0.1;
                  Severity: Major
                  Found in public/setup/enemySpawner.js - About 2 hrs to fix

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

                      Sound.prototype.initializeDynamicSource = function() {
                        this.dynamicSoundsSource = document.createElement('source');
                    
                        this.dynamicSoundsAudio = document.createElement('audio');
                        this.dynamicSoundsAudio.appendChild(this.dynamicSoundsSource);
                    Severity: Major
                    Found in public/dynamic/sound.js and 1 other location - About 2 hrs to fix
                    public/dynamic/sound.js on lines 15..20

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

                    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

                      Sound.prototype.initializeThemeSource = function() {
                        this.themeSource = document.createElement('source');
                    
                        this.themeAudio = document.createElement('audio');
                        this.themeAudio.appendChild(this.themeSource);
                    Severity: Major
                    Found in public/dynamic/sound.js and 1 other location - About 2 hrs to fix
                    public/dynamic/sound.js on lines 8..13

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

                    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 BulletCollisionDetector has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    window.BulletCollisionDetector = (function () {
                      "use strict";
                      function BulletCollisionDetector(sceneObjects, scene, story, player, playerWidth, enemyWidth) {
                        this.sceneObjects = sceneObjects;
                        this.scene = scene;
                    Severity: Minor
                    Found in public/collisionDetectors/bulletCollisionDetector.js - About 1 hr to fix

                      Function Story has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      window.Story = (function () {
                        "use strict";
                        function Story(scene, network, allBullets, sound) {
                          this.scene = scene;
                          this.network = network;
                      Severity: Minor
                      Found in public/dynamic/story.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language