plainblack/Lacuna-Web-Client

View on GitHub

Showing 509 of 1,320 total issues

Function StashExchangeAdd has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        StashExchangeAdd : function(e, matchedEl, container){
            var quantity = Lib.getSelectedOptionValue(matchedEl.previousSibling)*1,
                li = matchedEl.parentNode,
                c = Dom.get("embassyStashToExchange");
            if(quantity && c) {
Severity: Minor
Found in app/js-yui/building/embassy.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

    if (typeof YAHOO.rpc.Service == "undefined" || !YAHOO.rpc.Service) {
    
    (function() {
    
        var Lang = YAHOO.lang,
    Severity: Critical
    Found in app/js-yui/rpc.js - About 1 hr to fix

      Function getTileData has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              getTileData : function(callback, x1, x2, y1, y2) {
                  var xDiff = Math.abs(x2-x1),
                      yDiff = Math.abs(y2-y1);
      
                  if((xDiff * yDiff) > MAX_STAR_AREA) { //if out of bounds split and try again
      Severity: Minor
      Found in app/js-yui/mapper.js - About 1 hr to fix

        Function viewSupplyShips has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                viewSupplyShips : function(e) {
                    // we have 2 asynchronous functions below both wanting to hide
                    // the pulser - keep a count of requests so it only gets hidden
                    // once they've both completed
                    var request_count = 0;
        Severity: Minor
        Found in app/js-yui/building/tradeMinistry.js - About 1 hr to fix

          Function render has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              render : function() {
                  return (
                      <div>
                          <div
                              className="ui horizontal inverted divider"
          Severity: Minor
          Found in app/js/components/menu/rightSidebar.jsx - About 1 hr to fix

            Function _getOneForOneTab has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _getOneForOneTab : function() {
                        this.oneForOne = new YAHOO.widget.Tab({ label: "One For One", content: ['<div class="transporterOneForOne">',
                            '<div>You may trade one-for-one with Lacuna Corp for 3<img src="',Lib.AssetUrl,'ui/s/essentia.png" class="smallEssentia smallImg" /> per transaction.</div>',
                            '<ul>',
                            '    <li><label>Want:</label><select id="transporterOneForOneWant"></select></li>',
            Severity: Minor
            Found in app/js-yui/building/transporter.js - About 1 hr to fix

              Function _getOreTab has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _getOreTab : function() {
                          var stored = this.result.ore_stored;
                          var details = function(type) {
                              return [
                                      '<li title="',Lib.formatNumber(stored[type]),'"><label>',
              Severity: Minor
              Found in app/js-yui/building/oreStorage.js - About 1 hr to fix

                Function Abandon has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        Abandon : function() {
                            var cp = Game.GetCurrentPlanet();
                            if(confirm(['Are you sure you want to abandon ',cp.name,'?'].join(''))) {
                                require('js/actions/menu/loader').show();
                                Game.Services.Body.abandon({
                Severity: Minor
                Found in app/js-yui/building/planetaryCommand.js - About 1 hr to fix

                  Function _getSupplyChainTab has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  _getSupplyChainTab : function() {
                      var planets = Lib.planetarySort(Game.EmpireData.planets),
                          current_planet = Game.GetCurrentPlanet(),
                          target_options = "";
                  
                  
                  Severity: Minor
                  Found in app/js-yui/building/tradeMinistry.js - About 1 hr to fix

                    Function ShowSpies has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            ShowSpies : function(tab) {
                                Dom.setStyle(tab.elSpiesPane, 'display', 'block');
                                Dom.setStyle(tab.elSpyShipsPane, 'display', 'none');
                                if ( tab.avail && tab.avail.spies && tab.avail.spyShips ) {
                                    return;
                    Severity: Minor
                    Found in app/js-yui/mapStar.js - About 1 hr to fix

                      Function resetDisplay has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  this.planetDetails.resetDisplay = function(oSelf) {
                                      delete oSelf.currentShips;
                                      delete oSelf.selectedBody;
                                      delete oSelf.selectedTile;
                                      this.resetQueue();
                      Severity: Minor
                      Found in app/js-yui/mapStar.js - About 1 hr to fix

                        Function ShipyardDisplay has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                ShipyardDisplay : function() {
                                    var bq = this.ship_build_queue,
                                        div = Dom.get("shipsBuilding");
                        
                                    if(div) {
                        Severity: Minor
                        Found in app/js-yui/building/shipyard.js - About 1 hr to fix

                          Function CreateStarSearch has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  CreateStarSearch : function(id) {
                                      var dataSource = new Util.XHRDataSource("/map");
                                      dataSource.connMethodPost = "POST";
                                      dataSource.maxCacheEntries = 2;
                                      dataSource.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;
                          Severity: Minor
                          Found in app/js-yui/module/parliament.js - About 1 hr to fix

                            Function Dump has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    Dump : function(e) {
                                        var building = this.building;
                                        if(building) {
                                            var sel = Dom.get("type");
                                            var type = sel[sel.selectedIndex].value;
                            Severity: Minor
                            Found in app/js-yui/building/oreStorage.js - About 1 hr to fix

                              Function Dump has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      Dump : function(e) {
                                          var building = this.building;
                                          if(building) {
                                              var sel = Dom.get("type");
                                              var type = sel[sel.selectedIndex].value;
                              Severity: Minor
                              Found in app/js-yui/building/foodReserve.js - About 1 hr to fix

                                Function PendingPopulate has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        PendingPopulate : function() {
                                            var details = Dom.get("embassySendDetails");
                                            if(details) {
                                                var pendingInvites = this.pendingInvites,
                                                    ul = document.createElement("ul"),
                                Severity: Minor
                                Found in app/js-yui/building/embassy.js - About 1 hr to fix

                                  Function _createToSelect has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          _createToSelect : function() {
                                              var dataSource = new Util.XHRDataSource("/empire");
                                              dataSource.connMethodPost = "POST";
                                              dataSource.maxCacheEntries = 2;
                                              dataSource.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;
                                  Severity: Minor
                                  Found in app/js-yui/messaging.js - About 1 hr to fix

                                    Function ReserveSubmit has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            ReserveSubmit : function() {
                                                var data = {
                                                        session_id: Game.GetSession(""),
                                                        building_id: this.building.id
                                                    },
                                    Severity: Minor
                                    Found in app/js-yui/building/distributionCenter.js - About 1 hr to fix

                                      Function getResourceStatus has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          getResourceStatus : function(hour, stored, capicity, hasCapicity) {
                                              // Different players have differnet strategies regarding waste. Some would consider full
                                              // waste good. Some would consider empty waste good. Therefore, we shouldn't comment
                                              // on what a player does or does not do with their waste.
                                              if (this.props.type === 'waste') {
                                      Severity: Minor
                                      Found in app/js/components/menu/bottomBar/resourceToolTip.jsx - About 1 hr to fix

                                        Function move has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                move : function(mx,my) {
                                                    var mb = this._map.maxBounds; // = {x1Left:-15,x2Right:15,y1Top:15,y2Bottom:-15};
                                                    var maxWidth = this._map.width;
                                                    var maxHeight = this._map.height;
                                                    if(mb) {
                                        Severity: Minor
                                        Found in app/js-yui/mapper.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language