Showing 26 of 57 total issues
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);
};
- 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 8 arguments (exceeds 4 allowed). Consider refactoring. Open
var gameState = function($q, notificationService, $filter, UPGRADES, ACHIEVEMENTS, GainCalculator, localStorage, AnimatedFlyTip) {
- Create a ticketCreate a ticket
Function gameTimer
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
var gameTimer = function($q, $interval, $timeout, $window, GameState, AdManager, GainCalculator) {
- Create a ticketCreate a ticket
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 />');
- 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 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();
- 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 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) {
- 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"