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: {
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);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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,
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),
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),
Function shipYard
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function shipYard (scene) {
var ships = {};
return {
addShip: addShip,
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);
Similar blocks of code found in 2 locations. Consider refactoring. Open
module.exports = {
committer: {
login: 'bobson',
avatar_url: '/bobson_avatar.jpg'
},
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
module.exports = {
committer: {
login: 'carlmw',
avatar_url: '/carlmw_avatar.jpg'
},
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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,
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);
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 };
- 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
module.exports = function scene (skyboxCubeTexture, starTexture1, starTexture2, starTexture3) {
var distance = 2000,
camera,
world,
renderer;
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);
});
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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);
});
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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) {
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');
},
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(),
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 };