plainblack/Lacuna-Web-Client

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

Summary

Maintainability
D
3 days
Test Coverage

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

    render : function() {

        return (
            <div className="ui left vertical inverted sidebar menu" ref="sidebar">

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

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

        render : function() {
            var destructMs          = this.state.empireRPCStore.self_destruct_ms;
            var destructActive      = this.state.empireRPCStore.self_destruct_active && destructMs > 0;
            var formattedDestructMs = destructActive ? util.formatMillisecondTime(destructMs) : '';
    
    
    Severity: Minor
    Found in app/js/components/menu/leftSidebar.jsx - About 1 hr to fix

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

          componentDidMount : function() {
              var el = this.refs.sidebar;
      
              $(el)
                  .sidebar({
      Severity: Major
      Found in app/js/components/menu/leftSidebar.jsx and 1 other location - About 2 hrs to fix
      app/js/components/menu/rightSidebar.jsx on lines 242..253

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

      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

                      <a className="item" onClick={function() {
                          LeftSidebarActions.hide();
                          WindowActions.windowAdd(SurveyWindow, 'survey');
                      }}>
                          <i className="newspaper icon"></i>
      Severity: Major
      Found in app/js/components/menu/leftSidebar.jsx and 4 other locations - About 1 hr to fix
      app/js/components/menu/leftSidebar.jsx on lines 133..139
      app/js/components/menu/leftSidebar.jsx on lines 208..214
      app/js/components/menu/leftSidebar.jsx on lines 216..223
      app/js/components/menu/leftSidebar.jsx on lines 232..238

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

      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

                      <a className="item" onClick={function() {
                          LeftSidebarActions.hide();
                          WindowActions.windowAdd(AboutWindow, 'about');
                      }}>
                          <i className="rocket icon"></i>
      Severity: Major
      Found in app/js/components/menu/leftSidebar.jsx and 4 other locations - About 1 hr to fix
      app/js/components/menu/leftSidebar.jsx on lines 133..139
      app/js/components/menu/leftSidebar.jsx on lines 200..206
      app/js/components/menu/leftSidebar.jsx on lines 216..223
      app/js/components/menu/leftSidebar.jsx on lines 232..238

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

      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

                      <a className="item" onClick={function() {
                          LeftSidebarActions.hide();
                          WindowActions.windowAdd(ServerClock, 'serverclock')
                      }}>
                          <i className="wait icon"></i>
      Severity: Major
      Found in app/js/components/menu/leftSidebar.jsx and 4 other locations - About 1 hr to fix
      app/js/components/menu/leftSidebar.jsx on lines 133..139
      app/js/components/menu/leftSidebar.jsx on lines 200..206
      app/js/components/menu/leftSidebar.jsx on lines 208..214
      app/js/components/menu/leftSidebar.jsx on lines 216..223

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

      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

                      <a className="item" onClick={function() {
                          LeftSidebarActions.hide();
                          WindowActions.windowAdd(SitterManagerWindow, 'sitter');
                      }}
                      >
      Severity: Major
      Found in app/js/components/menu/leftSidebar.jsx and 4 other locations - About 1 hr to fix
      app/js/components/menu/leftSidebar.jsx on lines 133..139
      app/js/components/menu/leftSidebar.jsx on lines 200..206
      app/js/components/menu/leftSidebar.jsx on lines 208..214
      app/js/components/menu/leftSidebar.jsx on lines 232..238

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

      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

                      <a className="item" onClick={function() {
                          LeftSidebarActions.hide();
                          WindowActions.windowAdd(InviteWindow, 'invite');
                      }}>
                          <i className="add user icon"></i>
      Severity: Major
      Found in app/js/components/menu/leftSidebar.jsx and 4 other locations - About 1 hr to fix
      app/js/components/menu/leftSidebar.jsx on lines 200..206
      app/js/components/menu/leftSidebar.jsx on lines 208..214
      app/js/components/menu/leftSidebar.jsx on lines 216..223
      app/js/components/menu/leftSidebar.jsx on lines 232..238

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

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

                      <a className="item" target="_blank"
                          href="http://community.lacunaexpanse.com/forums"
                          onClick={LeftSidebarActions.hide}
                      >
                          <i className="comments layout icon"></i>
      Severity: Major
      Found in app/js/components/menu/leftSidebar.jsx and 6 other locations - About 1 hr to fix
      app/js/components/menu/leftSidebar.jsx on lines 152..157
      app/js/components/menu/leftSidebar.jsx on lines 158..163
      app/js/components/menu/leftSidebar.jsx on lines 171..176
      app/js/components/menu/leftSidebar.jsx on lines 177..182
      app/js/components/menu/leftSidebar.jsx on lines 183..188
      app/js/components/menu/leftSidebar.jsx on lines 189..194

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

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

                      <a className="item" target="_blank" href="http://www.lacunaexpanse.com/help/"
                          onClick={LeftSidebarActions.hide}
                      >
                          <i className="student icon"></i>
                          Help
      Severity: Major
      Found in app/js/components/menu/leftSidebar.jsx and 6 other locations - About 1 hr to fix
      app/js/components/menu/leftSidebar.jsx on lines 152..157
      app/js/components/menu/leftSidebar.jsx on lines 158..163
      app/js/components/menu/leftSidebar.jsx on lines 164..170
      app/js/components/menu/leftSidebar.jsx on lines 177..182
      app/js/components/menu/leftSidebar.jsx on lines 183..188
      app/js/components/menu/leftSidebar.jsx on lines 189..194

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

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

                      <a className="item" target="_blank" href="/changes.txt"
                          onClick={LeftSidebarActions.hide}
                      >
                          <i className="code icon"></i>
                          Changes Log
      Severity: Major
      Found in app/js/components/menu/leftSidebar.jsx and 6 other locations - About 1 hr to fix
      app/js/components/menu/leftSidebar.jsx on lines 152..157
      app/js/components/menu/leftSidebar.jsx on lines 164..170
      app/js/components/menu/leftSidebar.jsx on lines 171..176
      app/js/components/menu/leftSidebar.jsx on lines 177..182
      app/js/components/menu/leftSidebar.jsx on lines 183..188
      app/js/components/menu/leftSidebar.jsx on lines 189..194

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

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

                      <a className="item" target="_blank" href="/starmap/"
                          onClick={LeftSidebarActions.hide}
                      >
                          <i className="map icon"></i>
                          Alliance Map
      Severity: Major
      Found in app/js/components/menu/leftSidebar.jsx and 6 other locations - About 1 hr to fix
      app/js/components/menu/leftSidebar.jsx on lines 158..163
      app/js/components/menu/leftSidebar.jsx on lines 164..170
      app/js/components/menu/leftSidebar.jsx on lines 171..176
      app/js/components/menu/leftSidebar.jsx on lines 177..182
      app/js/components/menu/leftSidebar.jsx on lines 183..188
      app/js/components/menu/leftSidebar.jsx on lines 189..194

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

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

                      <a className="item" target="_blank" href="http://www.lacunaexpanse.com/terms/"
                          onClick={LeftSidebarActions.hide}
                      >
                          <i className="info circle icon"></i>
                          Terms of Service
      Severity: Major
      Found in app/js/components/menu/leftSidebar.jsx and 6 other locations - About 1 hr to fix
      app/js/components/menu/leftSidebar.jsx on lines 152..157
      app/js/components/menu/leftSidebar.jsx on lines 158..163
      app/js/components/menu/leftSidebar.jsx on lines 164..170
      app/js/components/menu/leftSidebar.jsx on lines 171..176
      app/js/components/menu/leftSidebar.jsx on lines 183..188
      app/js/components/menu/leftSidebar.jsx on lines 189..194

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

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

                      <a className="item" target="_blank" href="http://lacunaexpanse.com/tutorial/"
                          onClick={LeftSidebarActions.hide}
                      >
                          <i className="marker icon"></i>
                          Tutorial
      Severity: Major
      Found in app/js/components/menu/leftSidebar.jsx and 6 other locations - About 1 hr to fix
      app/js/components/menu/leftSidebar.jsx on lines 152..157
      app/js/components/menu/leftSidebar.jsx on lines 158..163
      app/js/components/menu/leftSidebar.jsx on lines 164..170
      app/js/components/menu/leftSidebar.jsx on lines 171..176
      app/js/components/menu/leftSidebar.jsx on lines 177..182
      app/js/components/menu/leftSidebar.jsx on lines 189..194

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

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

                      <a className="item" target="_blank" href="http://community.lacunaexpanse.com/wiki"
                          onClick={LeftSidebarActions.hide}
                      >
                          <i className="share alternate icon"></i>
                          Wiki
      Severity: Major
      Found in app/js/components/menu/leftSidebar.jsx and 6 other locations - About 1 hr to fix
      app/js/components/menu/leftSidebar.jsx on lines 152..157
      app/js/components/menu/leftSidebar.jsx on lines 158..163
      app/js/components/menu/leftSidebar.jsx on lines 164..170
      app/js/components/menu/leftSidebar.jsx on lines 171..176
      app/js/components/menu/leftSidebar.jsx on lines 177..182
      app/js/components/menu/leftSidebar.jsx on lines 183..188

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

      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

          handleSidebarShowing : function() {
              var el = this.refs.sidebar;
      
              $(el)
                  .sidebar(this.state.leftSidebar ? 'show' : 'hide');
      Severity: Minor
      Found in app/js/components/menu/leftSidebar.jsx and 1 other location - About 55 mins to fix
      app/js/components/menu/rightSidebar.jsx on lines 268..273

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

      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