CodeTheChangeUBC/sasc

View on GitHub

Showing 160 of 160 total issues

Function default has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function(ComposedComponent) {
    class AuthenticationForUser extends Component {
        static contextTypes = {
            router: React.PropTypes.object
        };
Severity: Minor
Found in client/src/Components/Auth/requireAuthUser.js - About 1 hr to fix

    Function renderLinks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        renderLinks() {
            if (this.props.auth !== "") {
                return [
                    <li className="nav-item" key={1}>
                        <Link className="nav-link" to="/account">
    Severity: Minor
    Found in client/src/Containers/Header/index.js - About 1 hr to fix

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

              var fields = {
                  nickname: nickname.trim(),
                  age: age.trim(),
                  gender: gender.trim(),
                  email: email.trim()
      Severity: Major
      Found in client/src/Containers/PreChatSurvey/index.js and 1 other location - About 1 hr to fix
      client/src/Containers/Sms/index.js on lines 56..61

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

      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

              } else if (this.props.auth === "user") {
                  return (
                      <div className="connect-to-chat" onClick={this.gotoChat}>
                          <div className="launch-chat" value="Launch Chat">
                              Launch Chat
      Severity: Major
      Found in client/src/Components/Button/LaunchChat.js and 1 other location - About 1 hr to fix
      client/src/Components/Button/LaunchChat.js on lines 45..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 56.

      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

              var fields = {
                  email: email.trim(),
                  twilioPhoneNumber: twilioPhoneNumber.trim(),
                  accountSid: accountSid.trim(),
                  authToken: authToken.trim()
      Severity: Major
      Found in client/src/Containers/Sms/index.js and 1 other location - About 1 hr to fix
      client/src/Containers/PreChatSurvey/index.js on lines 58..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 56.

      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

              } else {
                  return (
                      <div className="connect-to-chat" onClick={this.gotoSurvey}>
                          <div className="launch-chat" value="Launch Chat">
                              Launch Chat
      Severity: Major
      Found in client/src/Components/Button/LaunchChat.js and 1 other location - About 1 hr to fix
      client/src/Components/Button/LaunchChat.js on lines 37..45

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

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

          render() {
              return (
                  <div className="message-box" id="message-box">
                      {this.props.msgs.map(
                          ({
      Severity: Minor
      Found in client/src/Components/Chat/MessageBox.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                if (
                    !username ||
                    !nickname ||
                    !age ||
                    !gender ||
        Severity: Major
        Found in client/src/Containers/Register/index.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                      if (
                          !nickname ||
                          !age ||
                          !gender ||
                          !email ||
          Severity: Major
          Found in client/src/Containers/Account/index.js - About 1 hr to fix

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

            function mapDispatchToProps(dispatch) {
                return bindActionCreators(
                    {
                        addMessageToRoom: roomActions.addMessageToRoom,
                        connectToChat: chatActions.connectToChat,
            Severity: Minor
            Found in client/src/Containers/Chat/index.js and 1 other location - About 55 mins to fix
            client/src/Containers/RegisterCounsellor/index.js on lines 122..132

            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

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

            function mapDispatchToProps(dispatch) {
                return bindActionCreators(
                    {
                        signupCounsellor: authActions.signupCounsellor,
                        addCounsellor: counsellorActions.addCounsellor,
            Severity: Minor
            Found in client/src/Containers/RegisterCounsellor/index.js and 1 other location - About 55 mins to fix
            client/src/Containers/Chat/index.js on lines 123..133

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 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

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

                renderAlert() {
                    if (this.props.errorMessage) {
                        return <div className="error">{this.props.errorMessage}</div>;
                    }
                }
            Severity: Major
            Found in client/src/Containers/Register/index.js and 5 other locations - About 50 mins to fix
            client/src/Containers/Login/index.js on lines 46..50
            client/src/Containers/LoginCounsellor/index.js on lines 49..53
            client/src/Containers/PreChatSurvey/index.js on lines 74..78
            client/src/Containers/RegisterCounsellor/index.js on lines 29..33
            client/src/Containers/Sms/index.js on lines 68..72

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

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

                renderAlert() {
                    if (this.props.errorMessage) {
                        return <div className="error">{this.props.errorMessage}</div>;
                    }
                }
            Severity: Major
            Found in client/src/Containers/Sms/index.js and 5 other locations - About 50 mins to fix
            client/src/Containers/Login/index.js on lines 46..50
            client/src/Containers/LoginCounsellor/index.js on lines 49..53
            client/src/Containers/PreChatSurvey/index.js on lines 74..78
            client/src/Containers/Register/index.js on lines 128..132
            client/src/Containers/RegisterCounsellor/index.js on lines 29..33

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

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

                            <div className="login-as-counsellor">
                                <p>
                                    Are you a counsellor? Login{" "}
                                    <Link to="/signincounsellor">here</Link> as a
                                    counsellor.
            Severity: Major
            Found in client/src/Containers/Login/index.js and 2 other locations - About 50 mins to fix
            client/src/Containers/Account/index.js on lines 212..217
            client/src/Containers/Account/index.js on lines 250..255

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

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

                                <div className="change-your-password-here">
                                    <p>
                                        Change your password{" "}
                                        <Link to="/changepassword">here</Link>.
                                    </p>
            Severity: Major
            Found in client/src/Containers/Account/index.js and 2 other locations - About 50 mins to fix
            client/src/Containers/Account/index.js on lines 212..217
            client/src/Containers/Login/index.js on lines 64..70

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

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

                renderAlert() {
                    if (this.props.errorMessage) {
                        return <div className="error">{this.props.errorMessage}</div>;
                    }
                }
            Severity: Major
            Found in client/src/Containers/PreChatSurvey/index.js and 5 other locations - About 50 mins to fix
            client/src/Containers/Login/index.js on lines 46..50
            client/src/Containers/LoginCounsellor/index.js on lines 49..53
            client/src/Containers/Register/index.js on lines 128..132
            client/src/Containers/RegisterCounsellor/index.js on lines 29..33
            client/src/Containers/Sms/index.js on lines 68..72

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

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

                renderAlert() {
                    if (this.props.errorMessage) {
                        return <div className="error">{this.props.errorMessage}</div>;
                    }
                }
            Severity: Major
            Found in client/src/Containers/RegisterCounsellor/index.js and 5 other locations - About 50 mins to fix
            client/src/Containers/Login/index.js on lines 46..50
            client/src/Containers/LoginCounsellor/index.js on lines 49..53
            client/src/Containers/PreChatSurvey/index.js on lines 74..78
            client/src/Containers/Register/index.js on lines 128..132
            client/src/Containers/Sms/index.js on lines 68..72

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

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

                                <div className="change-your-password-here">
                                    <p>
                                        Change your password{" "}
                                        <Link to="/changepassword">here</Link>.
                                    </p>
            Severity: Major
            Found in client/src/Containers/Account/index.js and 2 other locations - About 50 mins to fix
            client/src/Containers/Account/index.js on lines 250..255
            client/src/Containers/Login/index.js on lines 64..70

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

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

                renderAlert() {
                    if (this.props.errorMessage) {
                        return <div className="error">{this.props.errorMessage}</div>;
                    }
                }
            Severity: Major
            Found in client/src/Containers/LoginCounsellor/index.js and 5 other locations - About 50 mins to fix
            client/src/Containers/Login/index.js on lines 46..50
            client/src/Containers/PreChatSurvey/index.js on lines 74..78
            client/src/Containers/Register/index.js on lines 128..132
            client/src/Containers/RegisterCounsellor/index.js on lines 29..33
            client/src/Containers/Sms/index.js on lines 68..72

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

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

                renderAlert() {
                    if (this.props.errorMessage) {
                        return <div className="error">{this.props.errorMessage}</div>;
                    }
                }
            Severity: Major
            Found in client/src/Containers/Login/index.js and 5 other locations - About 50 mins to fix
            client/src/Containers/LoginCounsellor/index.js on lines 49..53
            client/src/Containers/PreChatSurvey/index.js on lines 74..78
            client/src/Containers/Register/index.js on lines 128..132
            client/src/Containers/RegisterCounsellor/index.js on lines 29..33
            client/src/Containers/Sms/index.js on lines 68..72

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

            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