plainblack/Lacuna-Web-Client

View on GitHub

Showing 509 of 1,320 total issues

Avoid deeply nested control flow statements.
Open

                            if (b.pending_build) {
                                var buildLength = b.pending_build.seconds_remaining*1;
                                if (buildLength > buildQueueTotal) {
                                    buildQueueTotal = buildLength;
                                }
Severity: Major
Found in app/js-yui/building/subspaceSupplyDepot.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            for (var ore_i in ores) {
                                var ore = ores[ore_i];
                                if(obj[ore + '_hour'] > 0) {
                                    outOre.push('<li><label>' + ore.replace(/^\w/, function(c){ return c.toUpperCase() }) + ':</label> ');
                                    outOre.push(obj[ore+'_hour']);
    Severity: Major
    Found in app/js-yui/building/miningMinistry.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/wasteExchanger.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.stored[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(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(Lacuna.MapStar._map.tileCache[cp.x] && Lacuna.MapStar._map.tileCache[cp.x][cp.y]) {
                                            delete Lacuna.MapStar._map.tileCache[cp.x][cp.y]; // Remove the planet from the cache
                                        }
            Severity: Major
            Found in app/js-yui/building/planetaryCommand.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          for (var j=0; j<options.length; j++) {
                            typeSelector = typeSelector + [
                              '<option value="', options[j], '">', options[j], '</option>'
                            ].join('');
                          }
              Severity: Major
              Found in app/js-yui/building/blackHoleGenerator.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/tradeMinistry.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          for(x=0; x < resource.length; x++) {
                                              name = resource[x];
                                              option = document.createElement("option");
                                              option.setAttribute("value", name);
                                              option.innerHTML = name.titleCaps();
                  Severity: Major
                  Found in app/js-yui/building/tradeMinistry.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        else if(resource) {
                                            option = document.createElement("option");
                                            option.setAttribute("value", r);
                                            option.innerHTML = r.titleCaps();
                                            
                    Severity: Major
                    Found in app/js-yui/building/tradeMinistry.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  if(filters[tags[t]]){
                                                      filterMatch++;
                                                  }
                      Severity: Major
                      Found in app/js-yui/mapPlanet.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if(!cur[orig[s]]) {
                                                    isDirty = true;
                                                    break;
                                                }
                        Severity: Major
                        Found in app/js-yui/textboxList.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                          if (obj.type == this.type) {
                                                              opts[opts.length] = '<option value="' + obj.id + '">' + obj.name + '</option>';
                                                          }
                          Severity: Major
                          Found in app/js-yui/module/parliament.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/tradeMinistry.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(this.resources[name]) {
                                                                  nLi = li.cloneNode(false);
                              Severity: Major
                              Found in app/js-yui/building/distributionCenter.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/tradeMinistry.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

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

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if(img.link) {
                                                                imgDiv.innerHTML = [
                                                                    '<a href="',img.link,'" title="',img.title,'" target="_blank"><img src="',img.url,'" alt="',img.title,'" title="',img.title,'" /></a>'
                                                                ].join('');
                                                            }
                                    Severity: Major
                                    Found in app/js-yui/messaging.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

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

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if(!Dom.inDocument(this._elGrid)) {
                                                                    document.getElementById("content").appendChild(this._elGrid);
                                                                }
                                        Severity: Major
                                        Found in app/js-yui/mapPlanet.js - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language