Showing 13 of 57 total issues

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: {},
Severity: Minor
Found in src/js/gamestate.js - About 7 hrs 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 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];
Severity: Minor
Found in src/js/gamecontroller.js - About 3 hrs 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

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!'}]
Severity: Minor
Found in src/js/upgrades.js - About 2 hrs to fix

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;
Severity: Minor
Found in src/js/functionbuilder.js - About 2 hrs 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 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],
Severity: Minor
Found in src/extjs/sankeyfunctionality.js - About 2 hrs 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 visible has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var visible = function() {

    var current = GameState.unit.get();
    var allRet = [];

Severity: Minor
Found in src/js/upgrademanager.js - About 1 hr to fix

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')
Severity: Minor
Found in src/js/sankey.js - About 1 hr to fix

Function load has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var load = function() {
    var state = localStorage.get('game');

    if(!state) { return; }

Severity: Minor
Found in src/js/gamestate.js - About 1 hr to fix

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: [],
Severity: Minor
Found in src/js/upgradepath.js - About 1 hr to fix

Function upgradeManager has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

var upgradeManager = function(GameState, UPGRADES, favico) {

  var hasUpgrade = function(key, level = 0) {
    return GameState.upgrade.has(key, level);
  };
Severity: Minor
Found in src/js/upgrademanager.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 animatedFlyTip has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

var animatedFlyTip = function($filter) {
  return {
    fly: function(num, useSeparator = false) {
      var $element = $('<div />');

Severity: Minor
Found in src/js/animatedflytip.js - About 35 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

Function gameTimer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

var gameTimer = function($q, $interval, $timeout, $window, GameState, AdManager, GainCalculator) {

  var interval = null;
  var timerDefer = $q.defer();

Severity: Minor
Found in src/js/gametimer.js - About 35 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

Function gainCalculator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var gainCalculator = function() {

  var boost = (upgrade) => Math.max(1, Math.pow(upgrade.getKey('Basic Boost') || 0, 2)+1);

  var iteration = function(upgrade) {
Severity: Minor
Found in src/js/gaincalculator.js - About 25 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