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

        PushAddResource : function(e, matchedEl, container){
            var quantity = matchedEl.previousSibling.value*1,
                li = matchedEl.parentNode,
                c = Dom.get("tradePushItems");
            if(quantity && c) {
Severity: Major
Found in app/js-yui/building/transporter.js and 1 other location - About 3 days to fix
app/js-yui/building/distributionCenter.js on lines 148..198

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

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

        ReserveStoreAdd : function(e, matchedEl, container){
            var quantity = matchedEl.previousSibling.value*1,
                li = matchedEl.parentNode,
                c = Dom.get("distribReserveToStore");
            if(quantity && c) {
Severity: Major
Found in app/js-yui/building/distributionCenter.js and 1 other location - About 3 days to fix
app/js-yui/building/transporter.js on lines 1470..1520

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

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

File mapper.js has 1429 lines of code (exceeds 250 allowed). Consider refactoring.
Open

YAHOO.namespace("lacuna");

var $ = require('js/shims/jquery');

if (typeof YAHOO.lacuna.Mapper == "undefined" || !YAHOO.lacuna.Mapper) {
Severity: Major
Found in app/js-yui/mapper.js - About 3 days to fix

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

            MinePopulate : function() {
                var details = Dom.get("tradeMineDetails");
                
                if(details) {
                    var trades = this.mineTrades.trades,
    Severity: Major
    Found in app/js-yui/building/tradeMinistry.js and 2 other locations - About 3 days to fix
    app/js-yui/building/mercenariesGuild.js on lines 322..380
    app/js-yui/building/transporter.js on lines 716..774

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

    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

            MinePopulate : function() {
                var details = Dom.get("tradeMineDetails");
                
                if(details) {
                    var trades = this.mineTrades.trades,
    Severity: Major
    Found in app/js-yui/building/transporter.js and 2 other locations - About 3 days to fix
    app/js-yui/building/mercenariesGuild.js on lines 322..380
    app/js-yui/building/tradeMinistry.js on lines 693..751

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

    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

            MinePopulate : function() {
                var details = Dom.get("tradeMineDetails");
                
                if(details) {
                    var trades = this.mineMercs.trades,
    Severity: Major
    Found in app/js-yui/building/mercenariesGuild.js and 2 other locations - About 3 days to fix
    app/js-yui/building/tradeMinistry.js on lines 693..751
    app/js-yui/building/transporter.js on lines 716..774

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

    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

            AddGlyphSummary : function(e, matchedEl, container){
                var quantity = matchedEl.previousSibling.value*1,
                    li = matchedEl.parentNode,
                    c = Dom.get("tradeAddItems");
                if(li && c) {
    Severity: Major
    Found in app/js-yui/building/tradeMinistry.js and 2 other locations - About 3 days to fix
    app/js-yui/building/tradeMinistry.js on lines 1560..1605
    app/js-yui/building/transporter.js on lines 1026..1071

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

    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

            PushAddGlyphSummary : function(e, matchedEl, container){
                var quantity = matchedEl.previousSibling.value*1,
                    li = matchedEl.parentNode,
                    c = Dom.get("tradePushItems");
                if(li && c) {
    Severity: Major
    Found in app/js-yui/building/tradeMinistry.js and 2 other locations - About 3 days to fix
    app/js-yui/building/tradeMinistry.js on lines 1036..1081
    app/js-yui/building/transporter.js on lines 1026..1071

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

    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

            AddGlyph : function(e, matchedEl, container){
                var quantity = matchedEl.previousSibling.value*1,
                    li = matchedEl.parentNode,
                    c = Dom.get("tradeAddItems");
                if(li && c) {
    Severity: Major
    Found in app/js-yui/building/transporter.js and 2 other locations - About 3 days to fix
    app/js-yui/building/tradeMinistry.js on lines 1036..1081
    app/js-yui/building/tradeMinistry.js on lines 1560..1605

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

    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

    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

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

              StashDonateAdd : function(e, matchedEl, container){
                  var quantity = Lib.getSelectedOptionValue(matchedEl.previousSibling)*1,
                      li = matchedEl.parentNode,
                      c = Dom.get("embassyStashToDonate");
                  if(quantity && c) {
      Severity: Major
      Found in app/js-yui/building/embassy.js and 1 other location - About 3 days to fix
      app/js-yui/building/embassy.js on lines 424..467

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

      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

              StashExchangeAdd : function(e, matchedEl, container){
                  var quantity = Lib.getSelectedOptionValue(matchedEl.previousSibling)*1,
                      li = matchedEl.parentNode,
                      c = Dom.get("embassyStashToExchange");
                  if(quantity && c) {
      Severity: Major
      Found in app/js-yui/building/embassy.js and 1 other location - About 3 days to fix
      app/js-yui/building/embassy.js on lines 356..399

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

      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

      File parliament.js has 1247 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      YAHOO.namespace("lacuna.modules");
      
      if (typeof YAHOO.lacuna.modules.Parliament == "undefined" || !YAHOO.lacuna.modules.Parliament) {
          
      (function(){
      Severity: Major
      Found in app/js-yui/module/parliament.js - About 3 days to fix

        File stats.js has 1179 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        'use strict';
        
        var StatsWindowActions = require('js/actions/windows/stats');
        
        var _ = require('lodash');
        Severity: Major
        Found in app/js-yui/stats.js - About 3 days to fix

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

                  populateAddResourceName : function() {
                      var elm = Dom.get("tradeAddResourceName"),
                          li = document.createElement("li"), nLi, x, r, name, resource;
                          
                      if(elm) {
          Severity: Major
          Found in app/js-yui/building/transporter.js and 3 other locations - About 2 days to fix
          app/js-yui/building/tradeMinistry.js on lines 808..845
          app/js-yui/building/tradeMinistry.js on lines 1327..1364
          app/js-yui/building/transporter.js on lines 1325..1362

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

          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

                  populateAddResourceName : function() {
                      var elm = Dom.get("tradeAddResourceName"),
                          li = document.createElement("li"), nLi, x, r, name, resource;
                          
                      if(elm) {
          Severity: Major
          Found in app/js-yui/building/tradeMinistry.js and 3 other locations - About 2 days to fix
          app/js-yui/building/tradeMinistry.js on lines 1327..1364
          app/js-yui/building/transporter.js on lines 831..868
          app/js-yui/building/transporter.js on lines 1325..1362

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

          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

                  populatePushResourceName : function() {
                      var elm = Dom.get("tradePushResourceName"),
                          li = document.createElement("li"), nLi, x, r, name, resource;
                          
                      if(elm) {
          Severity: Major
          Found in app/js-yui/building/tradeMinistry.js and 3 other locations - About 2 days to fix
          app/js-yui/building/tradeMinistry.js on lines 808..845
          app/js-yui/building/transporter.js on lines 831..868
          app/js-yui/building/transporter.js on lines 1325..1362

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

          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

                  populatePushResourceName : function() {
                      var elm = Dom.get("tradePushResourceName"),
                          li = document.createElement("li"), nLi, x, r, name, resource;
                          
                      if(elm) {
          Severity: Major
          Found in app/js-yui/building/transporter.js and 3 other locations - About 2 days to fix
          app/js-yui/building/tradeMinistry.js on lines 808..845
          app/js-yui/building/tradeMinistry.js on lines 1327..1364
          app/js-yui/building/transporter.js on lines 831..868

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

          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

          File embassy.js has 1126 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          YAHOO.namespace("lacuna.buildings");
          
          if (typeof YAHOO.lacuna.buildings.Embassy == "undefined" || !YAHOO.lacuna.buildings.Embassy) {
              
          (function(){
          Severity: Major
          Found in app/js-yui/building/embassy.js - About 2 days to fix

            File messaging.js has 1084 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            'use strict';
            
            var MailWindowActions = require('js/actions/windows/mail');
            
            var _ = require('lodash');
            Severity: Major
            Found in app/js-yui/messaging.js - About 2 days to fix
              Severity
              Category
              Status
              Source
              Language