plainblack/Lacuna-Web-Client

View on GitHub

Showing 509 of 1,320 total issues

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

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

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

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

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

          authenticateChat : function() {
      
              // Only do this process once.
              // NOTE: it's checked before but we're just making sure. (nice rhyming)
              if (this.hasRenderedChat === true) {
      Severity: Minor
      Found in app/js/components/menu/chat.jsx - About 1 hr to fix

        Function titleCaps has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            String.prototype.titleCaps = function(replaceVal, withVal){
                var parts = [], split = /[:.;?!] |(?: |^)["�]/g, index = 0, processVal = this;
                var fnUpper = function(all){
                        return (/[A-Za-z]\.[A-Za-z]/).test(all) ? all : String.upper(all);
                    },
        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 _getBodiesHtml has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                _getBodiesHtml : function() {
                    var data = this._serverOverview.bodies;
                    return [
                        '<ul class="statsList">',
                        '<li><label>Total Bodies:</label>', Lib.formatNumber(data.count), '</li>',
        Severity: Minor
        Found in app/js-yui/stats.js - About 1 hr to fix

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

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

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

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

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

                      speciesDisplay : function(stat) {
                          this.species.innerHTML = [
                              '<li style="border-bottom:1px solid #52ACFF;font-size:120%;"><label>',stat.name,'</label></li>',
                              '<li style="padding-bottom:5px;">', stat.description, '</li>',
                              '<li>',
              Severity: Minor
              Found in app/js-yui/building/libraryOfJith.js - About 1 hr to fix

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

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

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

                          Mapper : function(oArgs) {
                              //YAHOO.log(oArgs.buildings, "debug", "Mapper");
                              this.buildings = oArgs.buildings;
                              this.surfaceUrl = [Lib.AssetUrl,'planet_side/',oArgs.body.surface_image,'.jpg'].join('');
                              Dom.setStyle("buildingDetailsImgBkgd","background",['transparent url(',this.surfaceUrl,') no-repeat left top'].join(''));
                  Severity: Minor
                  Found in app/js-yui/mapPlanet.js - About 1 hr to fix

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

                        render : function() {
                            var building    = this.state.genericBuildingStore;
                            var body        = this.state.body;
                    
                            return (
                    Severity: Minor
                    Found in app/js/components/window/building/repairTab.jsx - About 1 hr to fix

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

                          render : function() {
                              return (
                                  <div className="ui right vertical inverted sidebar menu" ref="sidebar">
                      
                                      <div ref="header" style={{paddingTop : 7}}>
                      Severity: Minor
                      Found in app/js/components/menu/rightSidebar.jsx - About 1 hr to fix

                        Function _createSliders has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                _createSliders : function() {
                                    this.speciesHO = this._createHabitableOrbits();
                                    this.speciesConst = this._createHorizSingle("speciesConst", "speciesConst_thumb", "speciesConst_num");
                                    this.speciesDecep = this._createHorizSingle("speciesDecep", "speciesDecep_thumb", "speciesDecep_num");
                                    this.speciesResearch = this._createHorizSingle("speciesResearch", "speciesResearch_thumb", "speciesResearch_num");
                        Severity: Minor
                        Found in app/js-yui/speciesDesigner.js - About 1 hr to fix

                          Function CreateFind has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  CreateFind : function() {
                                      if(!this.findStar) {
                                          var dataSource = new Util.XHRDataSource("/map");
                                          dataSource.connMethodPost = "POST";
                                          dataSource.maxCacheEntries = 2;
                          Severity: Minor
                          Found in app/js-yui/building/templeOfTheDrajilites.js - About 1 hr to fix

                            Function populateSpies has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    populateSpies : function(tab) {
                                        var list = tab.elSpiesList;
                                        var spies = tab.avail.spies;
                                        var ships = tab.avail.spyShips;
                                        var verb = tab.id == 'planetDetailSendSpies' ? 'send' : 'fetch';
                            Severity: Minor
                            Found in app/js-yui/mapStar.js - About 1 hr to fix

                              Function _getHtml has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      _getHtml : function() {
                                          var Ht = Game.GetSize().h - 140;
                                          if(Ht > 300) { Ht = 300; }
                                          return [
                                          '    <div class="hd">Empire</div>',
                              Severity: Minor
                              Found in app/js-yui/info.js - About 1 hr to fix

                                Function _createPanel has 45 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 updateDisplay has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          updateDisplay : function(exp) {
                                              Dom.get("geneticsLabSurvival").innerHTML = exp.survival_odds;
                                              Dom.get("geneticsLabGraft").innerHTML = exp.graft_odds;
                                              Dom.get("geneticsLabCost").innerHTML = exp.essentia_cost;
                                              Dom.removeClass(Sel.query("li.selected", "geneticsLabSpies"),"selected");
                                  Severity: Minor
                                  Found in app/js-yui/building/geneticsLab.js - About 1 hr to fix

                                    Function createFind has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

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

                                      Function handleLogin has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              handleLogin : function() {
                                                  require('js/actions/menu/loader').show();
                                                  this.setMessage("");
                                                  var EmpireServ = Game.Services.Empire;
                                                  new Fingerprint2().get(_.bind(function(result){
                                      Severity: Minor
                                      Found in app/js-yui/login.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language