Showing 509 of 1,320 total issues
Avoid deeply nested control flow statements. Open
Open
if(!newTileCache[x] || !newTileCache[x][y]) {
this.removeTile(x,y);
}
Avoid deeply nested control flow statements. Open
Open
if(Dom.getStyle("tradeAddPlanName", "display") == "none") {
Dom.setStyle("tradeAddPlanName", "display", "block");
this.getPlans();
}
else {
Avoid deeply nested control flow statements. Open
Open
if(Dom.getStyle("tradeAddResourceName", "display") == "none") {
Dom.setStyle("tradeAddResourceName", "display", "block");
this.getStoredResources();
}
else {
Avoid deeply nested control flow statements. Open
Open
if(obj.extra_build_level > 0) {
nLi.innerHTML = ['<span class="tradeResourceName">',obj.name,' ',obj.level,'+',obj.extra_build_level, ' (<label class="quantity">', obj.quantity, '</label>)</span> <input type="text" style="width:75px;" /><button type="button">+</button>'].join('');
}
else {
nLi.innerHTML = ['<span class="tradeResourceName">',obj.name,' ',obj.level, ' (<label class="quantity">', obj.quantity, '</label>)</span> <input type="text" style="width:75px;" /><button type="button">+</button>'].join('');
Avoid deeply nested control flow statements. Open
Open
if(doSub) {
tile.unsubscribeAll(); //so we don't get multiple subs on the same tile
tile.subscribe("onReload", this.onReloadTile, this, true);
}
Avoid deeply nested control flow statements. Open
Open
if(Dom.getStyle("tradeAddShipName", "display") == "none") {
Dom.setStyle("tradeAddShipName", "display", "block");
this.getShips();
}
else {
Avoid deeply nested control flow statements. Open
Open
if(Dom.getStyle("tradeAddPrisonerName", "display") == "none") {
Dom.setStyle("tradeAddPrisonerName", "display", "block");
this.getPrisoners();
}
else {
Avoid deeply nested control flow statements. Open
Open
if(!tile) {
var ox = (xc - this.baseTileLoc[0]) * this.map.tileSizeInPx;
var oy = ((yc * -1) - this.baseTileLoc[1]) * this.map.tileSizeInPx;
//var offsets = this.visibleArea.getOffsetFromCoords(xc, xy, this.baseTileCoords[0], this.baseTileCoords[1]);
tile = new this.TileConstructor(xc, yc, this.map.zoom, ox, oy, this);
Avoid deeply nested control flow statements. Open
Open
if (fromAvailableList) {
// moving from 'details' list to 'combine' list
// clone it - don't just move it
var clone = El.cloneNode(true);
this._removeGlyphCount(clone);
Avoid deeply nested control flow statements. Open
Open
if(Dom.getStyle("tradePushResourceName", "display") == "none") {
Dom.setStyle("tradePushResourceName", "display", "block");
this.getStoredResources();
}
else {
Avoid deeply nested control flow statements. Open
Open
if(!tile) {
var ox = (xc - this.baseTileLoc[0]) * this.map.tileSizeInPx;
var oy = ((yc * -1) - this.baseTileLoc[1]) * this.map.tileSizeInPx;
//var offsets = this.visibleArea.getOffsetFromCoords(xc, xy, this.baseTileCoords[0], this.baseTileCoords[1]);
tile = new this.TileConstructor(xc, yc, this.map.zoom, ox, oy, this);
Avoid deeply nested control flow statements. Open
Open
if(Dom.getStyle("tradePushGlyphName", "display") == "none") {
Dom.setStyle("tradePushGlyphName", "display", "block");
this.getGlyphs();
}
else {
Avoid deeply nested control flow statements. Open
Open
if (obj.extra_build_level > 0) {
nLi.innerHTML = ['<span class="tradeResourceName">',obj.name,' ',obj.level,'+',obj.extra_build_level, ' (<label class="quantity">', obj.quantity, '</label>)</span> <input type="text" style="width:75px;" /><button type="button">+</button>'].join('');
}
else {
nLi.innerHTML = ['<span class="tradeResourceName">',obj.name,' ',obj.level,' (<label class="quantity">', obj.quantity, '</label>)</span> <input type="text" style="width:75px;" /><button type="button">+</button>'].join('');
Avoid deeply nested control flow statements. Open
Open
if(Dom.getStyle("tradePushShipName", "display") == "none") {
Dom.setStyle("tradePushShipName", "display", "block");
this.getShips();
}
else {
Avoid deeply nested control flow statements. Open
Open
if(this.work && this.work.seconds_remaining && this.work.seconds_remaining*1 > 0) {
ce.appendChild(this.RecycleGetTimeDisplay(o.result.recycle, water, ore, energy));
this.addQueue(this.work.seconds_remaining, this.RecycleQueue, "recycleTime", this);
}
else {
Avoid deeply nested control flow statements. Open
Open
if(total > 0) {
outOre.splice(1, 0, '<li><label>Total:</label> ');
outOre.splice(2, 0, parseInt(total));
outOre.splice(3, 0, '</li>');
grand_total += total;
Avoid deeply nested control flow statements. Open
Open
if(totals[ore_i] > 0) {
outOre.push('<li><label>' + ore.replace(/^\w/, function(c){ return c.toUpperCase() }) + ':</label> ');
outOre.push(totals[ore_i]);
outOre.push('</li>');
}
Avoid deeply nested control flow statements. Open
Open
if(ship.from.empire && ship.from.empire.name) {
nLi.innerHTML = ship.from.name + ' <span style="cursor:pointer;">[' + ship.from.empire.name + ']</span>';
Event.on(nLi, "click", this.EmpireProfile, ship.from.empire);
}
else {
Avoid deeply nested control flow statements. Open
Open
if(Lang.isArray(resource)) {
for(x=0; x < resource.length; x++) {
name = resource[x];
if(stash.stash[name]) {
nLi = li.cloneNode(false);
Avoid deeply nested control flow statements. Open
Open
if(tile) {
if(tile.domElement) {
var domEl = tile.domElement; // get the element
var childEl = domEl.childNodes[1]; // find the alignment child
if(childEl) {