Showing 82 of 157 total issues
Function setBaseFillStyle
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
UIElement.prototype.setBaseFillStyle = function() {
switch(this.type) {
case -1:/*UNKNWON*/
this.fillStyleN = '#333333';
break;
File ioHandler.js
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
var GameStates = require("./rule_defines.js").GameStates;
var Field = require('./rule_field.js');
var GameField = require('./rule_gamefield.js');
var util = require('util');
Function add
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
GameField.prototype.add = function(width, height, houseType, maxPop, localLevel) {
if(this.freeRange.length == 0 ) {
this.minX -= 3;
this.minY -= 3;
- 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 setBaseFillStyle
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
UIElement.prototype.setBaseFillStyle = function() {
switch(this.type) {
case -1:/*UNKNWON*/
this.fillStyleN = '#333333';
break;
- 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 ServerCommListener.js
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* ------------------------------------------ */
/* class ServerCommListener */
/* ------------------------------------------ */
function ServerCommListener() {
var time = null;
Function storeGame
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
storeGame : function(game, prepare, onSuccess, onFail) {
var prepareAndInsert = function(newGame, directInsert) {
try {
var doInsert = true;
if(prepare != null) {
Function InfoField
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function InfoField(ctx) {
this.field = null;
this.x = ctx.canvas.width-224;
this.y = 60;
this.width = 216;
- 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 getPlayers
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPlayers : function(gameId, perRow, allRows) {
if(typeof gameId === "undefined") {
logger.error("Error in getPlayers - gameId is undefined");
}
db.view("game", "playersByGameId", { key : gameId }, function(err, body) {
Function baseHtmlHandler
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function baseHtmlHandler (req, res) {
var lang = req.headers["accept-language"];
logger.debug("Lang:"+lang);
if((/^de/).test(lang)) {
lang = "de";
Function AuctionCard
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AuctionCard(id,title,text,x,y,profitConfig,range,localLevelMod,type,ctx) {
this.Inherits(BaseCard);
this.id = id;
this.title = title;
this.text = text;
Function Button
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function Button(label,x, y, width, onclick) {
this.label = label;
this.width = width != null ? width : 60;
this.height = 20;
this.enabled = 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 processAuctionBid
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Game.prototype.processAuctionBid = function(allPlayers) {
logger.debug("[processAuctionBid] start. this.biddings=%j", this.biddings);
this.gameState = GameStates.PICK_CARD;
// if a player had left the game and rejoined again his bidding is undefined. So tread this as $0.
Function draw
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
UIElement.prototype.draw = function(ctx, relocateX, relocateY) {
ctx.beginPath();
// get the background-color
if(this.fillStyleH != null) {
Function InfoField
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function InfoField(ctx) {
this.field = null;
this.x = ctx.canvas.width-224;
this.y = 60;
this.width = 216;
Function draw
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.draw = function(ctx) {
ctx.beginPath();
ctx.rect(0,0,ctx.canvas.width,20);
ctx.rect(500,0,0,20);
ctx.fillStyle = '#8ED6FF';
Function Card
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
function Card(id,title,text,actionBit,playType,profitConfig,range,localLevelMod,type,ctx) {
Function forEachField
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Card.forEachField = function(range, field, fields, perField) {
for(var x = -range ; x <= range ; x++) {
for(var y = -range ; y <= range ; y++) {
if(x!=0 || y!=0) {
var surroundingElement = fields[(field.x+x)+":"+(field.y+y)];
- 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 AuctionCard
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
function AuctionCard(id,title,text,x,y,profitConfig,range,localLevelMod,type,ctx) {
Function draw
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.draw = function(ctx) {
ctx.font = '12px Arial';
ctx.beginPath();
ctx.rect(this.x,this.y,this.width,this.height);
if(this.clicked) {
Function Button
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Button(label,x, y, width, onclick) {
this.label = label;
this.width = width != null ? width : 60;
this.height = 20;
this.enabled = true;