Lambda-School-Labs/kansha-fe

View on GitHub

Showing 187 of 187 total issues

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

                <span className="previousarrow">
                    <i className="fas fa-arrow-left" />
                    <div onClick={handlePrevious}>
                        <p> Previous step</p>
                    </div>
Severity: Major
Found in src/components/Onboarding/S5AccountCustomization.jsx and 1 other location - About 1 hr to fix
src/components/Onboarding/S4AUserUpload.jsx on lines 111..116

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

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

function UserUpload() {
    const [user] = useState({
        first_name: '',
        last_name: '',
        email: '',
Severity: Minor
Found in src/components/UserUpload/UserUpload.jsx - About 1 hr to fix

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

            case FEED_EVENT_NEW_COMMENT:
                return {
                    ...state,
                    comments: {
                        ...state.comments,
    Severity: Major
    Found in src/store/reducers/feed-reducer.js and 1 other location - About 1 hr to fix
    src/store/reducers/feed-reducer.js on lines 130..140

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

    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

            case FEED_EVENT_NEW_REACTION:
                return {
                    ...state,
                    reactions: {
                        ...state.reactions,
    Severity: Major
    Found in src/store/reducers/feed-reducer.js and 1 other location - About 1 hr to fix
    src/store/reducers/feed-reducer.js on lines 141..151

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

    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

                        <input
                            className="formname"
                            ref={register({
                                required: true,
                            })}
    Severity: Major
    Found in src/components/Onboarding/S2CreateAccount.jsx and 2 other locations - About 1 hr to fix
    src/components/Onboarding/S2CreateAccount.jsx on lines 47..53
    src/components/Onboarding/S2CreateAccount.jsx on lines 57..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 61.

    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

                    <input
                        className="formname"
                        ref={register({ required: true })}
                        placeholder="Job Title"
                        name="job_title"
    Severity: Major
    Found in src/components/Onboarding/S2CreateAccount.jsx and 2 other locations - About 1 hr to fix
    src/components/Onboarding/S2CreateAccount.jsx on lines 37..45
    src/components/Onboarding/S2CreateAccount.jsx on lines 47..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 61.

    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

                        <input
                            className="formname"
                            ref={register({ required: true })}
                            placeholder="Last Name"
                            name="last_name"
    Severity: Major
    Found in src/components/Onboarding/S2CreateAccount.jsx and 2 other locations - About 1 hr to fix
    src/components/Onboarding/S2CreateAccount.jsx on lines 37..45
    src/components/Onboarding/S2CreateAccount.jsx on lines 57..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 61.

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

    export const orgReducer = (state = initialState, action) => {
        switch (action.type) {
            case ORG_UPDATE_LOGO_START:
                return {
                    ...state,
    Severity: Minor
    Found in src/store/reducers/org-reducer.js - About 1 hr to fix

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

                  case '/reports/top?type=recipient&limit=5&time=weeks':
                      return Promise.resolve({
                          data: {
                              count: 5,
                              employees: [
      Severity: Major
      Found in src/tests/adminDashboard tests/reports.spec.js and 1 other location - About 1 hr to fix
      src/tests/adminDashboard tests/reports.spec.js on lines 29..44

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

      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="bulk-template-download">
                      <Link
                          to="/files/bulk_employee_upload_template.csv"
                          target="_blank"
                          download>
      Severity: Major
      Found in src/components/Onboarding/S4CUserUpload.jsx and 1 other location - About 1 hr to fix
      src/components/UserUpload/BulkUser.jsx on lines 52..60

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

      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="bulk-template-download">
                      <Link
                          to="/files/bulk_employee_upload_template.csv"
                          target="_blank"
                          download>
      Severity: Major
      Found in src/components/UserUpload/BulkUser.jsx and 1 other location - About 1 hr to fix
      src/components/Onboarding/S4CUserUpload.jsx on lines 59..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 60.

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

      const DropDown = ({
          children,
          setSelection,
          id,
          placeholder,
      Severity: Minor
      Found in src/components/Onboarding/DropDown.jsx - About 1 hr 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

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

                  case '/reports/top?type=sender&limit=5&time=weeks':
                      return Promise.resolve({
                          data: {
                              count: 5,
                              employees: [
      Severity: Major
      Found in src/tests/adminDashboard tests/reports.spec.js and 1 other location - About 1 hr to fix
      src/tests/adminDashboard tests/reports.spec.js on lines 45..60

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

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

          const getCroppedImg = (image, crop, fileName) => {
              const canvas = document.createElement('canvas');
              const scaleX = image.naturalWidth / image.width;
              const scaleY = image.naturalHeight / image.height;
              canvas.width = crop.width;
      Severity: Minor
      Found in src/components/FileUpload/index.jsx - About 1 hr to fix

        Function timeAgo has 30 lines of code (exceeds 25 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 1 hr to fix

          Function LeadershipBoard has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function LeadershipBoard(props) {
              const [rank, setRank] = useState([]);
              const [count, setCount] = useState(0);
              const [limit, setLimit] = useState(5);
          
          
          Severity: Minor
          Found in src/components/AdminDashboard/reports/LeadershipBoard.jsx - About 1 hr to fix

            Function S1GetStarted has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function S1GetStarted() {
                return (
                    <div data-test="S1Component">
                        <h1>Getting Started</h1>
                        <h5>You're only a few steps away from getting started on Kansha</h5>
            Severity: Minor
            Found in src/components/Onboarding/S1GetStarted.jsx - About 1 hr to fix

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

                                  <Route
                                      path="/onboarding/step-3"
                                      render={props => (
                                          <S3LetsGetSetUp
                                              {...props}
              Severity: Major
              Found in src/components/Onboarding/Onboarding.jsx and 2 other locations - About 1 hr to fix
              src/components/Onboarding/Onboarding.jsx on lines 51..60
              src/components/Onboarding/Onboarding.jsx on lines 84..93

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

              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

                                  <Route
                                      path="/onboarding/step-2"
                                      render={props => (
                                          <S2CreateAccount
                                              {...props}
              Severity: Major
              Found in src/components/Onboarding/Onboarding.jsx and 2 other locations - About 1 hr to fix
              src/components/Onboarding/Onboarding.jsx on lines 61..70
              src/components/Onboarding/Onboarding.jsx on lines 84..93

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

              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

                                      <input
                                          value={filter}
                                          onChange={(event) => setFilter(event.target.value)}
                                          type="text"
                                          id="search"
              Severity: Major
              Found in src/components/AdminTeams/TeamMemberList.jsx and 1 other location - About 1 hr to fix
              src/components/AdminTeams/CreateTeam.jsx on lines 44..51

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

              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