plainblack/Lacuna-Web-Client

View on GitHub

Showing 509 of 1,320 total issues

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

    render : function() {
        return (
            <div style={{
                paddingBottom : 5,
                display       : 'inline-block'
Severity: Minor
Found in app/js/components/window/building/information.jsx - About 1 hr to fix

    Function indexOf has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        Array.prototype.indexOf = function(elt /*, from*/) {
            var len = this.length >>> 0;
    
            var from = Number(arguments[1]) || 0;
            from = (from < 0) ? Math.ceil(from) : Math.floor(from);
    Severity: Minor
    Found in app/js-yui/library.js - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

        _getViewTab : function() {
          var tab = new YAHOO.widget.Tab({ label: "View Glyphs", content: [
            '<div class="clearafter">',
            '  <div class="archaeologySlots">',
            '    <label>Available Glyphs</label>',
    Severity: Minor
    Found in app/js-yui/building/archaeology.js - About 1 hr to fix

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

              getSpeciesData : function() {
                  var data = {
                      name: this.elName.value,
                      description: this.elDesc.value.substr(0,1024),
                      min_orbit: this.speciesHO.getMinOrbit(),
      Severity: Minor
      Found in app/js-yui/speciesDesigner.js - About 1 hr to fix

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

                build: function() {
                    this.id = "Announce";
        
                    var container = document.createElement("div");
                    container.id = this.id;
        Severity: Minor
        Found in app/js-yui/announce.js - About 1 hr to fix

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

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

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

                    _createPanel : function() {
                        if(!this.Panel) {
                            var container = document.createElement("div");
                            container.id = this.id;
                            Dom.addClass(container, Lib.Styles.HIDDEN);
            Severity: Minor
            Found in app/js-yui/info.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 PopulateBodiesForStar has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        PopulateBodiesForStar : function(e) {
                            var starId   = Lib.getSelectedOptionValue(this.starElement),
                                bodyList = Dom.get(this.bodyElement);
                            
                            require('js/actions/menu/loader').show()
                Severity: Minor
                Found in app/js-yui/module/parliament.js - About 1 hr to fix

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

                          Build : function(building, x, y) {
                              if(this.NotIsolationist(building)) {
                                  return;
                              }
                  
                  
                  Severity: Minor
                  Found in app/js-yui/mapPlanet.js - About 1 hr to fix

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

                            Rename : function() {
                                var newName = Dom.get("planetDetailNewName").value;
                                Game.Services.Body.rename({
                                        session_id: Game.GetSession(""),
                                        body_id:this.selectedBody.id,
                    Severity: Minor
                    Found in app/js-yui/mapStar.js - About 1 hr to fix

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

                              RenameUninhabited: function(e) {
                                  var button = Event.getTarget(e),
                                      body = Lib.getSelectedOptionValue('proposeRenameUninhabitedName'),
                                      newName = Dom.get('proposeRenameUninhabitedNewName').value;
                      
                      
                      Severity: Minor
                      Found in app/js-yui/module/parliament.js - About 1 hr to fix

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

                                ShipBuild : function(e) {
                                    var btn = Event.getTarget(e);
                                    btn.disabled = true;
                                    require('js/actions/menu/loader').show();
                                    var qty = Dom.get("ship_"+this.Type);
                        Severity: Minor
                        Found in app/js-yui/building/shipyard.js - About 1 hr to fix

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

                                  _updateDirty : function() {
                                      //only update dirty if it's not a select
                                      if(!this._singleRequest) {
                                          var isDirty;
                                          if(this.multiSelect){
                          Severity: Minor
                          Found in app/js-yui/textboxList.js - About 1 hr to fix

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

                                    RenameAsteroid: function(e) {
                                        var button = Event.getTarget(e),
                                            body = Lib.getSelectedOptionValue('proposeRenameAsteroidName'),
                                            newName = Dom.get('proposeRenameAsteroidNewName').value;
                            
                            
                            Severity: Minor
                            Found in app/js-yui/module/parliament.js - About 1 hr to fix

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

                                      ShipSend : function() {
                                          var oSelf = this.Self,
                                              ship = this.Ship,
                                              target, targetName, panel;
                              
                              
                              Severity: Minor
                              Found in app/js-yui/mapStar.js - About 1 hr to fix

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

                                    render : function() {
                                        return (
                                            <div
                                                id="sidebarContainer"
                                                style={{
                                Severity: Minor
                                Found in app/js/components/gameWindow.jsx - About 1 hr to fix

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

                                          MaxValue : function(e) {
                                              var btn = Event.getTarget(e),
                                                  input = btn.input,
                                                  cp = Game.GetCurrentPlanet(),
                                                  origVal, newVal;
                                  Severity: Minor
                                  Found in app/js-yui/building/wasteRecycling.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 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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language