Showing 26 of 34 total issues
Function exports
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
build: {
Function exports
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
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,
Function Renderer
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
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),
Function exports
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (animation, renderer, name, repo, colour, next) {
renderer.addWeapons(name);
var currentComplete = 0,
planet = renderer.planetPosition(repo),
planetMesh = renderer.planetMesh(repo),
Function shipYard
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function shipYard (scene) {
var ships = {};
return {
addShip: addShip,
Function Star
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Function system
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function system(scene, camera, texture) {
var planets = {};
return {
addPlanet: addPlanet,
Function network
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function network (subspace, git) {
var alreadyPlayed = [];
subspace.on('fetch:events', function (login) {
git.events(login).then(handleEvents);
Function exports
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function () {
var i = 0,
added = [],
distance = 20000,
pos = { x: 0, y: 0, z: 0 };
- Read upRead up
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
Open
module.exports = function scene (skyboxCubeTexture, starTexture1, starTexture2, starTexture3) {
var distance = 2000,
camera,
world,
renderer;
Function exports
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function () {
var locations = {},
orbits = {};
return function orbitShip (animation, renderer, login, planet, next) {
Function github
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function github (transport, subspace) {
return {
repos: function () {
return request('/user/repos?sort=pushed');
},
Function camera
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function camera (cam) {
var cameraPosition = cam.position.clone(),
lastTs,
targetMat = new THREE.Matrix4(),
targetQuat = new THREE.Quaternion(),
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function () {
var i = 0,
added = [],
distance = 20000,
pos = { x: 0, y: 0, z: 0 };
Function loop
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function loop (n) {
animation.wait(300 * n, function () {
var pos,
torpedo;
Function explosions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function explosions (scene) {
var lights = _.times(EXPLOSION_COUNT, function () {
var l = light.clone();
scene.add(l);
return l;
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (grunt) {
var server;
grunt.registerTask('start_test_server', function() {
nock.disableNetConnect();
nock('https://api.github.com')
Function exports
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
module.exports = function (animation, renderer, name, repo, colour, additions, deletions, next) {
Function exports
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
module.exports = function Star (scene, x, y, z, tex1, tex2, tex3) {
Function languageColourMapper
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
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;
- Read upRead up
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"