plainblack/Lacuna-Web-Client

View on GitHub

Showing 509 of 1,320 total issues

Consider simplifying this complex logical expression.
Open

if (typeof YAHOO.lacuna.buildings.Embassy == "undefined" || !YAHOO.lacuna.buildings.Embassy) {
    
(function(){
    var Lang = YAHOO.lang,
        Util = YAHOO.util,
Severity: Major
Found in app/js-yui/building/embassy.js - About 40 mins to fix

    Function getTileData has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            getTileData : function(callback, x1, x2, y1, y2) {
    Severity: Minor
    Found in app/js-yui/mapper.js - About 35 mins to fix

      Function setOrbits has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

                      setOrbits : function(minOrbit, maxOrbit, skipAnim, force, silent) {
      Severity: Minor
      Found in app/js-yui/speciesDesigner.js - About 35 mins to fix

        Function getTileData has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                getTileData : function(callback, x1, x2, y1, y2) {
        Severity: Minor
        Found in app/js-yui/mapper.js - About 35 mins to fix

          Function ViewData has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  ViewData : function(id, url, callback, x, y) {
          Severity: Minor
          Found in app/js-yui/mapPlanet.js - About 35 mins to fix

            Function render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                render           : function() {
            
                    // console.log(this.state);
            
                    // Do nothing if the menu isn't shown.
            Severity: Minor
            Found in app/js/components/menu/map.jsx - About 35 mins 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 componentDidUpdate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                componentDidUpdate : function() {
            
                    if (this.state.chatMenu.show !== this.hasRenderedChat) {
                        if (this.state.chatMenu.show === true && this.hasRenderedChat === false) {
                            this.loadChat();
            Severity: Minor
            Found in app/js/components/menu/chat.jsx - About 35 mins 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

            Avoid too many return statements within this function.
            Open

                    return Math.floor(number / 1000000000) + 'B';
            Severity: Major
            Found in app/js/util.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return (Math.floor(number / 100000000) / 10) + 'B';
              Severity: Major
              Found in app/js/util.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return Math.floor(number / 1000) + 'k';
                Severity: Major
                Found in app/js/util.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                              return {"error":{"message":"Response Content-Type is not JSON"}};
                  Severity: Major
                  Found in app/js-yui/rpc.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return Math.floor(number);
                    Severity: Major
                    Found in app/js/util.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return Math.floor(number / 1000000) + 'M';
                      Severity: Major
                      Found in app/js/util.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return (Math.floor(number / 100000) / 10) + 'M';
                        Severity: Major
                        Found in app/js/util.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return Math.floor(number) || '0';
                          Severity: Major
                          Found in app/js/util.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                                    return 0;
                            Severity: Major
                            Found in app/js-yui/building/geneticsLab.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                              return 0;
                              Severity: Major
                              Found in app/js-yui/library.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                    return 1;
                                Severity: Major
                                Found in app/js-yui/building/theDillonForge.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                      return -1;
                                  Severity: Major
                                  Found in app/js-yui/building/theDillonForge.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                          return 1;
                                    Severity: Major
                                    Found in app/js-yui/building/theDillonForge.js - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language