plainblack/Lacuna-Web-Client

View on GitHub
app/js/components/menu/bottomBar.jsx

Summary

Maintainability
F
4 days
Test Coverage

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

    render : function() {
        var body   = this.state.body;
        var empire = this.state.empire;
        var server = this.state.server;

Severity: Major
Found in app/js/components/menu/bottomBar.jsx - About 4 hrs to fix

    File bottomBar.jsx has 252 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    var React                = require('react');
    var ReactDOM             = require('react-dom');
    var ReactDOMServer       = require('react-dom/server');
    Severity: Minor
    Found in app/js/components/menu/bottomBar.jsx - About 2 hrs to fix

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

          showWasteToolTip : function() {
              $(ReactDOM.findDOMNode(this.refs.wasteSection)).popup({
                  position : 'top center',
                  html     : ReactDOMServer.renderToStaticMarkup(
                      <ResourceToolTip
      Severity: Major
      Found in app/js/components/menu/bottomBar.jsx and 4 other locations - About 3 hrs to fix
      app/js/components/menu/bottomBar.jsx on lines 35..47
      app/js/components/menu/bottomBar.jsx on lines 49..61
      app/js/components/menu/bottomBar.jsx on lines 63..75
      app/js/components/menu/bottomBar.jsx on lines 77..89

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

      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 5 locations. Consider refactoring.
      Open

          showWaterToolTip : function() {
              $(ReactDOM.findDOMNode(this.refs.waterSection)).popup({
                  position : 'top center',
                  html     : ReactDOMServer.renderToStaticMarkup(
                      <ResourceToolTip
      Severity: Major
      Found in app/js/components/menu/bottomBar.jsx and 4 other locations - About 3 hrs to fix
      app/js/components/menu/bottomBar.jsx on lines 35..47
      app/js/components/menu/bottomBar.jsx on lines 49..61
      app/js/components/menu/bottomBar.jsx on lines 77..89
      app/js/components/menu/bottomBar.jsx on lines 91..103

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

      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 5 locations. Consider refactoring.
      Open

          showEnergyToolTip : function() {
              $(ReactDOM.findDOMNode(this.refs.energySection)).popup({
                  position : 'top center',
                  html     : ReactDOMServer.renderToStaticMarkup(
                      <ResourceToolTip
      Severity: Major
      Found in app/js/components/menu/bottomBar.jsx and 4 other locations - About 3 hrs to fix
      app/js/components/menu/bottomBar.jsx on lines 35..47
      app/js/components/menu/bottomBar.jsx on lines 49..61
      app/js/components/menu/bottomBar.jsx on lines 63..75
      app/js/components/menu/bottomBar.jsx on lines 91..103

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

      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 5 locations. Consider refactoring.
      Open

          showFoodToolTip : function() {
              $(ReactDOM.findDOMNode(this.refs.foodSection)).popup({
                  position : 'top center',
                  html     : ReactDOMServer.renderToStaticMarkup(
                      <ResourceToolTip
      Severity: Major
      Found in app/js/components/menu/bottomBar.jsx and 4 other locations - About 3 hrs to fix
      app/js/components/menu/bottomBar.jsx on lines 49..61
      app/js/components/menu/bottomBar.jsx on lines 63..75
      app/js/components/menu/bottomBar.jsx on lines 77..89
      app/js/components/menu/bottomBar.jsx on lines 91..103

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

      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 5 locations. Consider refactoring.
      Open

          showOreToolTip : function() {
              $(ReactDOM.findDOMNode(this.refs.oreSection)).popup({
                  position : 'top center',
                  html     : ReactDOMServer.renderToStaticMarkup(
                      <ResourceToolTip
      Severity: Major
      Found in app/js/components/menu/bottomBar.jsx and 4 other locations - About 3 hrs to fix
      app/js/components/menu/bottomBar.jsx on lines 35..47
      app/js/components/menu/bottomBar.jsx on lines 63..75
      app/js/components/menu/bottomBar.jsx on lines 77..89
      app/js/components/menu/bottomBar.jsx on lines 91..103

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

      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 5 locations. Consider refactoring.
      Open

                              <BottomBarSection
                                  ref="oreSection"
                                  progressPercent={body.ore_percent_full}
                                  iconName="diamond"
                                  topText={rn(body.ore_stored) + ' / ' + rn(body.ore_capacity)}
      Severity: Major
      Found in app/js/components/menu/bottomBar.jsx and 4 other locations - About 2 hrs to fix
      app/js/components/menu/bottomBar.jsx on lines 179..186
      app/js/components/menu/bottomBar.jsx on lines 197..204
      app/js/components/menu/bottomBar.jsx on lines 206..213
      app/js/components/menu/bottomBar.jsx on lines 218..225

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

      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 5 locations. Consider refactoring.
      Open

                              <BottomBarSection
                                  ref="waterSection"
                                  progressPercent={body.water_percent_full}
                                  iconName="theme"
                                  topText={rn(body.water_stored) + ' / ' + rn(body.water_capacity)}
      Severity: Major
      Found in app/js/components/menu/bottomBar.jsx and 4 other locations - About 2 hrs to fix
      app/js/components/menu/bottomBar.jsx on lines 179..186
      app/js/components/menu/bottomBar.jsx on lines 188..195
      app/js/components/menu/bottomBar.jsx on lines 206..213
      app/js/components/menu/bottomBar.jsx on lines 218..225

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

      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 5 locations. Consider refactoring.
      Open

                                      <BottomBarSection
                                          ref="wasteSection"
                                          progressPercent={body.waste_percent_full}
                                          iconName="trash"
                                          topText={rn(body.waste_stored) + ' / ' + rn(body.waste_capacity)}
      Severity: Major
      Found in app/js/components/menu/bottomBar.jsx and 4 other locations - About 2 hrs to fix
      app/js/components/menu/bottomBar.jsx on lines 179..186
      app/js/components/menu/bottomBar.jsx on lines 188..195
      app/js/components/menu/bottomBar.jsx on lines 197..204
      app/js/components/menu/bottomBar.jsx on lines 206..213

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

      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 5 locations. Consider refactoring.
      Open

                              <BottomBarSection
                                  ref="foodSection"
                                  progressPercent={body.food_percent_full}
                                  iconName="food"
                                  topText={rn(body.food_stored) + ' / ' + rn(body.food_capacity)}
      Severity: Major
      Found in app/js/components/menu/bottomBar.jsx and 4 other locations - About 2 hrs to fix
      app/js/components/menu/bottomBar.jsx on lines 188..195
      app/js/components/menu/bottomBar.jsx on lines 197..204
      app/js/components/menu/bottomBar.jsx on lines 206..213
      app/js/components/menu/bottomBar.jsx on lines 218..225

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

      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 5 locations. Consider refactoring.
      Open

                              <BottomBarSection
                                  ref="energySection"
                                  progressPercent={body.energy_percent_full}
                                  iconName="lightning"
                                  topText={rn(body.energy_stored) + ' / ' + rn(body.energy_capacity)}
      Severity: Major
      Found in app/js/components/menu/bottomBar.jsx and 4 other locations - About 2 hrs to fix
      app/js/components/menu/bottomBar.jsx on lines 179..186
      app/js/components/menu/bottomBar.jsx on lines 188..195
      app/js/components/menu/bottomBar.jsx on lines 197..204
      app/js/components/menu/bottomBar.jsx on lines 218..225

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

      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

          showBuildingCountToolTip : function() {
              $(ReactDOM.findDOMNode(this.refs.buildingCountSection)).popup({
                  html      : ReactDOMServer.renderToStaticMarkup(<BuildingCountToolTip />),
                  hoverable : true,
                  position  : 'top center',
      Severity: Major
      Found in app/js/components/menu/bottomBar.jsx and 1 other location - About 2 hrs to fix
      app/js/components/menu/bottomBar.jsx on lines 148..157

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

      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

          showRPCCountToolTip : function() {
              $(ReactDOM.findDOMNode(this.refs.rpcCountSection)).popup({
                  html      : ReactDOMServer.renderToStaticMarkup(<RPCCountToolTip />),
                  hoverable : true,
                  position  : 'top center',
      Severity: Major
      Found in app/js/components/menu/bottomBar.jsx and 1 other location - About 2 hrs to fix
      app/js/components/menu/bottomBar.jsx on lines 124..133

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

      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

      There are no issues that match your filters.

      Category
      Status