carlmw/gitlactica

View on GitHub

Showing 26 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

    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

              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

                    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

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

                              function loop (n) {
                                animation.wait(300 * n, function () {
                                  var pos,
                                      torpedo;
                            
                            
                            Severity: Minor
                            Found in lib/effects/fire_weapons.js - About 1 hr to fix

                              Function explosions has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              module.exports = function explosions (scene) {
                                var lights = _.times(EXPLOSION_COUNT, function () {
                                  var l = light.clone();
                                  scene.add(l);
                                  return l;
                              Severity: Minor
                              Found in adapters/webgl/explosions.js - About 1 hr to fix

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

                                module.exports = function (grunt) {
                                  var server;
                                  grunt.registerTask('start_test_server', function() {
                                    nock.disableNetConnect();
                                    nock('https://api.github.com')
                                Severity: Minor
                                Found in tasks/test_server.js - About 1 hr to fix

                                  Function exports has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  module.exports = function (animation, renderer, name, repo, colour, additions, deletions, next) {
                                  Severity: Major
                                  Found in lib/effects/fire_weapons.js - About 1 hr to fix

                                    Function exports has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    module.exports = function Star (scene, x, y, z, tex1, tex2, tex3) {
                                    Severity: Major
                                    Found in adapters/webgl/star.js - About 50 mins to fix

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

                                      module.exports = function languageColourMapper (input) {
                                        return _(input).reduce(function (memo, item, language) {
                                          var colour = item.color;
                                          if (item.group) {
                                            colour = input[item.group].color;
                                      Severity: Minor
                                      Found in lib/language_colour_mapper.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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language