Showing 59 of 59 total issues

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

        <div id="storyListArea" className="panel-body row panel-collapse collapse">
          <ul className="nav nav-tabs" role="tablist">
            <li role="presentation" className="active">
              <a href="#grooming-list" aria-controls="home" role="tab" data-toggle="tab">Pending</a>
            </li>
Severity: Major
Found in client/app/bundles/Room/components/StoryListBox/mobile.jsx and 1 other location - About 2 days to fix
client/app/bundles/Room/components/StoryListBox/desktop.jsx on lines 91..108

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

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

        <div id="storyListArea" className="panel-body row">
          <ul className="nav nav-tabs" role="tablist">
            <li role="presentation" className="active">
              <a href="#grooming-list" aria-controls="home" role="tab" data-toggle="tab">Pending</a>
            </li>
Severity: Major
Found in client/app/bundles/Room/components/StoryListBox/desktop.jsx and 1 other location - About 2 days to fix
client/app/bundles/Room/components/StoryListBox/mobile.jsx on lines 81..98

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

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

          <div className="dropdown pull-right">
            <button className="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
              {currentRoleEmoji} &nbsp;{this.state.role} &nbsp;
              <span className="caret"></span>
            </button>
Severity: Major
Found in client/app/bundles/Room/components/StatusBar/desktop.jsx and 1 other location - About 1 day to fix
client/app/bundles/Room/components/StatusBar/mobile.jsx on lines 143..151

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

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

            <div className="dropdown col-md-6 col-xs-6">
              <button className="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                {currentRoleEmoji} &nbsp;{this.state.role} &nbsp;
                <span className="caret"></span>
              </button>
Severity: Major
Found in client/app/bundles/Room/components/StatusBar/mobile.jsx and 1 other location - About 1 day to fix
client/app/bundles/Room/components/StatusBar/desktop.jsx on lines 153..161

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

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

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

  loadStoryListFromServer = () => {
    $.ajax({
      url: `/rooms/${this.props.roomId}/story_list.json`,
      dataType: 'json',
      cache: false,
Severity: Major
Found in client/app/bundles/Room/components/StoryListBox/desktop.jsx and 1 other location - About 7 hrs to fix
client/app/bundles/Room/components/StoryListBox/mobile.jsx on lines 14..34

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

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

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

  loadStoryListFromServer = () => {
    $.ajax({
      url: `/rooms/${this.props.roomId}/story_list.json`,
      dataType: 'json',
      cache: false,
Severity: Major
Found in client/app/bundles/Room/components/StoryListBox/mobile.jsx and 1 other location - About 7 hrs to fix
client/app/bundles/Room/components/StoryListBox/desktop.jsx on lines 15..35

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

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

  beWatcher = () => {
    if ("Watcher" === this.state.role || 'Moderator' === this.state.role)
      return

    $.ajax({
Severity: Major
Found in client/app/bundles/Room/components/StatusBar/desktop.jsx and 3 other locations - About 5 hrs to fix
client/app/bundles/Room/components/StatusBar/desktop.jsx on lines 70..86
client/app/bundles/Room/components/StatusBar/mobile.jsx on lines 37..53
client/app/bundles/Room/components/StatusBar/mobile.jsx on lines 55..71

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

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

  beWatcher = () => {
    if ("Watcher" === this.state.role || 'Moderator' === this.state.role)
      return

    $.ajax({
Severity: Major
Found in client/app/bundles/Room/components/StatusBar/mobile.jsx and 3 other locations - About 5 hrs to fix
client/app/bundles/Room/components/StatusBar/desktop.jsx on lines 52..68
client/app/bundles/Room/components/StatusBar/desktop.jsx on lines 70..86
client/app/bundles/Room/components/StatusBar/mobile.jsx on lines 55..71

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

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

  beParticipant = () => {
    if ("Participant" === this.state.role || 'Moderator' === this.state.role)
      return

    $.ajax({
Severity: Major
Found in client/app/bundles/Room/components/StatusBar/desktop.jsx and 3 other locations - About 5 hrs to fix
client/app/bundles/Room/components/StatusBar/desktop.jsx on lines 52..68
client/app/bundles/Room/components/StatusBar/mobile.jsx on lines 37..53
client/app/bundles/Room/components/StatusBar/mobile.jsx on lines 55..71

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

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

  beParticipant = () => {
    if ("Participant" === this.state.role || 'Moderator' === this.state.role)
      return

    $.ajax({
Severity: Major
Found in client/app/bundles/Room/components/StatusBar/mobile.jsx and 3 other locations - About 5 hrs to fix
client/app/bundles/Room/components/StatusBar/desktop.jsx on lines 52..68
client/app/bundles/Room/components/StatusBar/desktop.jsx on lines 70..86
client/app/bundles/Room/components/StatusBar/mobile.jsx on lines 37..53

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

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

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

  render() {
    const emailForm = () => {
      const emailFields = this.state.emails.map((email, index) => {
        return(
          <div className="row" key={`${email}-${index}`}>
Severity: Major
Found in client/app/bundles/Room/components/Invitation/index.jsx - About 4 hrs to fix

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

      render() {
        let onClickName;
        let buttonText;
        let buttonHtml;
        let secondButtonText;
    Severity: Major
    Found in client/app/bundles/Room/components/ActionBox/ActionBox.jsx - About 4 hrs to fix

      Class RoomsController has 32 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class RoomsController < ApplicationController
      
        include Premium
      
        before_action :guest_check, only: [:show, :leaflet_view]
      Severity: Minor
      Found in app/controllers/rooms_controller.rb - About 4 hrs to fix

        Class Room has 31 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class Room < ApplicationRecord
        
          include UidGeneration
          include PgSearch::Model
          multisearchable :against => [:name], :unless => :discarded_at?
        Severity: Minor
        Found in app/models/room.rb - About 3 hrs to fix

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

            render() {
              const roomStatusButton = (() => {
                if ('Moderator' === this.state.role) {
                  return (
                    <a onClick={this.closeRoom}>🏁 Close</a>
          Severity: Major
          Found in client/app/bundles/Room/components/StatusBar/mobile.jsx - About 3 hrs to fix

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

              render() {
                const roomStatusButton = (() => {
                  if ('Moderator' === this.state.role) {
                    return (
                      <button type="button" onClick={this.closeRoom} className="btn btn-default close-room">🏁 Close room</button>
            Severity: Major
            Found in client/app/bundles/Room/components/StatusBar/desktop.jsx - About 2 hrs to fix

              Function handleMessage has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

              function handleMessage(data) {
                // console.dir(data)
                if (data.type === 'action') {
                  if (data.data === 'open') {
                    RoomActions.showResultSection()
              Severity: Minor
              Found in client/app/libs/adapter.js - About 2 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                render() {
                  // TODO
                  // Gotta find out why it could be null sometimes
                  if (!this.state.data) {
                    return null

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

                  render() {
                    let onClickName;
                    let buttonText;
                    let buttonHtml;
                    let secondButtonText;
                Severity: Minor
                Found in client/app/bundles/Room/components/ActionBox/ActionBox.jsx - About 2 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                  componentDidMount() {
                    this.loadPeopleListFromServer()
                    EventEmitter.subscribe("refreshUsers", this.loadPeopleListFromServer)
                
                    this.props.addSteps({
                Severity: Major
                Found in client/app/bundles/Room/components/PeopleListBox.jsx and 1 other location - About 2 hrs to fix
                client/app/bundles/Room/components/StoryListBox/mobile.jsx on lines 44..55

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

                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