DDCreationStudios/votingApp

View on GitHub

Showing 55 of 55 total issues

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

  polls: PropTypes.arrayOf(
        PropTypes.shape({
  question: PropTypes.string.isRequired,
  answers: PropTypes.arrayOf(
                PropTypes.shape({
Severity: Major
Found in src/components/singlePollPage/SinglePollCon.js and 4 other locations - About 2 hrs to fix
src/components/App.js on lines 48..58
src/components/pollsPage/OnePoll.js on lines 29..39
src/components/pollsPage/Polls.js on lines 70..80
src/components/singlePollPage/SinglePoll.js on lines 96..106

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

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

const NewAnswer = (props) => {
  const answerList = props.state.answers.map((aw, ind) =>
    (<div className="input-field col s10" key={ind}>
      <i className="material-icons prefix">queue</i>
      <input
Severity: Major
Found in src/components/singlePollPage/NewAnswer.js - About 2 hrs to fix

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

    export function logoutUser() {
      return dispatch =>
            axios
                .get('/api/logout')
                .then((res) => {
    Severity: Major
    Found in src/ducks/user.js and 1 other location - About 2 hrs to fix
    src/ducks/user.js on lines 53..64

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

    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 devConfig = {
      MONGO_URL: `mongodb://${process.env.DB_USER}:${process.env
            .DB_PASS}@ds141368.mlab.com:41368/votingapp`,
      TWITTER_STRATEGY: {
        consumerKey: process.env.TWITTER_CONSUMER_KEY,
    Severity: Major
    Found in src/serverSideES6/config/constants.js and 1 other location - About 2 hrs to fix
    src/serverSideES6/config/constants.js on lines 15..24

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

    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

    export function fetchUser() {
      return dispatch =>
            axios
                .get('/api/profile')
                .then((res) => {
    Severity: Major
    Found in src/ducks/user.js and 1 other location - About 2 hrs to fix
    src/ducks/user.js on lines 66..77

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

    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 prodConfig = {
      MONGO_URL: `mongodb://${process.env.DB_USER}:${process.env
            .DB_PASS}@ds141368.mlab.com:41368/votingapp`,
      TWITTER_STRATEGY: {
        consumerKey: process.env.TWITTER_CONSUMER_KEY,
    Severity: Major
    Found in src/serverSideES6/config/constants.js and 1 other location - About 2 hrs to fix
    src/serverSideES6/config/constants.js on lines 5..14

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

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

      render() {
        return (
          <div>
            <div className="parallax-container" style={{ height: '250px' }}>
              <div className="parallax">
    Severity: Major
    Found in src/components/homePage/Home.js - About 2 hrs to fix

      Function NewPoll has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const NewPoll = (props) => {
        const answerList = props.state.answers.map((aw, ind) =>
          (<div className="input-field col s10" key={ind}>
            <i className="material-icons prefix">queue</i>
            <input
      Severity: Major
      Found in src/components/pollsPage/NewPoll.js - About 2 hrs to fix

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

        export default function Polls(state = [], action) {
          switch (action.type) {
            case FETCHED_POLLS:
              return action.polls;
            case ADD_POLL: {
        Severity: Major
        Found in src/ducks/polls.js - About 2 hrs to fix

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

                  <div className="parallax-container" style={{ height: '150px' }}>
          
                    <div className="parallax">
                      <img className="responsive-img" src="./img/parallax2.jpg" alt="img" />
                    </div>
          Severity: Major
          Found in src/components/homePage/Home.js and 1 other location - About 1 hr to fix
          src/components/homePage/Home.js on lines 14..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 71.

          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="parallax-container" style={{ height: '250px' }}>
                    <div className="parallax">
                      <img className="responsive-img" src="./img/parallax1.jpg" alt="img" />
                    </div>
                  </div>
          Severity: Major
          Found in src/components/homePage/Home.js and 1 other location - About 1 hr to fix
          src/components/homePage/Home.js on lines 70..75

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

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

            render() {
              const { user, login, logoutUser } = this.props;
          
              const renderComponent = () => {
                if (user.loggedIn) {
          Severity: Minor
          Found in src/components/sidebar/Sidebar.js - About 1 hr to fix

            Function condRender has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const condRender = () => {
                if (props.state.fetched) {
                  return (
                    <div>
                      <div className="row">
            Severity: Minor
            Found in src/components/singlePollPage/SinglePoll.js - About 1 hr to fix

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

                {
                  _id: {
                    $oid: 'ID2',
                  },
                  question: 'Is this the 2 question?',
              Severity: Major
              Found in src/data/ExampleData.js and 2 other locations - About 1 hr to fix
              src/data/ExampleData.js on lines 2..14
              src/data/ExampleData.js on lines 28..49

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

              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

                {
                  _id: {
                    $oid: '595f8717734d1d256342d428',
                  },
                  question: 'Is this the 3 question?',
              Severity: Major
              Found in src/data/ExampleData.js and 2 other locations - About 1 hr to fix
              src/data/ExampleData.js on lines 2..14
              src/data/ExampleData.js on lines 15..27

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

              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

                {
                  _id: {
                    $oid: 'ID1',
                  },
                  question: 'Is this the 1 question?',
              Severity: Major
              Found in src/data/ExampleData.js and 2 other locations - About 1 hr to fix
              src/data/ExampleData.js on lines 15..27
              src/data/ExampleData.js on lines 28..49

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

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

                render() {
                  const renderComponent = (props) => {
                    if (props.user.loggedIn) {
                      return (
                        <a
              Severity: Minor
              Found in src/components/common/Header.js - About 1 hr to fix

                Function Poll has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const Poll = (props) => {
                  const locateVote = (a, b) => {
                    answerId = a;
                    vote = b;
                  };
                Severity: Minor
                Found in src/components/singlePollPage/Poll.js - About 1 hr to fix

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

                    poll: PropTypes.shape({
                      question: PropTypes.string,
                      answers: PropTypes.arrayOf(
                              PropTypes.shape({
                    answer: PropTypes.string,
                  Severity: Major
                  Found in src/components/singlePollPage/NewAnswer.js and 1 other location - About 1 hr to fix
                  src/components/singlePollPage/SinglePoll.js on lines 109..117

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

                    render() {
                      return (
                        <div className="container-fluid grey darken-2">
                          <h1 className="teal-text container">404! Now dat site does not exist my friend!</h1>
                          <h4 className="teal-text container">
                  Severity: Minor
                  Found in src/components/Lost.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language