plainblack/Lacuna-Web-Client

View on GitHub
app/js-yui/building/transporter.js

Summary

Maintainability
F
3 mos
Test Coverage

File transporter.js has 1700 lines of code (exceeds 250 allowed). Consider refactoring.
Open

YAHOO.namespace("lacuna.buildings");

if (typeof YAHOO.lacuna.buildings.Transporter == "undefined" || !YAHOO.lacuna.buildings.Transporter) {
    
(function(){
Severity: Major
Found in app/js-yui/building/transporter.js - About 4 days to fix

    Function Transporter has 130 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var Transporter = function(result){
            Transporter.superclass.constructor.call(this, result);
    
            this.transport = result.transport;
            this.service = Game.Services.Buildings.Transporter;
    Severity: Major
    Found in app/js-yui/building/transporter.js - About 5 hrs to fix

      Function AddTrade has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              AddTrade : function() {
                  var qVal = Dom.get("tradeAddAskingQuantity").value*1;
                  if(!Lang.isNumber(qVal) || qVal <= 0) {
                      Dom.get("tradeAddMessage").innerHTML = "Quantity of asking essentia must be a number and greater than 0";
                      return;
      Severity: Major
      Found in app/js-yui/building/transporter.js - About 2 hrs to fix

        Function Push has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                Push : function() {
                    var data = {
                            session_id: Game.GetSession(""),
                            building_id: this.building.id,
                            target_id: Lib.getSelectedOptionValue(Dom.get("tradePushColony"))
        Severity: Major
        Found in app/js-yui/building/transporter.js - About 2 hrs to fix

          Function AddShip has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  AddShip : function(e, matchedEl, container){
                      var quantity = matchedEl.previousSibling.value*1,
                          li = matchedEl.parentNode,
                          c = Dom.get("tradeAddItems");
                      if(li && c) {
          Severity: Major
          Found in app/js-yui/building/transporter.js - About 2 hrs to fix

            Function PushAddShip has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    PushAddShip : function(e, matchedEl, container){
                        var quantity = matchedEl.previousSibling.value*1,
                            li = matchedEl.parentNode,
                            c = Dom.get("tradePushItems");
                        if(li && c) {
            Severity: Major
            Found in app/js-yui/building/transporter.js - About 2 hrs to fix

              Function AvailablePopulate has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      AvailablePopulate : function() {
                          var details = Dom.get("tradeAvailableDetails");
                          
                          if(details) {
                              var trades = this.availableTrades.trades,
              Severity: Major
              Found in app/js-yui/building/transporter.js - About 2 hrs to fix

                Function PushAddPlan has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        PushAddPlan : function(e, matchedEl, container){
                            var quantity = matchedEl.previousSibling.value*1,
                                li = matchedEl.parentNode,
                                c = Dom.get("tradePushItems");
                            if(quantity && li && c) {
                Severity: Major
                Found in app/js-yui/building/transporter.js - About 2 hrs to fix

                  Function AddPlan has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          AddPlan : function(e, matchedEl, container){
                              var quantity = matchedEl.previousSibling.value*1,
                                  li = matchedEl.parentNode,
                                  c = Dom.get("tradeAddItems");
                              if(li && c) {
                  Severity: Major
                  Found in app/js-yui/building/transporter.js - About 2 hrs to fix

                    Function AddResource has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Function PushAddResource has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Function _getPushTab has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                _getPushTab : function() {
                                    this.push = new YAHOO.widget.Tab({ label: "Push", content: [
                                    '<div id="pHt"><div class="tradeStash yui-g">',
                                    '    <div class="yui-u first">',
                                    '        <legend>On Planet</legend>',
                        Severity: Minor
                        Found in app/js-yui/building/transporter.js - About 1 hr to fix

                          Function PushAddGlyph has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Function AddGlyph has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Function MinePopulate has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      MinePopulate : function() {
                                          var details = Dom.get("tradeMineDetails");
                                          
                                          if(details) {
                                              var trades = this.mineTrades.trades,
                              Severity: Minor
                              Found in app/js-yui/building/transporter.js - 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 _getAddTab has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          _getAddTab : function() {
                                              this.add = new YAHOO.widget.Tab({ label: "Add Trade", content: [
                                              '<div id="aHt"><div class="tradeStash yui-g">',
                                              '    <div class="yui-u first">',
                                              '        <legend>On Planet</legend>',
                                  Severity: Minor
                                  Found in app/js-yui/building/transporter.js - About 1 hr to fix

                                    Function populatePushResourceName has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            populatePushResourceName : function() {
                                                var elm = Dom.get("tradePushResourceName"),
                                                    li = document.createElement("li"), nLi, x, r, name, resource;
                                                    
                                                if(elm) {
                                    Severity: Minor
                                    Found in app/js-yui/building/transporter.js - About 1 hr to fix

                                      Function populateAddResourceName has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              populateAddResourceName : function() {
                                                  var elm = Dom.get("tradeAddResourceName"),
                                                      li = document.createElement("li"), nLi, x, r, name, resource;
                                                      
                                                  if(elm) {
                                      Severity: Minor
                                      Found in app/js-yui/building/transporter.js - About 1 hr to fix

                                        Function populateOneForOneHave has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                populateOneForOneHave : function() {
                                                    var elm = Dom.get("transporterOneForOneHave"),
                                                        opt = document.createElement("option"),
                                                        nOpt, optGroup;
                                                        
                                        Severity: Minor
                                        Found in app/js-yui/building/transporter.js - About 1 hr to fix

                                          Function Trade has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                                  Trade : function() {
                                                      var data = {
                                                          session_id: Game.GetSession(""),
                                                          building_id: this.building.id,
                                                          have: Lib.getSelectedOptionValue(Dom.get("transporterOneForOneHave")),
                                          Severity: Minor
                                          Found in app/js-yui/building/transporter.js - About 1 hr to fix

                                            Function MineWithdraw has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                    MineWithdraw : function() {
                                                        if(confirm(['Are you sure you want to withdraw the trade asking for ', this.Trade.ask, ' essentia and offering ', this.Trade.offer.join(', '),'?'].join(''))) {
                                                            require('js/actions/menu/loader').show();
                                                            this.Self.service.withdraw_from_market({
                                                                session_id:Game.GetSession(""),
                                            Severity: Minor
                                            Found in app/js-yui/building/transporter.js - About 1 hr to fix

                                              Function getAvailable has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                      getAvailable : function(e) {
                                                          if(e.newValue) {
                                                              require('js/actions/menu/loader').show();
                                                              var data = {session_id:Game.GetSession(),building_id:this.building.id,page_number:1},
                                                                  selVal = Lib.getSelectedOptionValue("tradeFilter");
                                              Severity: Minor
                                              Found in app/js-yui/building/transporter.js - About 1 hr to fix

                                                Function populatePushShipName has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                        populatePushShipName : function() {
                                                            var elm = Dom.get("tradePushShipName"),
                                                                li = document.createElement("li"), nLi;
                                                                
                                                            if(elm) {
                                                Severity: Minor
                                                Found in app/js-yui/building/transporter.js - About 1 hr to fix

                                                  Function populateAddShipName has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                          populateAddShipName : function() {
                                                              var elm = Dom.get("tradeAddShipName"),
                                                                  li = document.createElement("li"), nLi;
                                                                  
                                                              if(elm) {
                                                  Severity: Minor
                                                  Found in app/js-yui/building/transporter.js - About 1 hr to fix

                                                    Function success has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                                        success : function(o){
                                                                            this.rpcSuccess(o);
                                                                            
                                                                            for(var i=0; i<lis.length; i++) {
                                                                                if(lis[i].Object) {
                                                    Severity: Minor
                                                    Found in app/js-yui/building/transporter.js - About 1 hr to fix

                                                      Function success has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                                      success : function(o){
                                                                          this.rpcSuccess(o);
                                                                          if(hasResources) {
                                                                              this.getStoredResources(true);
                                                                          }
                                                      Severity: Minor
                                                      Found in app/js-yui/building/transporter.js - About 1 hr to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                        if(Dom.getStyle("tradeAddGlyphName", "display") == "none") {
                                                                                            Dom.setStyle("tradeAddGlyphName", "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(Lang.isArray(resource)) {
                                                                                      optGroup = document.createElement("optgroup");
                                                                                      optGroup.label = r.titleCaps();
                                                                                      
                                                                                      for(var x=0; x < resource.length; x++) {
                                                          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("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("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

                                                                                        else if(resource) {
                                                                                            nOpt = opt.cloneNode(false);
                                                                                            nOpt.value = r;
                                                                                            nOpt.innerHTML = r.titleCaps();
                                                                                            elm.appendChild(nOpt);
                                                                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(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(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("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(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(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/transporter.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/transporter.js - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                              for(var x=0; x < resource.length; x++) {
                                                                                                                  nOpt = opt.cloneNode(false);
                                                                                                                  nOpt.value = resource[x];
                                                                                                                  nOpt.innerHTML = resource[x].titleCaps();
                                                                                                                  optGroup.appendChild(nOpt);
                                                                                  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("tradePushPlanName", "display") == "none") {
                                                                                                                        Dom.setStyle("tradePushPlanName", "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("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(Dom.getStyle("tradePushPrisonerName", "display") == "none") {
                                                                                                                            Dom.setStyle("tradePushPrisonerName", "display", "block");
                                                                                                                            this.getPrisoners();
                                                                                                                        }
                                                                                                                        else {
                                                                                        Severity: Major
                                                                                        Found in app/js-yui/building/transporter.js - About 45 mins to fix

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  PushAddPlan : function(e, matchedEl, container){
                                                                                                      var quantity = matchedEl.previousSibling.value*1,
                                                                                                          li = matchedEl.parentNode,
                                                                                                          c = Dom.get("tradePushItems");
                                                                                                      if(quantity && li && c) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 4 days to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1606..1661

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 711.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  PushAddShip : function(e, matchedEl, container){
                                                                                                      var quantity = matchedEl.previousSibling.value*1,
                                                                                                          li = matchedEl.parentNode,
                                                                                                          c = Dom.get("tradePushItems");
                                                                                                      if(li && c) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 2 other locations - About 4 days to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1137..1192
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1663..1726

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 699.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  AddResource : function(e, matchedEl, container){
                                                                                                      var quantity = matchedEl.previousSibling.value*1,
                                                                                                          li = matchedEl.parentNode,
                                                                                                          c = Dom.get("tradeAddItems");
                                                                                                      if(quantity && c) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 2 other locations - About 3 days to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 985..1035
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1509..1559

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 657.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  PushAddResource : function(e, matchedEl, container){
                                                                                                      var quantity = matchedEl.previousSibling.value*1,
                                                                                                          li = matchedEl.parentNode,
                                                                                                          c = Dom.get("tradePushItems");
                                                                                                      if(quantity && c) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 3 days to fix
                                                                                          app/js-yui/building/distributionCenter.js on lines 148..198

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 652.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  MinePopulate : function() {
                                                                                                      var details = Dom.get("tradeMineDetails");
                                                                                                      
                                                                                                      if(details) {
                                                                                                          var trades = this.mineTrades.trades,
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 2 other locations - About 3 days to fix
                                                                                          app/js-yui/building/mercenariesGuild.js on lines 322..380
                                                                                          app/js-yui/building/tradeMinistry.js on lines 693..751

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 621.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  AddGlyph : function(e, matchedEl, container){
                                                                                                      var quantity = matchedEl.previousSibling.value*1,
                                                                                                          li = matchedEl.parentNode,
                                                                                                          c = Dom.get("tradeAddItems");
                                                                                                      if(li && c) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 2 other locations - About 3 days to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1036..1081
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1560..1605

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 597.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                                  populateAddResourceName : function() {
                                                                                                      var elm = Dom.get("tradeAddResourceName"),
                                                                                                          li = document.createElement("li"), nLi, x, r, name, resource;
                                                                                                          
                                                                                                      if(elm) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 3 other locations - About 2 days to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 808..845
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1327..1364
                                                                                          app/js-yui/building/transporter.js on lines 1325..1362

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 508.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                                  populatePushResourceName : function() {
                                                                                                      var elm = Dom.get("tradePushResourceName"),
                                                                                                          li = document.createElement("li"), nLi, x, r, name, resource;
                                                                                                          
                                                                                                      if(elm) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 3 other locations - About 2 days to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 808..845
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1327..1364
                                                                                          app/js-yui/building/transporter.js on lines 831..868

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 508.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                          this.add.subscribe("activeChange", function(e) {
                                                                                                              if(e.newValue) {
                                                                                                                  if(!this.tradeAddSubbed) {
                                                                                                                      Event.on("tradeAddResources", "click", function(){
                                                                                                                          if(Dom.getStyle("tradeAddResourceName", "display") == "none") {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 2 days to fix
                                                                                          app/js-yui/building/transporter.js on lines 49..101

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 459.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                          this.push.subscribe("activeChange", function(e) {
                                                                                                              if(e.newValue) {
                                                                                                                  if(!this.tradePushSubbed) {
                                                                                                                      Event.on("tradePushResources", "click", function(){
                                                                                                                          if(Dom.getStyle("tradePushResourceName", "display") == "none") {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 2 days to fix
                                                                                          app/js-yui/building/transporter.js on lines 102..154

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 459.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  MineWithdraw : function() {
                                                                                                      if(confirm(['Are you sure you want to withdraw the trade asking for ', this.Trade.ask, ' essentia and offering ', this.Trade.offer.join(', '),'?'].join(''))) {
                                                                                                          require('js/actions/menu/loader').show();
                                                                                                          this.Self.service.withdraw_from_market({
                                                                                                              session_id:Game.GetSession(""),
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 2 days to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 775..805

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 380.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  AddPrisoner : function(e, matchedEl, container){
                                                                                                      var li = matchedEl.parentNode,
                                                                                                          c = Dom.get("tradeAddItems");
                                                                                                      if(li && c) {
                                                                                                          var obj = li.Prisoner,
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 1 day to fix
                                                                                          app/js-yui/building/transporter.js on lines 1687..1712

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 343.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  PushAddPrisoner : function(e, matchedEl, container){
                                                                                                      var li = matchedEl.parentNode,
                                                                                                          c = Dom.get("tradePushItems");
                                                                                                      if(li && c) {
                                                                                                          var obj = li.Prisoner,
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 1 day to fix
                                                                                          app/js-yui/building/transporter.js on lines 1195..1220

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 343.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  AddRemove : function(e, matchedEl, container){
                                                                                                      var quantity = matchedEl.previousSibling.value*1,
                                                                                                          li = matchedEl.parentNode.parentNode;
                                                                                                      if(quantity) {
                                                                                                          var newTotal = li.Object.quantity - quantity,
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 2 other locations - About 1 day to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1220..1245
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1753..1778

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 307.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                                  populatePushPlanName : function() {
                                                                                                      var elm = Dom.get("tradePushPlanName"),
                                                                                                          li = document.createElement("li"), nLi;
                                                                                                          
                                                                                                      if(elm) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 3 other locations - About 1 day to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 868..894
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1388..1414
                                                                                          app/js-yui/building/transporter.js on lines 891..917

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 305.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                                  populateAddPlanName : function() {
                                                                                                      var elm = Dom.get("tradeAddPlanName"),
                                                                                                          li = document.createElement("li"), nLi;
                                                                                                          
                                                                                                      if(elm) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 3 other locations - About 1 day to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 868..894
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1388..1414
                                                                                          app/js-yui/building/transporter.js on lines 1386..1412

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 305.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  getAvailable : function(e) {
                                                                                                      if(e.newValue) {
                                                                                                          require('js/actions/menu/loader').show();
                                                                                                          var data = {session_id:Game.GetSession(),building_id:this.building.id,page_number:1},
                                                                                                              selVal = Lib.getSelectedOptionValue("tradeFilter");
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 1 day to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 490..523

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 304.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  PushRemove : function(e, matchedEl, container){
                                                                                                      var quantity = matchedEl.previousSibling.value*1,
                                                                                                          li = matchedEl.parentNode.parentNode;
                                                                                                      if(quantity) {
                                                                                                          var newTotal = li.Object.quantity - quantity,
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 1 day to fix
                                                                                          app/js-yui/building/distributionCenter.js on lines 199..224

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 283.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                      this.service.add_to_market(data, {
                                                                                                          success : function(o){
                                                                                                              this.rpcSuccess(o);
                                                                                                              if(hasResources) {
                                                                                                                  this.getStoredResources(true);
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 1 day to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1293..1323

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 282.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  getMine : function(e) {
                                                                                                      if(e.newValue) {
                                                                                                          require('js/actions/menu/loader').show();
                                                                                                          this.service.view_my_market({session_id:Game.GetSession(),building_id:this.building.id,page_number:1}, {
                                                                                                              success : function(o){
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 1 day to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 664..692

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 271.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                                  populatePushShipName : function() {
                                                                                                      var elm = Dom.get("tradePushShipName"),
                                                                                                          li = document.createElement("li"), nLi;
                                                                                                          
                                                                                                      if(elm) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 3 other locations - About 1 day to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 895..921
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1415..1442
                                                                                          app/js-yui/building/transporter.js on lines 918..947

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 268.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                                  populateAddShipName : function() {
                                                                                                      var elm = Dom.get("tradeAddShipName"),
                                                                                                          li = document.createElement("li"), nLi;
                                                                                                          
                                                                                                      if(elm) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 3 other locations - About 1 day to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 895..921
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1415..1442
                                                                                          app/js-yui/building/transporter.js on lines 1413..1442

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 268.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                                  populatePushGlyphName : function() {
                                                                                                      var elm = Dom.get("tradePushGlyphName"),
                                                                                                          li = document.createElement("li"), nLi;
                                                                                                          
                                                                                                      if(elm) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 3 other locations - About 1 day to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 846..867
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1365..1386
                                                                                          app/js-yui/building/transporter.js on lines 869..890

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 242.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                                  populateAddGlyphName : function() {
                                                                                                      var elm = Dom.get("tradeAddGlyphName"),
                                                                                                          li = document.createElement("li"), nLi;
                                                                                                          
                                                                                                      if(elm) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 3 other locations - About 1 day to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 846..867
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1365..1386
                                                                                          app/js-yui/building/transporter.js on lines 1363..1384

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 242.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                                  populateAddPrisonerName : function() {
                                                                                                      var elm = Dom.get("tradeAddPrisonerName"),
                                                                                                          li = document.createElement("li"), nLi;
                                                                                                          
                                                                                                      if(elm) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 3 other locations - About 1 day to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 922..943
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1443..1464
                                                                                          app/js-yui/building/transporter.js on lines 1443..1464

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 235.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                                  populatePushPrisonerName : function() {
                                                                                                      var elm = Dom.get("tradePushPrisonerName"),
                                                                                                          li = document.createElement("li"), nLi;
                                                                                                          
                                                                                                      if(elm) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 3 other locations - About 1 day to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 922..943
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1443..1464
                                                                                          app/js-yui/building/transporter.js on lines 948..969

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 235.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  AvailableHandlePagination : function(newState) {
                                                                                                      require('js/actions/menu/loader').show();
                                                                                                      var data = {session_id:Game.GetSession(),building_id:this.building.id,page_number:newState.page},
                                                                                                          selVal = Lib.getSelectedOptionValue("tradeFilter");
                                                                                                      if(selVal) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 1 day to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 598..621

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 234.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  MineHandlePagination : function(newState) {
                                                                                                      require('js/actions/menu/loader').show();
                                                                                                      this.service.view_my_market({
                                                                                                          session_id:Game.GetSession(),
                                                                                                          building_id:this.building.id,
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 2 other locations - About 1 day to fix
                                                                                          app/js-yui/building/mercenariesGuild.js on lines 381..403
                                                                                          app/js-yui/building/tradeMinistry.js on lines 752..774

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 196.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  AvailableReport : function() {
                                                                                                      require('js/actions/menu/loader').show();
                                                                                                      this.Self.service.report_abuse({
                                                                                                          session_id:Game.GetSession(""),
                                                                                                          building_id:this.Self.building.id,
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 7 hrs to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 639..657

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 188.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 8 locations. Consider refactoring.
                                                                                          Open

                                                                                                  getGlyphs : function(force) {
                                                                                                      if(force || !this.glyphs) {
                                                                                                          require('js/actions/menu/loader').show();
                                                                                                          this.service.get_glyph_summary({
                                                                                                                  session_id: Game.GetSession(""),
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 7 other locations - About 7 hrs to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 398..415
                                                                                          app/js-yui/building/tradeMinistry.js on lines 417..434
                                                                                          app/js-yui/building/tradeMinistry.js on lines 435..452
                                                                                          app/js-yui/building/tradeMinistry.js on lines 453..470
                                                                                          app/js-yui/building/transporter.js on lines 441..458
                                                                                          app/js-yui/building/transporter.js on lines 459..476
                                                                                          app/js-yui/building/transporter.js on lines 477..494

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 176.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 8 locations. Consider refactoring.
                                                                                          Open

                                                                                                  getPrisoners : function(force) {
                                                                                                      if(force || !this.prisoners) {
                                                                                                          require('js/actions/menu/loader').show();
                                                                                                          this.service.get_prisoners({
                                                                                                                  session_id: Game.GetSession(""),
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 7 other locations - About 7 hrs to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 398..415
                                                                                          app/js-yui/building/tradeMinistry.js on lines 417..434
                                                                                          app/js-yui/building/tradeMinistry.js on lines 435..452
                                                                                          app/js-yui/building/tradeMinistry.js on lines 453..470
                                                                                          app/js-yui/building/transporter.js on lines 423..440
                                                                                          app/js-yui/building/transporter.js on lines 441..458
                                                                                          app/js-yui/building/transporter.js on lines 477..494

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 176.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 8 locations. Consider refactoring.
                                                                                          Open

                                                                                                  getPlans : function(force) {
                                                                                                      if(force || !this.plans) {
                                                                                                          require('js/actions/menu/loader').show();
                                                                                                          this.service.get_plan_summary({
                                                                                                                  session_id: Game.GetSession(""),
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 7 other locations - About 7 hrs to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 398..415
                                                                                          app/js-yui/building/tradeMinistry.js on lines 417..434
                                                                                          app/js-yui/building/tradeMinistry.js on lines 435..452
                                                                                          app/js-yui/building/tradeMinistry.js on lines 453..470
                                                                                          app/js-yui/building/transporter.js on lines 423..440
                                                                                          app/js-yui/building/transporter.js on lines 459..476
                                                                                          app/js-yui/building/transporter.js on lines 477..494

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 176.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 8 locations. Consider refactoring.
                                                                                          Open

                                                                                                  getShips : function(force) {
                                                                                                      if(force || !this.ships) {
                                                                                                          require('js/actions/menu/loader').show();
                                                                                                          this.service.get_ship_summary({
                                                                                                                  session_id: Game.GetSession(""),
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 7 other locations - About 7 hrs to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 398..415
                                                                                          app/js-yui/building/tradeMinistry.js on lines 417..434
                                                                                          app/js-yui/building/tradeMinistry.js on lines 435..452
                                                                                          app/js-yui/building/tradeMinistry.js on lines 453..470
                                                                                          app/js-yui/building/transporter.js on lines 423..440
                                                                                          app/js-yui/building/transporter.js on lines 441..458
                                                                                          app/js-yui/building/transporter.js on lines 459..476

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 176.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                      Event.onAvailable("tradePushColony", function(){
                                                                                                          var opt = document.createElement("option"),
                                                                                                              planets = This.transport.pushable;
                                                                                          
                                                                                                          for(var p=0; p<planets.length; p++) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 7 hrs to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 206..217

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 175.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  AvailableAccept : function() {
                                                                                                      require('js/actions/menu/loader').show();
                                                                                                      this.Self.service.accept_from_market({
                                                                                                          session_id:Game.GetSession(""),
                                                                                                          building_id:this.Self.building.id,
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 6 hrs to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 622..638

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 172.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                      for(n=0; n<lis.length; n++) {
                                                                                                          obj = lis[n].Object;
                                                                                                          if(obj) {
                                                                                                              data.offer[data.offer.length] = obj;
                                                                                                              switch(obj.type) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 5 hrs to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1268..1290

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 136.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                      if(force || !this.resources) {
                                                                                                          require('js/actions/menu/loader').show();
                                                                                                          this.service.get_stored_resources({
                                                                                                                  session_id: Game.GetSession(""),
                                                                                                                  building_id: this.building.id
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 4 hrs to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 472..486

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 133.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                      for(var n=0; n<lis.length; n++) {
                                                                                                          if(lis[n].Object) {
                                                                                                              items[n] = lis[n].Object;
                                                                                                              switch(items[n].type) {
                                                                                                                  case "plan":
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 4 hrs to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1793..1814

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 131.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  _getAvailTab : function() {
                                                                                                      this.avail = new YAHOO.widget.Tab({ label: "Available Trades", content: [
                                                                                                          '<div>',
                                                                                                          '    <div style="border-bottom: 1px solid #52ACFF; padding-bottom: 5px; margin-bottom: 5px;"><label>Filter:</label><select id="tradeFilter"><option value="">All</option><option value="energy">Energy</option><option value="food">Food</option><option value="ore">Ore</option>',
                                                                                                          '    <option value="water">Water</option><option value="waste">Waste</option><option value="glyph">Glyph</option><option value="prisoner">Prisoner</option>',
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 3 hrs to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 232..253

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 113.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                              Event.on(del, "click", function(){ 
                                                                                                                  var ed = Event.getTarget(e),
                                                                                                                      ep = ed.parentNode;
                                                                                                                  this.updateAddCargo(ep.Object.quantity * -this.shipSize);
                                                                                                                  Event.purgeElement(item);
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 2 other locations - About 3 hrs to fix
                                                                                          app/js-yui/building/transporter.js on lines 1090..1096
                                                                                          app/js-yui/building/transporter.js on lines 1536..1542

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 99.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                              Event.on(del, "click", function(){ 
                                                                                                                  var ed = Event.getTarget(e),
                                                                                                                      ep = ed.parentNode;
                                                                                                                  this.updateAddCargo(ep.Object.quantity * -this.planSize);
                                                                                                                  Event.purgeElement(item);
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 2 other locations - About 3 hrs to fix
                                                                                          app/js-yui/building/transporter.js on lines 1146..1152
                                                                                          app/js-yui/building/transporter.js on lines 1536..1542

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 99.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                              Event.on(del, "click", function(){ 
                                                                                                                  var ed = Event.getTarget(e),
                                                                                                                      ep = ed.parentNode;
                                                                                                                  this.updatePushCargo(ep.Object.quantity * -this.glyphSize);
                                                                                                                  Event.purgeElement(item);
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 2 other locations - About 3 hrs to fix
                                                                                          app/js-yui/building/transporter.js on lines 1090..1096
                                                                                          app/js-yui/building/transporter.js on lines 1146..1152

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 99.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 5 locations. Consider refactoring.
                                                                                          Open

                                                                                              var Lang = YAHOO.lang,
                                                                                                  Util = YAHOO.util,
                                                                                                  Dom = Util.Dom,
                                                                                                  Event = Util.Event,
                                                                                                  Sel = Util.Selector,
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 4 other locations - About 2 hrs to fix
                                                                                          app/js-yui/building/blackHoleGenerator.js on lines 7..15
                                                                                          app/js-yui/building/mercenariesGuild.js on lines 6..14
                                                                                          app/js-yui/building/spacePort.js on lines 9..17
                                                                                          app/js-yui/building/tradeMinistry.js on lines 6..14

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 87.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                                  else if(this.resources[r] && resource) {
                                                                                                                      nOpt = opt.cloneNode(false);
                                                                                                                      nOpt.value = r;
                                                                                                                      nOpt.innerHTML = [r.titleCaps(), ' (', this.resources[r], ')'].join('');
                                                                                                                      elm.appendChild(nOpt);
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 2 hrs to fix
                                                                                          app/js-yui/building/transporter.js on lines 370..375

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 80.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                                          if(this.resources[name]) {
                                                                                                                              nOpt = opt.cloneNode(false);
                                                                                                                              nOpt.value = name;
                                                                                                                              nOpt.innerHTML = [name.titleCaps(), ' (', this.resources[name], ')'].join('');
                                                                                                                              optGroup.appendChild(nOpt);
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 2 hrs to fix
                                                                                          app/js-yui/building/transporter.js on lines 380..385

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 80.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                                  destroy : function() {
                                                                                                      if(this.availablePager) {
                                                                                                          this.availablePager.destroy();
                                                                                                      }
                                                                                                      if(this.minePage) {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 3 other locations - About 2 hrs to fix
                                                                                          app/js-yui/building/mercenariesGuild.js on lines 31..39
                                                                                          app/js-yui/building/security.js on lines 25..33
                                                                                          app/js-yui/building/tradeMinistry.js on lines 160..168

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 79.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                                  updatePushCargo : function(byVal) {
                                                                                                      var c = Dom.get("tradePushCargo"),
                                                                                                          cv = c.innerHTML.replace(/,/g,"")*1;
                                                                                                      c.innerHTML = Lib.formatNumber(cv + byVal);
                                                                                                  },
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 3 other locations - About 1 hr to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 980..984
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1504..1508
                                                                                          app/js-yui/building/transporter.js on lines 970..974

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 71.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                                  updateAddCargo : function(byVal) {
                                                                                                      var c = Dom.get("tradeAddCargo"),
                                                                                                          cv = c.innerHTML.replace(/,/g,"")*1;
                                                                                                      c.innerHTML = Lib.formatNumber(cv + byVal);
                                                                                                  },
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 3 other locations - About 1 hr to fix
                                                                                          app/js-yui/building/tradeMinistry.js on lines 980..984
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1504..1508
                                                                                          app/js-yui/building/transporter.js on lines 1465..1469

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 71.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                      this.add = new YAHOO.widget.Tab({ label: "Add Trade", content: [
                                                                                                      '<div id="aHt"><div class="tradeStash yui-g">',
                                                                                                      '    <div class="yui-u first">',
                                                                                                      '        <legend>On Planet</legend>',
                                                                                                      '        <div class="tradeContainers">',
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 1 hr to fix
                                                                                          app/js-yui/building/transporter.js on lines 221..242

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 70.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  _getMineTab : function() {
                                                                                                      this.mine = new YAHOO.widget.Tab({ label: "My Trades", content: ['<div class="myTrades">',
                                                                                                          '    <ul class="tradeHeader tradeInfo clearafter">',
                                                                                                          '        <li class="tradeOfferedDate">Offered Date</li>',
                                                                                                          '        <li class="tradeAsking">Cost</li>',
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 2 other locations - About 1 hr to fix
                                                                                          app/js-yui/building/mercenariesGuild.js on lines 70..83
                                                                                          app/js-yui/building/tradeMinistry.js on lines 254..267

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 70.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                      this.push = new YAHOO.widget.Tab({ label: "Push", content: [
                                                                                                      '<div id="pHt"><div class="tradeStash yui-g">',
                                                                                                      '    <div class="yui-u first">',
                                                                                                      '        <legend>On Planet</legend>',
                                                                                                      '        <div class="tradeContainers">',
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 1 other location - About 1 hr to fix
                                                                                          app/js-yui/building/transporter.js on lines 313..334

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 70.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                      if(!Lang.isNumber(qVal) || qVal <= 0) {
                                                                                                          Dom.get("tradeAddMessage").innerHTML = "Quantity of asking essentia must be a number and greater than 0";
                                                                                                          return;
                                                                                                      }
                                                                                                      else {
                                                                                          Severity: Major
                                                                                          Found in app/js-yui/building/transporter.js and 2 other locations - About 1 hr to fix
                                                                                          app/js-yui/building/mercenariesGuild.js on lines 502..508
                                                                                          app/js-yui/building/tradeMinistry.js on lines 1248..1254

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 68.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          There are no issues that match your filters.

                                                                                          Category
                                                                                          Status