Showing 59 of 59 total issues

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

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

  componentDidMount() {
    this.loadStoryListFromServer()
    EventEmitter.subscribe("refreshStories", this.loadStoryListFromServer)

    this.props.addSteps({
Severity: Major
Found in client/app/bundles/Room/components/StoryListBox/mobile.jsx and 1 other location - About 2 hrs to fix
client/app/bundles/Room/components/PeopleListBox.jsx on lines 30..41

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

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

  sync = () => {
    const extensionCheckElement = document.getElementById("browser-extension-check")
    if(typeof(extensionCheckElement) === 'undefined' || extensionCheckElement === null || extensionCheckElement.innerText.length <= 0) {
      window.open("/extensions", "_blank")
    }
Severity: Major
Found in client/app/bundles/Room/components/StoryListBox/desktop.jsx and 1 other location - About 1 hr to fix
client/app/bundles/Room/components/Board.jsx on lines 34..39

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

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

  clearVotes = () => {
    if (this.props.role === 'Moderator') {
      Messenger.publish('clear_votes', {
        roomId: this.props.roomId,
        data: { story_id: this.props.storyId }
Severity: Major
Found in client/app/bundles/Room/components/ActionBox/ActionBox.jsx and 1 other location - About 1 hr to fix
client/app/bundles/Room/components/Person.jsx on lines 8..15

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

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

  handleSync = () => {
    const extensionCheckElement = document.getElementById("browser-extension-check")
    if(typeof(extensionCheckElement) === 'undefined' || extensionCheckElement === null || extensionCheckElement.innerText.length <= 0) {
      window.open("/extensions", "_blank")
    }
Severity: Major
Found in client/app/bundles/Room/components/Board.jsx and 1 other location - About 1 hr to fix
client/app/bundles/Room/components/StoryListBox/desktop.jsx on lines 45..50

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

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

  remove = () => {
    if (this.props.role === 'Moderator') {
      Messenger.publish('remove_person', {
        roomId: this.props.roomId,
        data: { user_id: this.props.id }
Severity: Major
Found in client/app/bundles/Room/components/Person.jsx and 1 other location - About 1 hr to fix
client/app/bundles/Room/components/ActionBox/ActionBox.jsx on lines 56..63

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

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 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const editLink = (() => {
      let icon, text
      if (this.state.editable) {
        icon = "fa-check"
Severity: Minor
Found in client/app/bundles/Room/components/PeopleListBox.jsx - About 1 hr to fix

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

      render() {
        const roomStatusButton = (() => {
          if ('Moderator' === this.state.role) {
            return (
              <a onClick={this.closeRoom}>🏁 Close</a>
    Severity: Minor
    Found in client/app/bundles/Room/components/StatusBar/mobile.jsx - About 1 hr 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

    Method find_for_oauth has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

      def self.find_for_oauth(auth, signed_in_resource = nil)
        # Get the identity and user if they exist
        identity = Authorization.find_for_oauth(auth)
    
        # If a signed_in_resource is provided it always overrides the existing user
    Severity: Minor
    Found in app/models/user.rb - About 1 hr 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 a Cognitive Complexity of 14 (exceeds 5 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: Minor
    Found in client/app/bundles/Room/components/StatusBar/desktop.jsx - About 1 hr 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 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        const that = this;
        let revoteIcon;
        let liElementClass;
        revoteIcon = (() => {
    Severity: Minor
    Found in client/app/bundles/Room/components/Story.jsx - About 1 hr to fix

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

        render() {
          const defaultArray = [];
          const ticketHeading = (() => {
            if (this.state.data.ungroomed && this.state.data.ungroomed.length) {
              return this.state.data.ungroomed[0].link
      Severity: Minor
      Found in client/app/bundles/Room/components/StoryListBox/mobile.jsx - About 1 hr to fix

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

            const currentRoleEmoji = (() => {
              if ("Moderator" === this.state.role) {
                return "πŸ‘‘";
              } else if ("Participant" === this.state.role) {
                return "πŸ‘·";
        Severity: Major
        Found in client/app/bundles/Room/components/StatusBar/desktop.jsx and 1 other location - About 1 hr to fix
        client/app/bundles/Room/components/StatusBar/mobile.jsx on lines 119..127

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

        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

            const currentRoleEmoji = (() => {
              if ("Moderator" === this.state.role) {
                return "πŸ‘‘";
              } else if ("Participant" === this.state.role) {
                return "πŸ‘·";
        Severity: Major
        Found in client/app/bundles/Room/components/StatusBar/mobile.jsx and 1 other location - About 1 hr to fix
        client/app/bundles/Room/components/StatusBar/desktop.jsx on lines 130..138

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

        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 emailForm has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

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

            render() {
              const defaultArray = []
              const syncLink = (() => {
                if (this.props.role === "Moderator") {
                  return(
          Severity: Minor
          Found in client/app/bundles/Room/components/StoryListBox/desktop.jsx - About 1 hr to fix

            Function handleMessage has 34 lines of code (exceeds 25 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 1 hr to fix

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

                render() {
                  const accessoryLabel = ((() => {
                    if (this.props.editable && this.props.currentUserId !== this.props.id) {
                      return(
                        <span className="accessory pull-right" onClick={this.remove}>
              Severity: Minor
              Found in client/app/bundles/Room/components/Person.jsx - About 1 hr to fix

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

                    const userRoleClassName = role => {
                      // Dont allow moderator to switch role at the moment
                      if (role === this.state.role || "Moderator" === this.state.role) {
                        return "disabled";
                      } else {
                Severity: Major
                Found in client/app/bundles/Room/components/StatusBar/mobile.jsx and 1 other location - About 1 hr to fix
                client/app/bundles/Room/components/StatusBar/desktop.jsx on lines 121..128

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

                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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                  render() {
                    const emailForm = () => {
                      const emailFields = this.state.emails.map((email, index) => {
                        return(
                          <div className="row" key={`${email}-${index}`}>
                Severity: Minor
                Found in client/app/bundles/Room/components/Invitation/index.jsx - About 1 hr 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

                Severity
                Category
                Status
                Source
                Language