Showing 82 of 157 total issues
Function FieldPane
has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring. Open
function FieldPane() {
this.relocateX = 0;
this.relocateY = 0;
this.allElements = [];
- 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 ServerCommListener
has 251 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ServerCommListener() {
var time = null;
this.showWaitOverlay = function() {
$('#overlay').show();
time = new Date();
Function exports
has 248 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(io, logger) {
io.sockets.on('connection', function (socket) {
/* A client creates a new game, joins it and waits for other players */
socket.on('createGame_req', function (data) {
Function drawText
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
BaseCard.drawText = function(ctx,text,profitConfig,x,y,width) {
if(typeof(profitConfig) !== 'undefined') {
for(var i = 0 ; i < profitConfig.length ; i++) {
var pf = profitConfig[i];
if(text.length > 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
File rule_game.js
has 483 lines of code (exceeds 250 allowed). Consider refactoring. Open
var Player = require("./rule_player.js");
var CardStack = require("./rule_cardstack.js");
var GameField = require('./rule_gamefield.js');
var Field = require('./rule_field.js');
var CardFactory = require('./rule_cardfactory.js');
Function CardLayouter
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
function CardLayouter(ctx) {
this.cards = [];
this.maxWidth = 600;
this.currentlyExpanded = null;
- 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 FieldPane
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FieldPane() {
this.relocateX = 0;
this.relocateY = 0;
this.allElements = [];
Function AuctionPanel
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
function AuctionPanel() {
this.cards = [];
this.currentlyClicked = null;
this.selectable = false;
this.setCards = function(cards) {
- 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 ServerCommListener
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
function ServerCommListener() {
var time = null;
this.showWaitOverlay = function() {
$('#overlay').show();
time = new Date();
- 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 InfoBar
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
function InfoBar() {
this.money = -1;
this.currentDate;
this.playerNumber = -1;
this.showLargeInfo = false;
- 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 storeGame
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
storeGame : function(game, prepare, onSuccess, onFail) {
var prepareAndInsert = function(newGame, directInsert) {
try {
var doInsert = true;
if(prepare != null) {
- 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 Card
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
function Card(id,title,text,actionBit,playType,profitConfig,range,localLevelMod,type,ctx) {
this.Inherits(BaseCard);
this.id = id;
this.title = title;
this.text = text;
- 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 CardLayouter
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
function CardLayouter(ctx) {
this.cards = [];
this.maxWidth = 600;
this.currentlyExpanded = null;
Function Card
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Card(id,title,text,actionBit,playType,profitConfig,range,localLevelMod,type,ctx) {
this.Inherits(BaseCard);
this.id = id;
this.title = title;
this.text = text;
Function removeCardFromAuction
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Game.prototype.removeCardFromAuction = function(cardId, playerId) {
var c = null;
if(this.gameState == GameStates.PICK_CARD) {
for(var i = 0 ; i < this.cardsToAuction.length ; i++) {
if(this.cardsToAuction[i].id == cardId) {
- 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 drawText
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
BaseCard.drawText = function(ctx,text,profitConfig,x,y,width) {
if(typeof(profitConfig) !== 'undefined') {
for(var i = 0 ; i < profitConfig.length ; i++) {
var pf = profitConfig[i];
if(text.length > 0 ) {
Function Global
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Global() {
this.canvas = document.getElementById('gameCanvas');
this.ctx = this.canvas.getContext('2d');
this.uiMode = 0;
this.playerId = null; // identifier, secret
Function InfoBar
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function InfoBar() {
this.money = -1;
this.currentDate;
this.playerNumber = -1;
this.showLargeInfo = false;
Function AuctionPanel
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AuctionPanel() {
this.cards = [];
this.currentlyClicked = null;
this.selectable = false;
this.setCards = function(cards) {
Function GlobalListeners
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function GlobalListeners() {
this.buttonDown = false;
this.moved = false;
this.startMoveX=0;