Lambda-School-Labs/kansha-fe

View on GitHub

Showing 187 of 187 total issues

Function TeamMemberList has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function TeamMemberList() {
    const [modal, setModal] = useState(false);
    const [teamDetails, setTeamDetails] = useState();
    const [filter, setFilter] = useState('');
    const [loadingState, setLoadingState] = useState(true);
Severity: Major
Found in src/components/AdminTeams/TeamMemberList.jsx - About 3 hrs to fix

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

                    <div className="name-container">
                        <input
                            className="formname"
                            placeholder="First Name"
                            name="first_name"
    Severity: Major
    Found in src/components/Onboarding/S4BUserUpload.jsx and 1 other location - About 3 hrs to fix
    src/components/UserUpload/SingleUser.jsx on lines 63..76

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

    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="name-container">
                        <input
                            className="formname"
                            placeholder="First Name"
                            name="first_name"
    Severity: Major
    Found in src/components/UserUpload/SingleUser.jsx and 1 other location - About 3 hrs to fix
    src/components/Onboarding/S4BUserUpload.jsx on lines 75..88

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

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

    export const App = () => {
        const [init, setInit] = useState({
            fetched: false,
            error: false,
            onboarding: false,
    Severity: Major
    Found in src/App.jsx - About 3 hrs to fix

      Function Profile has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function Profile() {
          const [badges, setBadges] = useState([]);
      
          const [profileData, setProfileData] = useState({});
          const { comments, profile, feed } = useSelector(({ liveFeed, user }) => ({
      Severity: Major
      Found in src/components/Profile/Profile.jsx - About 3 hrs to fix

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

            const [employee, setEmployee] = useState({
                first_name: '',
                last_name: '',
                email: '',
                job_title: '',
        Severity: Major
        Found in src/components/Onboarding/S4BUserUpload.jsx and 1 other location - About 3 hrs to fix
        src/components/UserUpload/SingleUser.jsx on lines 8..22

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

        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

            const [employee, setEmployee] = useState({
                first_name: '',
                last_name: '',
                email: '',
                job_title: '',
        Severity: Major
        Found in src/components/UserUpload/SingleUser.jsx and 1 other location - About 3 hrs to fix
        src/components/Onboarding/S4BUserUpload.jsx on lines 11..25

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

        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

            axiosWithAuth()
                .get('/reactions/' + id)
                .then(res => {
                    dispatch({
                        type: POST_DATA_LOAD_SUCCESS,
        Severity: Major
        Found in src/store/actions/feed-actions.js and 1 other location - About 3 hrs to fix
        src/store/actions/feed-actions.js on lines 44..55

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 102.

        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

            axiosWithAuth()
                .get('/comments/' + id)
                .then(res => {
                    dispatch({
                        type: POST_DATA_LOAD_SUCCESS,
        Severity: Major
        Found in src/store/actions/feed-actions.js and 1 other location - About 3 hrs to fix
        src/store/actions/feed-actions.js on lines 56..67

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

        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

            it('second onClick setsOpen', () => {
                const spy = jest.fn();
                const wrapper = shallow(<HamburgerMenu setOpen={spy} />);
        
                wrapper
        Severity: Major
        Found in src/tests/landing tests/HamburgerMenu.spec.js and 1 other location - About 3 hrs to fix
        src/tests/landing tests/HamburgerMenu.spec.js on lines 45..55

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 101.

        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

            it('second onClick setsOpen', () => {
                const spy = jest.fn();
                const wrapper = shallow(<HamburgerMenu setOpen={spy} />);
        
                wrapper
        Severity: Major
        Found in src/tests/landing tests/HamburgerMenu.spec.js and 1 other location - About 3 hrs to fix
        src/tests/landing tests/HamburgerMenu.spec.js on lines 33..43

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

        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="radio-div">
                                <input
                                    type="radio"
                                    ref={register({ required: true })}
                                    id="21100"
        Severity: Major
        Found in src/components/Onboarding/S2CreateAccount.jsx and 1 other location - About 3 hrs to fix
        src/components/Onboarding/S2CreateAccount.jsx on lines 104..115

        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

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

                            <div className="radio-div">
                                <input
                                    type="radio"
                                    ref={register({ required: true })}
                                    id="over100"
        Severity: Major
        Found in src/components/Onboarding/S2CreateAccount.jsx and 1 other location - About 3 hrs to fix
        src/components/Onboarding/S2CreateAccount.jsx on lines 91..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 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

        Function Onboarding has 80 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Onboarding() {
            const [user, setUser] = useState({
                first_name: '',
                last_name: '',
                email: '',
        Severity: Major
        Found in src/components/Onboarding/Onboarding.jsx - About 3 hrs to fix

          Function ListOfFeatures has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function ListOfFeatures() {
              return (
                  <section className="list-of-features-container">
                      <h2>Recognize, motivate, and track accomplishments.</h2>
                      <section>
          Severity: Major
          Found in src/components/Landing/ListOfFeatures.jsx - About 2 hrs to fix

            Function Feed has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const Feed = () => {
                const [selectedRec, setSelectedRec] = useState();
                const [badges, setBadges] = useState([]);
                const { feed, comments, reactions, profile } = useSelector(
                    ({ liveFeed, user }) => ({
            Severity: Major
            Found in src/components/Feed/index.jsx - About 2 hrs to fix

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

                                          <div>
                                              <input
                                                  type="radio"
                                                  id="manual"
                                                  name="drone2"
              Severity: Major
              Found in src/components/Onboarding/S4AUserUpload.jsx and 1 other location - About 2 hrs to fix
              src/components/Onboarding/S4AUserUpload.jsx on lines 87..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 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

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

                                          <div>
                                              <input
                                                  type="radio"
                                                  id="bulk"
                                                  name="drone2"
              Severity: Major
              Found in src/components/Onboarding/S4AUserUpload.jsx and 1 other location - About 2 hrs to fix
              src/components/Onboarding/S4AUserUpload.jsx on lines 71..85

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

              export const timeAgo = timestamp => {
                  // get time in milliseconds
                  const currentTime = new Date(Date.now()).getTime();
                  const eventTime = new Date(timestamp).getTime()
              
              
              Severity: Minor
              Found in src/utils/timeago.js - About 2 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 Reports has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function Reports() {
                  const [filter, setFilter] = useState('weeks');
              
                  const handleFilter = (e) => {
                      setFilter(e);
              Severity: Major
              Found in src/components/AdminDashboard/Reports.jsx - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language