Lambda-School-Labs/grants-fe

View on GitHub

Showing 74 of 74 total issues

Function onboardingReducer has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const onboardingReducer = (state = initialState, action) => {
  switch (action.type) {
    case APPLICANT_ONBOARDING_POST_START:
      return {
        ...state,
Severity: Major
Found in src/store/reducers/onboardingReducer.js - About 3 hrs to fix

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

              <Grid item xs={10} sm={6}>
                <TextField
                  id="due_date"
                  label="Due Date"
                  type="date"
    src/components/applicant-profile/applicant-grants/UpdateGrant.js on lines 100..113

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

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

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

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

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

    Refactorings

    Further Reading

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

              <Grid item xs={10} sm={6}>
                <TextField
                  id="due_date"
                  label="Due Date"
                  type="date"
    src/components/applicant-profile/applicant-grants/GrantsForm.js on lines 87..100

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

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

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

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

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

    Refactorings

    Further Reading

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

              <Grid item xs={10} sm={9}>
                <TextAreaAutosize
                  required
                  id="grant_description"
                  name="description"
    src/components/applicant-profile/applicant-grants/UpdateGrant.js on lines 114..126

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

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

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

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

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

    Refactorings

    Further Reading

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

              <Grid item xs={10} sm={9}>
                <TextAreaAutosize
                  required
                  id="grant_description"
                  name="description"
    src/components/applicant-profile/applicant-grants/GrantsForm.js on lines 101..113

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

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

      const handleValidation = (e) => {
        // validation function handles all inputs where the only validation is that the string must be greater than 2
        const validator = (formValue) => {
          //persisting the event to ensure it makes it to validation
          e.persist();
    Severity: Major
    Found in src/components/WriterOnboardingForms/WriterProfileForm.js - About 3 hrs to fix

      Function WriterProfile has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const WriterProfile = (props) => {
        const dispatch = useDispatch();
        const classes = useStyles();
      
        //Redux
      Severity: Major
      Found in src/components/writer-profile/writerProfile.js - About 2 hrs to fix

        File WriterWorkCard.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { useState } from "react";
        import { useDispatch, useSelector } from "react-redux";
        import { useStyles } from "./WriterForm.styles";
        import Card from "@material-ui/core/Card";
        import CardContent from "@material-ui/core/CardContent";
        Severity: Minor
        Found in src/components/WriterOnboardingForms/WriterWorkCard.js - About 2 hrs to fix

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

            const handleValidation = (e) => {
              /* validation function handles all inputs where the only validation is that the string must be greater than 2 */
              const validator = async (formValue) => {
                /*persisting the event to ensure it makes it to validation */
                e.persist();
          Severity: Major
          Found in src/components/ApplicantOnboardingForm/ApplicantProfileForm.js - About 2 hrs to fix

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

            export default function ApplicantProfile() {
              const userType = useSelector((state) => state.login.usertype);
              const isEditing = useSelector((state) => state.profileInfo.isEditing);
              const applicantProfileId = useSelector((state) => state.login.userId);
              const applicantDetails = useSelector(
            Severity: Major
            Found in src/components/applicant-profile/ApplicantProfile.js - About 2 hrs to fix

              Function GrantsList has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function GrantsList() {
                const classes = useStyles();
              
                const grantsLoading = useSelector((state) => state.grants.isLoading);
                const grants = useSelector((state) => state.grants.applicantGrants);
              Severity: Major
              Found in src/components/applicant-profile/applicant-grants/GrantsList.js - About 2 hrs to fix

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

                  layout: {
                    width: "auto",
                    marginLeft: theme.spacing(2),
                    marginRight: theme.spacing(2),
                    [theme.breakpoints.up(600 + theme.spacing(2) * 2)]: {
                src/components/WriterOnboardingForms/WriterForm.styles.js on lines 21..30

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

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

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

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

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

                Refactorings

                Further Reading

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

                  layout: {
                    width: "auto",
                    marginLeft: theme.spacing(2),
                    marginRight: theme.spacing(2),
                    [theme.breakpoints.up(600 + theme.spacing(2) * 2)]: {
                Severity: Major
                Found in src/components/WriterOnboardingForms/WriterForm.styles.js and 1 other location - About 2 hrs to fix
                src/components/ApplicantOnboardingForm/ApplicantForm.styles.js on lines 17..26

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

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

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

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

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

                Refactorings

                Further Reading

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

                    boxes: {
                      backgroundColor: theme.palette.common.aqua,
                      display: "flex",
                      justifyContent: "center",
                      color: theme.palette.primary,
                Severity: Major
                Found in src/components/homepage/grantCards/GrantCardStyles.jsx and 1 other location - About 2 hrs to fix
                src/components/grantsPage/grantCards/GrantCardStyles.jsx on lines 58..69

                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

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

                    boxes: {
                      backgroundColor: theme.palette.common.aqua,
                      display: "flex",
                      justifyContent: "center",
                      color: theme.palette.primary,
                Severity: Major
                Found in src/components/grantsPage/grantCards/GrantCardStyles.jsx and 1 other location - About 2 hrs to fix
                src/components/homepage/grantCards/GrantCardStyles.jsx on lines 58..69

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

                const WriterServices = (props) => {
                  const [value, setValue] = React.useState(0);
                  const classes = useStyles();
                
                  const handleChange = (event, newValue) => {
                Severity: Major
                Found in src/components/writer-profile/WriterServices.js - About 2 hrs to fix

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

                        <div className={classes.userDisplay}>
                          <CardMedia
                            className={classes.media}
                            image="https://image.shutterstock.com/image-photo/young-scientist-looking-through-microscope-600w-524351890.jpg"
                            alt="userImg"
                  Severity: Major
                  Found in src/components/homepage/userCard/UserCardWriter.jsx and 1 other location - About 2 hrs to fix
                  src/components/homepage/userCard/UserCardApplicant.jsx 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 81.

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

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

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

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

                  Refactorings

                  Further Reading

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

                        <div className={classes.userDisplay}>
                          <CardMedia
                            className={classes.media}
                            image="https://image.shutterstock.com/image-photo/young-scientist-looking-through-microscope-600w-524351890.jpg"
                            alt="userImg"
                  Severity: Major
                  Found in src/components/homepage/userCard/UserCardApplicant.jsx and 1 other location - About 2 hrs to fix
                  src/components/homepage/userCard/UserCardWriter.jsx 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 81.

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

                  const favoritesReducer = (state = initialState, action) => {
                    switch (action.type) {
                      case FAVORITE_POST_START:
                        return {
                          ...state,
                  Severity: Major
                  Found in src/store/reducers/favoritesReducer.js - About 2 hrs to fix

                    File ApplicantProfileForm.js has 259 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import React, { useState, useEffect } from "react";
                    import { useHistory } from "react-router-dom";
                    import { useDispatch, useSelector } from "react-redux";
                    import { postApplicantOnboarding } from "../../store/actions/onboardingActions";
                    
                    
                    Severity: Minor
                    Found in src/components/ApplicantOnboardingForm/ApplicantProfileForm.js - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language