Showing 26 of 57 total issues
Function exports
has 241 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function() {
var sankey = {},
nodeWidth = 24,
nodePadding = 8,
size = [1, 1],
- Create a ticketCreate a ticket
Function gameState
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
var gameState = function($q, notificationService, $filter, UPGRADES, ACHIEVEMENTS, GainCalculator, localStorage, AnimatedFlyTip) {
var getNewState = function() {
return {
upgrades: {},
- Read upRead up
- Create a ticketCreate a ticket
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 gameState
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
var gameState = function($q, notificationService, $filter, UPGRADES, ACHIEVEMENTS, GainCalculator, localStorage, AnimatedFlyTip) {
var getNewState = function() {
return {
upgrades: {},
- Create a ticketCreate a ticket
Function gameController
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
var gameController = function($scope, $window, $interval, $filter, $http, $modal, GameState, ChartConfigs, GameTimer, UpgradeManager, FunctionBuilder, UpgradePath, NgTableParams, ACHIEVEMENTS) {
$scope.ACHIEVEMENTS = ACHIEVEMENTS;
$scope._visibleUpgrades = [];
$scope.groupVisibleHash = {};
$scope.tabActive = [true, false, false, false];
- Create a ticketCreate a ticket
Function chartConfigs
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
var chartConfigs = function($q, GameState) {
var defer = $q.defer();
Highcharts.setOptions({
global: {
- Create a ticketCreate a ticket
Function sankey
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
var sankey = function(UpgradePath) {
return {
restrict: 'E',
scope: {},
link: function(scope, element) {
- Create a ticketCreate a ticket
Function link
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, element) {
const constants = {
OPACITY_LOW: 0.2,
OPACITY_HIGH: 0.6
- Create a ticketCreate a ticket
Function computeNodeDepths
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function computeNodeDepths(iterations) {
var nodesByBreadth = d3.nest()
.key(function(d) { return d.x; })
.sortKeys(d3.ascending)
.entries(nodes)
- Create a ticketCreate a ticket
Function gameController
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
var gameController = function($scope, $window, $interval, $filter, $http, $modal, GameState, ChartConfigs, GameTimer, UpgradeManager, FunctionBuilder, UpgradePath, NgTableParams, ACHIEVEMENTS) {
$scope.ACHIEVEMENTS = ACHIEVEMENTS;
$scope._visibleUpgrades = [];
$scope.groupVisibleHash = {};
$scope.tabActive = [true, false, false, false];
- Read upRead up
- Create a ticketCreate a ticket
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 upgrades.js
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
module.exports = {
Scoreboard: {
category: 'Visual',
levels: [{cost: 5, description: 'Visualize your score!'}]
- Create a ticketCreate a ticket
Function upgradeManager
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
var upgradeManager = function(GameState, UPGRADES, favico) {
var hasUpgrade = function(key, level = 0) {
return GameState.upgrade.has(key, level);
};
- Create a ticketCreate a ticket
Function functionBuilder
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
var functionBuilder = function(GameState, GainCalculator, $window) {
return {
build: function() {
var upgrade = GameState.upgrade;
- Create a ticketCreate a ticket
Function build
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
build: function() {
var upgrade = GameState.upgrade;
var unitText = `${_.camelCase(GameState.currencySet.get())}s`;
- Create a ticketCreate a ticket
Function functionBuilder
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
var functionBuilder = function(GameState, GainCalculator, $window) {
return {
build: function() {
var upgrade = GameState.upgrade;
- Read upRead up
- Create a ticketCreate a ticket
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 exports
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function() {
var sankey = {},
nodeWidth = 24,
nodePadding = 8,
size = [1, 1],
- Read upRead up
- Create a ticketCreate a ticket
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 visible
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
var visible = function() {
var current = GameState.unit.get();
var allRet = [];
- Create a ticketCreate a ticket
Function gameController
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
var gameController = function($scope, $window, $interval, $filter, $http, $modal, GameState, ChartConfigs, GameTimer, UpgradeManager, FunctionBuilder, UpgradePath, NgTableParams, ACHIEVEMENTS) {
- Create a ticketCreate a ticket
Function _initNodes
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
var _initNodes = function() {
var node = svg.append('g').selectAll('.node')
.data(scope.data.nodes)
.enter()
.append('g')
- Create a ticketCreate a ticket
Function load
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var load = function() {
var state = localStorage.get('game');
if(!state) { return; }
- Create a ticketCreate a ticket
Function upgradePath
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var upgradePath = function($q, GameState, UPGRADES) {
var defer = $q.defer();
var structure = {
nodes: [],
- Create a ticketCreate a ticket