Showing 17 of 27 total issues
Function snowStorm
has a Cognitive Complexity of 254 (exceeds 5 allowed). Consider refactoring. Open
var snowStorm = (function(window, document) {
// --- common properties ---
this.autoStart = true; // Whether the snow should start automatically or not.
- 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 snowStorm
has 536 lines of code (exceeds 25 allowed). Consider refactoring. Open
var snowStorm = (function(window, document) {
// --- common properties ---
this.autoStart = true; // Whether the snow should start automatically or not.
File snow.js
has 538 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @license
* DHTML Snowstorm! JavaScript-based snow for web pages
* Making it snow on the internets since 2003. You're welcome.
* -----------------------------------------------------------
* Version 1.44.20131208 (Previous rev: 1.44.20131125)
Function SnowFlake
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.SnowFlake = function(type,x,y) {
var s = this;
this.type = type;
this.x = x||parseInt(rnd(screenX-20),10);
this.y = (!isNaN(y)?y:-rnd(screenY)-12);
File game.js
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use script';
var img = new Image();
img.src = "http://fassetar.github.io/penguins-rising/content/img/characters.png";
var canvas = document.getElementById("window");
Function exports
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function ( grunt ) {
pkg: grunt.file.readJSON('package.json'),
require( 'matchdep' ).filterDev('grunt-*').forEach( grunt.loadNpmTasks );
Function Enemy
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Enemy(I) {
I = I || {};
I.active = true;
I.age = Math.floor(Math.random() * 128);
I.x = Math.random() * canvas.width;
Function Enemy
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function Enemy(I) {
I = I || {};
I.active = true;
I.age = Math.floor(Math.random() * 128);
I.x = Math.random() * canvas.width;
- 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 update
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function() { //UPDATE METHOD
if ((TheTrulyDead.length > game.LvlEnemies) && (enemies.length === 0)) {
game.Lvlcomplete = true;
game.LvlEnemies += 5;
game.Lvl += 1;
Function move
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.move = function() {
var vX = s.vX*windOffset, yDiff;
s.x += vX;
s.y += (s.vY*s.vAmp);
if (s.x >= screenX || screenX-s.x < storm.flakeWidth) { // X-axis scroll check
Function events
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.events = (function() {
var old = (!window.addEventListener && window.attachEvent), slice = Array.prototype.slice,
evt = {
add: (old?'attachEvent':'addEventListener'),
Consider simplifying this complex logical expression. Open
if (window.innerWidth || window.innerHeight) {
screenX = window.innerWidth - 16 - storm.flakeRightOffset;
screenY = (storm.flakeBottom || window.innerHeight);
} else {
screenX = (document.documentElement.clientWidth || document.body.clientWidth || document.body.scrollWidth) - (!isIE ? 8 : 0) - storm.flakeRightOffset;
Function start
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.start = function(bFromOnLoad) {
if (!didInit) {
didInit = true;
} else if (bFromOnLoad) {
// already loaded and running
Function update
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
update: function() { //UPDATE METHOD
if ((TheTrulyDead.length > game.LvlEnemies) && (enemies.length === 0)) {
game.Lvlcomplete = true;
game.LvlEnemies += 5;
game.Lvl += 1;
- 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
Consider simplifying this complex logical expression. Open
if (welcome.leaderboards_loaded &&
welcome.achievement_defs_loaded &&
welcome.achievement_progress_loaded &&
welcome.player_data_loaded &&
welcome.challenge_loaded &&
Function dataLoaded
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
welcome.dataLoaded = function(whatData) {
if (whatData === welcome.ENUM_LEADERBOARDS) {
welcome.leaderboards_loaded = true;
} else if (whatData === welcome.ENUM_ACHIEVEMENT_DEFS) {
welcome.achievement_defs_loaded = true;
- 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 buildTableRowFromData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
achievementTable.buildTableRowFromData = function(achObject) {
var $tableRow = $('<tr></tr>');
var $achievementName = $('<td></td>').text(achObject.name).addClass('achievementName');
var $achievementDescrip = $('<td></td>').text(achObject.description).addClass('achievementDescrip');
var $achievementURL = '';
- 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"