Showing 102 of 183 total issues
Function stringifyJSON
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
stringifyJSON: function (value) {
var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, meta = {
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
File CombatCommandPhase.java
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
package de.oglimmer.ggo.logic.phase;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
BasePhase
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
@RequiredArgsConstructor
abstract public class BasePhase implements de.oglimmer.atmospheremvc.game.Phase {
private static final long serialVersionUID = 1L;
Method command
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public void command() {
CombatCommandPhase combatCommandPhase = (CombatCommandPhase) game.getCurrentPhase();
game.getBoard().getFields().stream().filter(f -> f.getUnit() != null)
.filter(f -> f.getUnit().getPlayer() == player).map(f -> f.getUnit()).forEach(u -> {
Function draw0
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Unit.prototype.draw0 = function(ctx) {
var x = this.x;
var y = this.y;
var width = this.width;
var height = this.height;
Function getFieldByPos
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/*private*/Board.prototype.getFieldByPos = function(pos) {
// x,y base coordinate
var hexPosY = Math.floor(pos.y / (Constants.size.height * 0.75));
var hexPosX = Math.floor(pos.x / Constants.size.width);
// odd or even row?
Function _invokeCallback
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _invokeCallback() {
var call = function (index, func) {
func(_response);
};
Function _handleProtocol
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _handleProtocol(request, message) {
var nMessage = message;
if (request.transport === 'polling') return nMessage;
Function _doRequest
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _doRequest(ajaxRequest, request, create) {
// Prevent Android to cache request
var url = request.url;
if (request.dispatchUrl != null && request.method === 'POST') {
url += request.dispatchUrl;
Function str
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return window.JSON && window.JSON.stringify ? window.JSON.stringify(value) : (function str(key, holder) {
var i, v, len, partial, value = holder[key], type = typeof value;
if (value && typeof value === "object" && typeof value.toJSON === "function") {
value = value.toJSON(key);
Function draw
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ModalDialog.prototype.draw = function(ctx) {
if(!this.show) {
return;
}
Function trackObject
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var trackObject= function(obj, callback, recursive, addNRemove) {
var change = null,lastTimerID = -1;
var isArr = isArray(obj);
var level,fn = function(prop, action, newValue, oldValue) {
var timerID = getTimerID();
Method getSupportableFields
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
public Set<Field> getSupportableFields(CommandCenter cc) {
assert this.unitType != UnitType.ARTILLERY;
/*
* A unit can support a neighbor if an own unit is currently there and
* not moving away.
- 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
Method execCmd
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
@Override
public void execCmd(Player player, String cmd, String param) {
super.execCmd(player, cmd, param);
switch (cmd) {
case "selectHandCard":
- 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 windowref
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
windowref: function () {
// Internet Explorer raises an invalid argument error
// when calling the window.open method with the name containing non-word characters
var neim = name.replace(/\W/g, ""), container = document.getElementById(neim), win;
Function _execute
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _execute() {
// Shared across multiple tabs/windows.
if (_request.shared) {
_localStorageService = _local(_request);
if (_localStorageService != null) {
Function storage
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
storage: function () {
function onstorage(event) {
if (event.key === name && event.newValue) {
listener(event.newValue);
}
Function _trackMessageSize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _trackMessageSize(message, request, response) {
message = _handleProtocol(request, message);
if (message.length === 0)
return true;
Function poll
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function poll() {
var url = rq.url;
if (rq.dispatchUrl != null) {
url += rq.dispatchUrl;
}
Function each
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
each: function (obj, callback, args) {
if (!obj) return;
var value, i = 0, length = obj.length, isArray = atmosphere.util.isArray(obj);
if (args) {