plainblack/Lacuna-Web-Client

View on GitHub

Showing 1,320 of 1,320 total issues

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

                    if (column.key == "empire_name") {
                        record = this.getRecord(target);
                        Lacuna.Info.Empire.Load(record.getData("empire_id"));
                    }
                    else if (column.key == "alliance_name") {
Severity: Minor
Found in app/js-yui/stats.js and 1 other location - About 35 mins to fix
app/js-yui/stats.js on lines 543..546

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

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

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 / 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 (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 / 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) || '0';
            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);
              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 / 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 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 -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

                          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 0;
                              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

                                    Avoid too many return statements within this function.
                                    Open

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

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

                                                          "cancel_build" : {
                                                              "description": "Cancel any one building on the build queue.",
                                                              "parameters": [{"name":"args", "type":"object", "optional":false}],
                                                              "returns":{"type":"object"}
                                                          },
                                      Severity: Major
                                      Found in app/js-yui/smd.js and 18 other locations - About 30 mins to fix
                                      app/js-yui/smd.js on lines 75..79
                                      app/js-yui/smd.js on lines 310..316
                                      app/js-yui/smd.js on lines 354..358
                                      app/js-yui/smd.js on lines 1002..1008
                                      app/js-yui/smd.js on lines 1590..1596
                                      app/js-yui/smd.js on lines 2884..2890
                                      app/js-yui/smd.js on lines 2903..2909
                                      app/js-yui/smd.js on lines 2910..2916
                                      app/js-yui/smd.js on lines 2956..2962
                                      app/js-yui/smd.js on lines 3150..3156
                                      app/js-yui/smd.js on lines 3157..3163
                                      app/js-yui/smd.js on lines 3164..3170
                                      app/js-yui/smd.js on lines 3171..3177
                                      app/js-yui/smd.js on lines 3222..3228
                                      app/js-yui/smd.js on lines 3237..3243
                                      app/js-yui/smd.js on lines 3258..3264
                                      app/js-yui/smd.js on lines 3276..3282
                                      app/js-yui/smd.js on lines 3482..3486

                                      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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language