plainblack/Lacuna-Web-Client

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

Summary

Maintainability
F
1 mo
Test Coverage

File spacePort.js has 1301 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Stuff to do for FleetSend:
// Make sure clicking send only sends the correct ship
// On click of "Get Available Groups of Ships for Target" disable sends that would not arrive before arrival time.
YAHOO.namespace("lacuna.buildings");

Severity: Major
Found in app/js-yui/building/spacePort.js - About 3 days to fix

    Function ViewPopulate has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            ViewPopulate : function() {
                var details = Dom.get("shipsViewDetails");
    
                if(details) {
                    var ships = this.shipsView.ships,
    Severity: Major
    Found in app/js-yui/building/spacePort.js - About 3 hrs to fix

      Function LogsPopulate has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              LogsPopulate : function() {
                  var details = Dom.get("battleLogsDetails");
      
                  if(details) {
                      var logs = this.battleLogs.battle_log,
      Severity: Major
      Found in app/js-yui/building/spacePort.js - About 2 hrs to fix

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

                FleetSend : function(e) {
                    var btn = Event.getTarget(e);
                    btn.disabled = true;
                    var oSelf = this.Self,
                        ship = this.Ship,
        Severity: Major
        Found in app/js-yui/building/spacePort.js - About 2 hrs to fix

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

                  OrbitingPopulate : function() {
                      var details = Dom.get("shipsOrbitingDetails");
          
                      if(details) {
                          var ships = this.shipsOrbiting.ships,
          Severity: Major
          Found in app/js-yui/building/spacePort.js - About 2 hrs to fix

            Function ForeignPopulate has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    ForeignPopulate : function() {
                        var details = Dom.get("shipsForeignDetails");
            
                        if(details) {
                            var ships = this.shipsForeign.ships,
            Severity: Major
            Found in app/js-yui/building/spacePort.js - About 2 hrs to fix

              Function SpacePortPopulate has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      SpacePortPopulate : function() {
                          var ships = this.shipsTravelling.ships_travelling,
                              details = Dom.get("shipDetails");
              
                          if(details) {
              Severity: Major
              Found in app/js-yui/building/spacePort.js - About 2 hrs to fix

                Function PopulateFleetSendTab has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        PopulateFleetSendTab : function(target, ships) {
                            var details = Dom.get("sendFleetAvail"),
                                detailsParent = details.parentNode,
                                li = document.createElement("li");
                
                
                Severity: Major
                Found in app/js-yui/building/spacePort.js - About 2 hrs to fix

                  Function _getSendFleetTab has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          _getSendFleetTab : function() {
                              var currYear  = Lacuna.Game.ServerData.time.getUTCFullYear();
                              var currMon   = Lacuna.Game.ServerData.time.getUTCMonth() + 1;
                              var currDay   = Lacuna.Game.ServerData.time.getUTCDate();
                              var currHour  = Lacuna.Game.ServerData.time.getUTCHours();
                  Severity: Major
                  Found in app/js-yui/building/spacePort.js - About 2 hrs to fix

                    Function PopulateShipsSendTab has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            PopulateShipsSendTab : function(target, ships) {
                                var details = Dom.get("sendShipAvail"),
                                    detailsParent = details.parentNode,
                                    li = document.createElement("li");
                    
                    
                    Severity: Minor
                    Found in app/js-yui/building/spacePort.js - About 2 hrs to fix

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

                              ViewActionDetails : function(nLi, ship, noEvent) {
                                  var ulDet = ['<li style="white-space:nowrap;"><label style="font-weight:bold;">',ship.task,'</label></li>'];
                      
                                  if(ship.task === "Docked") {
                                      ulDet[ulDet.length] = '<li style="white-space:nowrap;margin-top:5px"><button type="button" class="scuttle">Scuttle</button></li>';
                      Severity: Minor
                      Found in app/js-yui/building/spacePort.js - About 1 hr to fix

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

                                ShipScuttle : function(e, matchedEl, container) {
                                    if(confirm(["Are you sure you want to Scuttle ",this.Ship.name,"?"].join(''))) {
                                        var btn = Event.getTarget(e);
                                        btn.disabled = true;
                                        require('js/actions/menu/loader').show();
                        Severity: Minor
                        Found in app/js-yui/building/spacePort.js - About 1 hr to fix

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

                                  ShipRecall : function(e, matchedEl, container) {
                                      matchedEl.disabled = true;
                                      require('js/actions/menu/loader').show();
                          
                                      this.Self.service.recall_ship({
                          Severity: Minor
                          Found in app/js-yui/building/spacePort.js - About 1 hr to fix

                            Function getShips has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    getShips : function(e) {
                                        if(e.newValue) {
                                            if(!this.shipsView) {
                                                require('js/actions/menu/loader').show();
                                                this.service.view_all_ships({session_id:Game.GetSession(),building_id:this.building.id,paging:{page_number:1}}, {
                            Severity: Minor
                            Found in app/js-yui/building/spacePort.js - About 1 hr to fix

                              Function getLogs has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      getLogs : function(e) {
                                          if(e.newValue) {
                                              if(!this.battleLogs) {
                                                  require('js/actions/menu/loader').show();
                                                  this.service.view_battle_logs({session_id:Game.GetSession(),building_id:this.building.id}, {
                              Severity: Minor
                              Found in app/js-yui/building/spacePort.js - About 1 hr to fix

                                Function getTravel has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        getTravel : function(e) {
                                            if(e.newValue) {
                                                if(!this.shipsTravelling) {
                                                    require('js/actions/menu/loader').show();
                                                    this.service.view_ships_travelling({session_id:Game.GetSession(),building_id:this.building.id,page_number:1}, {
                                Severity: Minor
                                Found in app/js-yui/building/spacePort.js - About 1 hr to fix

                                  Function ShipSend has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          ShipSend : function(e) {
                                              var btn = Event.getTarget(e);
                                              btn.disabled = true;
                                  
                                              var oSelf = this.Self,
                                  Severity: Minor
                                  Found in app/js-yui/building/spacePort.js - About 1 hr to fix

                                    Function getForeign has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            getForeign : function(e) {
                                                if(e.newValue) {
                                                    if(!this.shipsForeign) {
                                                        require('js/actions/menu/loader').show();
                                                        this.service.view_foreign_ships({session_id:Game.GetSession(),building_id:this.building.id,page_number:1}, {
                                    Severity: Minor
                                    Found in app/js-yui/building/spacePort.js - About 1 hr to fix

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

                                              getOrbiting : function(e) {
                                                  if(e.newValue) {
                                                      if(!this.shipsOrbiting) {
                                                          require('js/actions/menu/loader').show();
                                                          this.service.view_ships_orbiting({session_id:Game.GetSession(),building_id:this.building.id}, {
                                      Severity: Minor
                                      Found in app/js-yui/building/spacePort.js - About 1 hr to fix

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

                                                ShipNameSave : function(e) {
                                                    Event.stopEvent(e);
                                                    require('js/actions/menu/loader').show();
                                                    var newName = this.Input.value;
                                        
                                        
                                        Severity: Minor
                                        Found in app/js-yui/building/spacePort.js - About 1 hr to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                  if(ship.from.empire && ship.from.empire.name) {
                                                                      nLi.innerHTML = ship.from.name + ' <span style="cursor:pointer;">[' + ship.from.empire.name + ']</span>';
                                                                      Event.on(nLi, "click", this.EmpireProfile, ship.from.empire);
                                                                  }
                                                                  else {
                                          Severity: Major
                                          Found in app/js-yui/building/spacePort.js - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                    if(ship.from.empire && ship.from.empire.name) {
                                                                        nLi.innerHTML = ship.from.name + ' <span style="cursor:pointer;">[' + ship.from.empire.name + ']</span>';
                                                                        Event.on(nLi, "click", this.EmpireProfile, ship.from.empire);
                                                                    }
                                                                    else {
                                            Severity: Major
                                            Found in app/js-yui/building/spacePort.js - About 45 mins to fix

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

                                                      ForeignPopulate : function() {
                                                          var details = Dom.get("shipsForeignDetails");
                                              
                                                          if(details) {
                                                              var ships = this.shipsForeign.ships,
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 5 days to fix
                                              app/js-yui/module/policeStation.js on lines 80..163

                                              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 869.

                                              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

                                                      getTravel : function(e) {
                                                          if(e.newValue) {
                                                              if(!this.shipsTravelling) {
                                                                  require('js/actions/menu/loader').show();
                                                                  this.service.view_ships_travelling({session_id:Game.GetSession(),building_id:this.building.id,page_number:1}, {
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 2 other locations - About 1 day to fix
                                              app/js-yui/building/spacePort.js on lines 295..328
                                              app/js-yui/module/policeStation.js on lines 46..79

                                              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 298.

                                              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

                                                      getForeign : function(e) {
                                                          if(e.newValue) {
                                                              if(!this.shipsForeign) {
                                                                  require('js/actions/menu/loader').show();
                                                                  this.service.view_foreign_ships({session_id:Game.GetSession(),building_id:this.building.id,page_number:1}, {
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 2 other locations - About 1 day to fix
                                              app/js-yui/building/spacePort.js on lines 227..260
                                              app/js-yui/module/policeStation.js on lines 46..79

                                              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 298.

                                              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

                                                      ShipName : function() {
                                                          this.el.innerHTML = "";
                                              
                                                          var inp = document.createElement("input"),
                                                              bSave = document.createElement("button"),
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 1 day to fix
                                              app/js-yui/building/intelligence.js on lines 474..496

                                              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 4 locations. Consider refactoring.
                                              Open

                                                      ShipHandlePagination : function(newState) {
                                                          require('js/actions/menu/loader').show();
                                                          this.service.view_ships_travelling({
                                                              session_id:Game.GetSession(),
                                                              building_id:this.building.id,
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 3 other locations - About 1 day to fix
                                              app/js-yui/building/spacePort.js on lines 921..943
                                              app/js-yui/building/spacePort.js on lines 944..966
                                              app/js-yui/module/policeStation.js on lines 164..186

                                              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 198.

                                              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

                                                      ForeignHandlePagination : function(newState) {
                                                          require('js/actions/menu/loader').show();
                                                          this.service.view_foreign_ships({
                                                              session_id:Game.GetSession(),
                                                              building_id:this.building.id,
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 3 other locations - About 1 day to fix
                                              app/js-yui/building/spacePort.js on lines 471..493
                                              app/js-yui/building/spacePort.js on lines 944..966
                                              app/js-yui/module/policeStation.js on lines 164..186

                                              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 198.

                                              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

                                                      LogsHandlePagination : function(newState) {
                                                          require('js/actions/menu/loader').show();
                                                          this.service.view_battle_logs({
                                                              session_id:Game.GetSession(),
                                                              building_id:this.building.id,
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 3 other locations - About 1 day to fix
                                              app/js-yui/building/spacePort.js on lines 471..493
                                              app/js-yui/building/spacePort.js on lines 921..943
                                              app/js-yui/module/policeStation.js on lines 164..186

                                              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 198.

                                              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(type === "xy") {
                                                              target.x = Dom.get("sendFleetTargetX").value;
                                                              target.y = Dom.get("sendFleetTargetY").value;
                                                              Dom.get("sendFleetNote").innerHTML = ['X: ', target.x, ' - Y: ', target.y].join('');
                                                          }
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 5 hrs to fix
                                              app/js-yui/building/spacePort.js on lines 1195..1203

                                              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 147.

                                              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(type === "xy") {
                                                              target.x = Dom.get("sendShipTargetX").value;
                                                              target.y = Dom.get("sendShipTargetY").value;
                                                              Dom.get("sendShipNote").innerHTML = ['X: ', target.x, ' - Y: ', target.y].join('');
                                                          }
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 5 hrs to fix
                                              app/js-yui/building/spacePort.js on lines 1322..1330

                                              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 147.

                                              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.get_ships_for({
                                                              session_id:Game.GetSession(),
                                                              from_body_id:Game.GetCurrentPlanet().id,
                                                              target:target
                                                          }, {
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 3 hrs to fix
                                              app/js-yui/building/spacePort.js on lines 1332..1343

                                              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 112.

                                              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.get_fleet_for({
                                                              session_id:Game.GetSession(),
                                                              from_body_id:Game.GetCurrentPlanet().id,
                                                              target:target
                                                          }, {
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 3 hrs to fix
                                              app/js-yui/building/spacePort.js on lines 1205..1216

                                              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 112.

                                              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 5 locations. Consider refactoring.
                                              Open

                                                      SpacePortQueue : function(remaining, elLine){
                                                          var arrTime;
                                                          if(remaining <= 0) {
                                                              arrTime = 'Overdue ' + Lib.formatTime(Math.round(-remaining));
                                                          }
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 4 other locations - About 3 hrs to fix
                                              app/js-yui/building/shipyard.js on lines 178..187
                                              app/js-yui/building/spacePort.js on lines 967..976
                                              app/js-yui/mapStar.js on lines 743..752
                                              app/js-yui/module/policeStation.js on lines 187..196

                                              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 105.

                                              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 5 locations. Consider refactoring.
                                              Open

                                                      ForeignQueue : function(remaining, elLine){
                                                          var arrTime;
                                                          if(remaining <= 0) {
                                                              arrTime = 'Overdue ' + Lib.formatTime(Math.round(-remaining));
                                                          }
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 4 other locations - About 3 hrs to fix
                                              app/js-yui/building/shipyard.js on lines 178..187
                                              app/js-yui/building/spacePort.js on lines 494..503
                                              app/js-yui/mapStar.js on lines 743..752
                                              app/js-yui/module/policeStation.js on lines 187..196

                                              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 105.

                                              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

                                                      _getForeignTab : function() {
                                                          this.foreignShipsTab = new YAHOO.widget.Tab({ label: "Incoming", content: [
                                                              '<div>',
                                                              '    <ul class="shipHeader shipInfo clearafter">',
                                                              '        <li class="shipTypeImage">&nbsp;</li>',
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 2 other locations - About 3 hrs to fix
                                              app/js-yui/building/spacePort.js on lines 121..138
                                              app/js-yui/module/policeStation.js on lines 28..45

                                              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 96.

                                              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

                                                      _getLogsTab : function() {
                                                          this.battleLogsTab = new YAHOO.widget.Tab({ label: "Battle Logs", content: [
                                                              '<div>',
                                                              '    <ul class="shipHeader shipInfo clearafter" style="padding-left:5px; padding-right:5px;">',
                                                              '        <li class="shipTask">Role</li>',
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 2 other locations - About 3 hrs to fix
                                              app/js-yui/building/spacePort.js on lines 103..120
                                              app/js-yui/module/policeStation.js on lines 28..45

                                              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 96.

                                              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

                                                          Event.on("sendShipType", "change", function(){
                                                              if(Lib.getSelectedOptionValue(this) === "xy") {
                                                                  Dom.setStyle("sendShipTargetSelectText", "display", "none");
                                                                  Dom.setStyle("sendShipTargetSelectXY", "display", "");
                                                              }
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 2 hrs to fix
                                              app/js-yui/building/spacePort.js on lines 212..221

                                              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 93.

                                              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

                                                          Event.on("sendFleetType", "change", function(){
                                                              if(Lib.getSelectedOptionValue(this) === "xy") {
                                                                  Dom.setStyle("sendFleetTargetSelectText", "display", "none");
                                                                  Dom.setStyle("sendFleetTargetSelectXY", "display", "");
                                                              }
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 2 hrs to fix
                                              app/js-yui/building/spacePort.js on lines 153..162

                                              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 93.

                                              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

                                                      _getOrbitingTab : function() {
                                                          this.viewOrbitingTab = new YAHOO.widget.Tab({ label: "Foreign Orbiting", content: [
                                                              '<div>',
                                                              '    <ul class="shipHeader shipInfo clearafter">',
                                                              '        <li class="shipTypeImage">&nbsp;</li>',
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 2 hrs to fix
                                              app/js-yui/building/miningMinistry.js on lines 36..52

                                              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 92.

                                              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/spacePort.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/tradeMinistry.js on lines 6..14
                                              app/js-yui/building/transporter.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 7 locations. Consider refactoring.
                                              Open

                                                          setTimeout(function() {
                                                              var Ht = Game.GetSize().h - 250;
                                                              if(Ht > 250) { Ht = 250; }
                                                              Dom.setStyle(detailsParent,"height",Ht + "px");
                                                              Dom.setStyle(detailsParent,"overflow-y","auto");
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 6 other locations - About 2 hrs to fix
                                              app/js-yui/building/blackHoleGenerator.js on lines 250..255
                                              app/js-yui/building/spacePort.js on lines 1272..1277
                                              app/js-yui/mapStar.js on lines 805..810
                                              app/js-yui/mapStar.js on lines 906..911
                                              app/js-yui/mapStar.js on lines 1042..1047
                                              app/js-yui/mapStar.js on lines 1095..1100

                                              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 86.

                                              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 7 locations. Consider refactoring.
                                              Open

                                                          setTimeout(function() {
                                                              var Ht = Game.GetSize().h - 250;
                                                              if(Ht > 250) { Ht = 250; }
                                                              Dom.setStyle(detailsParent,"height",Ht + "px");
                                                              Dom.setStyle(detailsParent,"overflow-y","auto");
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 6 other locations - About 2 hrs to fix
                                              app/js-yui/building/blackHoleGenerator.js on lines 250..255
                                              app/js-yui/building/spacePort.js on lines 1411..1416
                                              app/js-yui/mapStar.js on lines 805..810
                                              app/js-yui/mapStar.js on lines 906..911
                                              app/js-yui/mapStar.js on lines 1042..1047
                                              app/js-yui/mapStar.js on lines 1095..1100

                                              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 86.

                                              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(info) {
                                                                          this.Self.result.docks_available++;
                                                                          info.innerHTML = ['This SpacePort can dock a maximum of ', this.Self.result.max_ships, ' ships. There are ', this.Self.result.docks_available, ' docks available.'].join('');
                                                                      }
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 1 hr to fix
                                              app/js-yui/building/spacePort.js on lines 1145..1148

                                              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 2 locations. Consider refactoring.
                                              Open

                                                                  if(info) {
                                                                      this.Self.result.docks_available++;
                                                                      info.innerHTML = ['This SpacePort can dock a maximum of ', this.Self.result.max_ships, ' ships. There are ', this.Self.result.docks_available, ' docks available.'].join('');
                                                                  }
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 1 hr to fix
                                              app/js-yui/building/spacePort.js on lines 1110..1113

                                              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

                                                          return [this._getTravelTab(), this._getViewTab(), this._getOrbitingTab(), this._getForeignTab(), this._getLogsTab(), this._getSendTab(), this._getSendFleetTab()];
                                              Severity: Major
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 1 hr to fix
                                              app/js-yui/building/tradeMinistry.js on lines 171..171

                                              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 59.

                                              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.Self.service.name_ship({
                                                              session_id:Game.GetSession(),
                                                              building_id:this.Self.building.id,
                                                              ship_id:this.Ship.id,
                                                              name:newName
                                              Severity: Minor
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 40 mins to fix
                                              app/js-yui/building/intelligence.js on lines 502..507

                                              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 49.

                                              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.travelTab = new YAHOO.widget.Tab({ label: "Travelling", content: [
                                                              '<div>',
                                                              '    <div style="overflow:auto;margin-top:2px;">',
                                                              '        <ul id="shipDetails"></ul>',
                                                              '    </div>',
                                              Severity: Minor
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 40 mins to fix
                                              app/js-yui/building/intelligence.js on lines 81..88

                                              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 48.

                                              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

                                                              failure : function(o){
                                                                  if(this.Input) {
                                                                      this.Input.value = this.Ship.name;
                                                                  }
                                                              },
                                              Severity: Minor
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 30 mins to fix
                                              app/js-yui/building/intelligence.js on lines 519..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 45.

                                              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(!noEvent) {
                                                                  Event.delegate(nLi, 'click', this.ShipScuttle, 'button.scuttle', {Self:this,Ship:ship,Line:nLi}, true);
                                                              }
                                              Severity: Minor
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 30 mins to fix
                                              app/js-yui/building/spacePort.js on lines 534..536

                                              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 45.

                                              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(!noEvent) {
                                                                  Event.delegate(nLi, 'click', this.ShipRecall, 'button.recall', {Self:this,Ship:ship,Line:nLi}, true);
                                                              }
                                              Severity: Minor
                                              Found in app/js-yui/building/spacePort.js and 1 other location - About 30 mins to fix
                                              app/js-yui/building/spacePort.js on lines 511..513

                                              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 45.

                                              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