jameshawkinsjr/hype

View on GitHub

Showing 78 of 78 total issues

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

                    <ul className="create-channel-user-list join-channel-user-list flex">
                        {   
                            this.state.users.map( user => {
                                if ( user.id === this.props.currentUser.id || user.full_name === "Hypebot"){
                                    return ""
Severity: Major
Found in frontend/components/chat/chatroom_add.jsx and 1 other location - About 2 days to fix
frontend/components/chat/chatroom_add.jsx on lines 177..205

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

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

                <ul className="join-channel-user-list flex">
                        {   
                            
                            this.state.users.map( user => {
                                if ( user.id === this.props.currentUser.id || user.full_name === "Hypebot"){
Severity: Major
Found in frontend/components/chat/chatroom_add.jsx and 1 other location - About 2 days to fix
frontend/components/chat/chatroom_add.jsx on lines 305..331

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

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

    render () {

        let errors = this.props.errors.map( error => 
            <li key={error}> {error} </li> 
            )
Severity: Major
Found in frontend/components/chat/chatroom_add.jsx - About 1 day to fix

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

                        { this.state.directMessageUsers.map ( user => ( 
                                <div key={`user3-${user}`} className="individual-user flex" onClick={ () => this.removeUser(user)}> 
                                    <span className="individual-user-box"> {user} </span> 
                                    <span className="individual-user-x"> <i className="fas fa-times"></i></span> 
                                    
    Severity: Major
    Found in frontend/components/chat/chatroom_add.jsx and 1 other location - About 4 hrs to fix
    frontend/components/chat/chatroom_add.jsx on lines 147..154

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

    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

                            { this.state.directMessageUsers.map ( user => ( 
                                <div key={`user4-${user}`} className="individual-user flex" onClick={ () => this.removeUser(user)}> 
                                    <span className="individual-user-box"> {user} </span> 
                                    <span className="individual-user-x"> <i className="fas fa-times"></i></span> 
                                    
    Severity: Major
    Found in frontend/components/chat/chatroom_add.jsx and 1 other location - About 4 hrs to fix
    frontend/components/chat/chatroom_add.jsx on lines 290..297

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    File chatroom_add.jsx has 339 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React from 'react';
    import { Link } from 'react-router-dom';
    import Cable from 'actioncable';
    
    
    
    Severity: Minor
    Found in frontend/components/chat/chatroom_add.jsx - About 4 hrs to fix

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

          render () {
      
              let channels = [];
              let directMessages = [];
              this.props.chatrooms.forEach( chatroom => {
      Severity: Major
      Found in frontend/components/chat/chatroom_list.jsx - About 3 hrs to fix

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

            render () {
        
                let errors = this.props.errors.map( error => 
                    <li key={error}> {error} </li> 
                    )
        Severity: Minor
        Found in frontend/components/chat/chatroom_add.jsx - About 3 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 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            render () {
                { document.title = `Where work happens | hype`}
                const navBar = this.props.currentUser ? (
                    <Link to="/chatrooms"><div className="landing-page-nav-button purple-button">YOUR CHANNELS</div></Link>
                ) : (
        Severity: Major
        Found in frontend/components/landing_page/landing_page.jsx - About 2 hrs to fix

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

              render () {
          
                  let errors = this.props.errors.map( error => 
                      <li key={error}> {error} </li> 
                      )
          Severity: Major
          Found in frontend/components/session/signup_form.jsx - About 2 hrs to fix

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

                                    <label className="last-label">
                                        <h3>Password (required)</h3>
                                        <input  type="password"
                                                className="input-outline"
                                                value={this.state.password}
            Severity: Major
            Found in frontend/components/session/signup_form.jsx and 1 other location - About 2 hrs to fix
            frontend/components/session/signup_form.jsx on lines 71..81

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

            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

                                    <label>
                                        <h3>Display Name (optional)</h3>
                                        <input  type="text"
                                                className="input-outline"
                                                value={this.state.alias}
            Severity: Major
            Found in frontend/components/session/signup_form.jsx and 1 other location - About 2 hrs to fix
            frontend/components/session/signup_form.jsx on lines 92..102

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

            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 usersErrorsReducer = (state = [], action) => {
                Object.freeze(state);
                switch (action.type) {
                    case RECEIVE_USER_ERRORS:
                        return action.errors;
            Severity: Major
            Found in frontend/reducers/errors/users_errors_reducer.js and 1 other location - About 2 hrs to fix
            frontend/reducers/errors/messages_errors_reducer.js on lines 4..18

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

            const messagesErrorsReducer = (state = [], action) => {
                Object.freeze(state);
                switch (action.type) {
                    case RECEIVE_MESSAGE_ERRORS: 
                        return action.errors;
            Severity: Major
            Found in frontend/reducers/errors/messages_errors_reducer.js and 1 other location - About 2 hrs to fix
            frontend/reducers/errors/users_errors_reducer.js on lines 5..19

            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

            Function submitDemo has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                submitDemo(){
            
                    let demoMessages = [
                        "You look nice today",
                        "Where are the TPS reports!!!!",
            Severity: Major
            Found in frontend/components/messages/message_window.jsx - About 2 hrs to fix

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

                  render () {
                      let errors = this.props.errors.map( error => 
                          <li key={error}> {error} </li> 
                          )
              
              
              Severity: Major
              Found in frontend/components/session/login_form.jsx - About 2 hrs to fix

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

                    render() {
                        let chatroomTitle = "";
                        let welcomeMessage = "";
                        if ( this.props.currentChatroom ) {
                            if (this.props.currentChatroom.chatroom_type == 'channel') {
                Severity: Minor
                Found in frontend/components/messages/message_window.jsx - About 1 hr to fix

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

                          let renderErrors = (
                              <div className="errors-box flex">
                                  <div className="error-red"><pre> </pre></div>
                                  <ul className="errors">
                                          { errors } 
                  Severity: Major
                  Found in frontend/components/session/login_form.jsx and 3 other locations - About 1 hr to fix
                  frontend/components/chat/chatroom_add.jsx on lines 132..139
                  frontend/components/messages/message_item_edit.jsx on lines 46..53
                  frontend/components/session/signup_form.jsx on lines 43..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 4 locations. Consider refactoring.
                  Open

                          let renderErrors = (
                              <div className="errors-box flex">
                                  <div className="error-red"><pre> </pre></div>
                                  <ul className="errors">
                                          { errors } 
                  Severity: Major
                  Found in frontend/components/chat/chatroom_add.jsx and 3 other locations - About 1 hr to fix
                  frontend/components/messages/message_item_edit.jsx on lines 46..53
                  frontend/components/session/login_form.jsx on lines 88..95
                  frontend/components/session/signup_form.jsx on lines 43..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 4 locations. Consider refactoring.
                  Open

                          let renderErrors = (
                              <div className="errors-box flex">
                                  <div className="error-red"><pre> </pre></div>
                                  <ul className="errors">
                                          { errors } 
                  Severity: Major
                  Found in frontend/components/messages/message_item_edit.jsx and 3 other locations - About 1 hr to fix
                  frontend/components/chat/chatroom_add.jsx on lines 132..139
                  frontend/components/session/login_form.jsx on lines 88..95
                  frontend/components/session/signup_form.jsx on lines 43..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

                  Severity
                  Category
                  Status
                  Source
                  Language