carlmw/gitlactica

View on GitHub

Showing 34 of 34 total issues

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

module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    uglify: {
      build: {
Severity: Major
Found in Gruntfile.js - About 3 hrs to fix

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

      function animateTorpedo(move, torpedo, from, to) {
        animation.tween(
          from,
          to, 2e3, function () {
            move(torpedo, this.x, this.y, this.z);
    Severity: Major
    Found in lib/effects/fire_weapons.js and 1 other location - About 2 hrs to fix
    lib/effects/fire_change_bomb.js on lines 42..52

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

    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

      function animateTorpedo(move, torpedo, from, to) {
        animation.tween(
          from,
          to, 2e3, function () {
            move(torpedo, this.x, this.y, this.z);
    Severity: Major
    Found in lib/effects/fire_change_bomb.js and 1 other location - About 2 hrs to fix
    lib/effects/fire_weapons.js on lines 54..64

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

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

    module.exports = function (animation, renderer, name, repo, colour, additions, deletions, next) {
      renderer.addWeapons(name);
      if (deletions > 0 ) renderer.showBeam();
      if (additions + deletions === 0) return next();
      var currentComplete = 0,
    Severity: Major
    Found in lib/effects/fire_weapons.js - About 2 hrs to fix

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

      module.exports = function Renderer (channel) {
        var textures = textureLoader(loader, texturesToLoad, ready, fail),
            stage = scene(textures.skybox, textures.star1, textures.star2, textures.star3),
            ships = shipYard(stage.scene),
            launcher = torpedoLauncher(stage.scene, textures.torpedo),
      Severity: Minor
      Found in adapters/renderer.js - About 1 hr to fix

        Function exports has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function (animation, renderer, name, repo, colour, next) {
          renderer.addWeapons(name);
          var currentComplete = 0,
              planet = renderer.planetPosition(repo),
              planetMesh = renderer.planetMesh(repo),
        Severity: Minor
        Found in lib/effects/fire_change_bomb.js - About 1 hr to fix

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

          module.exports = function shipYard (scene) {
            var ships = {};
          
            return {
              addShip: addShip,
          Severity: Minor
          Found in adapters/webgl/ship_yard.js - About 1 hr to fix

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

            module.exports = function Star (scene, x, y, z, tex1, tex2, tex3) {
              var pos = new THREE.Vector3(x, y, z);
            
              addLight(pos);
              addFlare(0.55, 0.9, 0.5, pos);
            Severity: Minor
            Found in adapters/webgl/star.js - About 1 hr to fix

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

              module.exports = {
                committer: {
                  login: 'bobson',
                  avatar_url: '/bobson_avatar.jpg'
                },
              Severity: Major
              Found in tasks/responses/repos/carlmw/gitlactica/commits/8b07cc.js and 1 other location - About 1 hr to fix
              tasks/responses/repos/carlmw/gitlactica/commits/d94709.js on lines 1..12

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

              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

              module.exports = {
                committer: {
                  login: 'carlmw',
                  avatar_url: '/carlmw_avatar.jpg'
                },
              Severity: Major
              Found in tasks/responses/repos/carlmw/gitlactica/commits/d94709.js and 1 other location - About 1 hr to fix
              tasks/responses/repos/carlmw/gitlactica/commits/8b07cc.js on lines 1..12

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

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

              module.exports = function system(scene, camera, texture) {
                var planets = {};
              
                return {
                  addPlanet: addPlanet,
              Severity: Minor
              Found in adapters/webgl/system.js - About 1 hr to fix

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

                module.exports = function network (subspace, git) {
                  var alreadyPlayed = [];
                
                  subspace.on('fetch:events', function (login) {
                    git.events(login).then(handleEvents);
                Severity: Minor
                Found in lib/network.js - About 1 hr to fix

                  Function exports has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  module.exports = function () {
                    var i = 0,
                        added = [],
                        distance = 20000,
                        pos = { x: 0, y: 0, z: 0 };
                  Severity: Minor
                  Found in lib/effects/add_planet.js - About 1 hr 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 scene has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function scene (skyboxCubeTexture, starTexture1, starTexture2, starTexture3) {
                    var distance = 2000,
                        camera,
                        world,
                        renderer;
                  Severity: Minor
                  Found in adapters/webgl/scene.js - About 1 hr to fix

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

                            animation.wait(1700, function () {
                              renderer.detonateExplosion(pos.x, pos.y, pos.z, planet.x, planet.y, planet.z, planetMesh);
                            });
                    Severity: Major
                    Found in lib/effects/fire_weapons.js and 1 other location - About 1 hr to fix
                    lib/effects/fire_change_bomb.js on lines 31..33

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

                    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

                          animation.wait(1700, function () {
                            renderer.detonateExplosion(pos.x, pos.y, pos.z, target.x, target.y, target.z, planetMesh);
                          });
                    Severity: Major
                    Found in lib/effects/fire_change_bomb.js and 1 other location - About 1 hr to fix
                    lib/effects/fire_weapons.js on lines 41..43

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

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

                    module.exports = function () {
                      var locations = {},
                          orbits = {};
                    
                      return function orbitShip (animation, renderer, login, planet, next) {
                    Severity: Minor
                    Found in lib/effects/orbit_ship.js - About 1 hr to fix

                      Function github has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      module.exports = function github (transport, subspace) {
                        return {
                          repos: function () {
                            return request('/user/repos?sort=pushed');
                          },
                      Severity: Minor
                      Found in lib/github.js - About 1 hr to fix

                        Function camera has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = function camera (cam) {
                          var cameraPosition = cam.position.clone(),
                              lastTs,
                              targetMat = new THREE.Matrix4(),
                              targetQuat = new THREE.Quaternion(),
                        Severity: Minor
                        Found in adapters/webgl/camera.js - About 1 hr to fix

                          Function exports has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          module.exports = function () {
                            var i = 0,
                                added = [],
                                distance = 20000,
                                pos = { x: 0, y: 0, z: 0 };
                          Severity: Minor
                          Found in lib/effects/add_planet.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language