plainblack/Lacuna-Web-Client

View on GitHub

Showing 509 of 1,320 total issues

Avoid deeply nested control flow statements.
Open

                        if(!newTileCache[x] || !newTileCache[x][y]) {
                            this.removeTile(x,y);
                        }
Severity: Major
Found in app/js-yui/mapper.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                    if(Dom.getStyle("tradeAddPlanName", "display") == "none") {
                                        Dom.setStyle("tradeAddPlanName", "display", "block");
                                        this.getPlans();
                                    }
                                    else {
    Severity: Major
    Found in app/js-yui/building/transporter.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                      if(Dom.getStyle("tradeAddResourceName", "display") == "none") {
                                          Dom.setStyle("tradeAddResourceName", "display", "block");
                                          this.getStoredResources();
                                      }
                                      else {
      Severity: Major
      Found in app/js-yui/building/transporter.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        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('');
        Severity: Major
        Found in app/js-yui/building/transporter.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if(doSub) {
                                      tile.unsubscribeAll(); //so we don't get multiple subs on the same tile
                                      tile.subscribe("onReload", this.onReloadTile, this, true);
                                  }
          Severity: Major
          Found in app/js-yui/mapper.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                            if(Dom.getStyle("tradeAddShipName", "display") == "none") {
                                                Dom.setStyle("tradeAddShipName", "display", "block");
                                                this.getShips();
                                            }
                                            else {
            Severity: Major
            Found in app/js-yui/building/transporter.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              if(Dom.getStyle("tradeAddPrisonerName", "display") == "none") {
                                                  Dom.setStyle("tradeAddPrisonerName", "display", "block");
                                                  this.getPrisoners();
                                              }
                                              else {
              Severity: Major
              Found in app/js-yui/building/transporter.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                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);
                Severity: Major
                Found in app/js-yui/mapper.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  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);
                  Severity: Major
                  Found in app/js-yui/building/archaeology.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    if(Dom.getStyle("tradePushResourceName", "display") == "none") {
                                                        Dom.setStyle("tradePushResourceName", "display", "block");
                                                        this.getStoredResources();
                                                    }
                                                    else {
                    Severity: Major
                    Found in app/js-yui/building/transporter.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      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);
                      Severity: Major
                      Found in app/js-yui/mapper.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                        if(Dom.getStyle("tradePushGlyphName", "display") == "none") {
                                                            Dom.setStyle("tradePushGlyphName", "display", "block");
                                                            this.getGlyphs();
                                                        }
                                                        else {
                        Severity: Major
                        Found in app/js-yui/building/transporter.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          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('');
                          Severity: Major
                          Found in app/js-yui/building/transporter.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                            if(Dom.getStyle("tradePushShipName", "display") == "none") {
                                                                Dom.setStyle("tradePushShipName", "display", "block");
                                                                this.getShips();
                                                            }
                                                            else {
                            Severity: Major
                            Found in app/js-yui/building/transporter.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              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 {
                              Severity: Major
                              Found in app/js-yui/building/wasteRecycling.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                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;
                                Severity: Major
                                Found in app/js-yui/building/miningMinistry.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  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>');
                                                          }
                                  Severity: Major
                                  Found in app/js-yui/building/miningMinistry.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    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 {
                                    Severity: Major
                                    Found in app/js-yui/building/spacePort.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if(Lang.isArray(resource)) {
                                                                  for(x=0; x < resource.length; x++) {
                                                                      name = resource[x];
                                                                      if(stash.stash[name]) {
                                                                          nLi = li.cloneNode(false);
                                      Severity: Major
                                      Found in app/js-yui/building/embassy.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                    if(tile) {
                                                                        if(tile.domElement) {
                                                                            var domEl = tile.domElement; // get the element
                                                                            var childEl = domEl.childNodes[1]; // find the alignment child
                                                                            if(childEl) {
                                        Severity: Major
                                        Found in app/js-yui/building/planetaryCommand.js - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language