InsidersByte/honeymoon-gift-list

View on GitHub

Showing 276 of 276 total issues

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

export function loadSections() {
  return {
    [CALL_API]: {
      endpoint: 'section',
      method: HTTP_METHODS.GET,
Severity: Major
Found in public/actions/section.js and 3 other locations - About 1 hr to fix
public/actions/gift.js on lines 11..19
public/actions/weddingPartyMember.js on lines 11..19
public/actions/weddingProfile.js on lines 6..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 56.

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

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

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

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

Refactorings

Further Reading

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

export function loadGifts() {
  return {
    [CALL_API]: {
      endpoint: 'gift',
      method: HTTP_METHODS.GET,
Severity: Major
Found in public/actions/gift.js and 3 other locations - About 1 hr to fix
public/actions/section.js on lines 11..19
public/actions/weddingPartyMember.js on lines 11..19
public/actions/weddingProfile.js on lines 6..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 56.

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

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

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

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

Refactorings

Further Reading

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

export const error = ({ message }: { message: string }): ActionType => ({
  type: ERROR_NOTIFICATION,
  payload: { message },
});
Severity: Major
Found in public/redux/notifications.js and 1 other location - About 1 hr to fix
public/redux/notifications.js on lines 74..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 56.

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

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

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

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

Refactorings

Further Reading

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

function moveSections({ sections }, { payload: { sourceId, targetId } }) {
  return move({ sourceId, targetId, data: sections });
}
Severity: Major
Found in public/reducers/sections.js and 2 other locations - About 1 hr to fix
public/reducers/gifts.js on lines 12..14
public/reducers/weddingPartyMembers.js on lines 11..13

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

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

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

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

Refactorings

Further Reading

Function resetPassword has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    wrap(function* resetPassword(req, res) {
      req.checkBody('token').equals(req.params.token);
      req.checkBody('password', MINIMUM_PASSWORD_MESSAGE).isLength({ min: MINIMUM_PASSWORD_LENGTH });
      req.checkBody('confirmPassword').equals(req.body.confirmPassword);

Severity: Minor
Found in server/routes/api/authenticate.js - About 1 hr to fix

    Function authenticate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        wrap(function* authenticate(req, res) {
          req.checkBody('email').isEmail();
          req.checkBody('password').notEmpty();
    
          const errors = req.validationErrors();
    Severity: Minor
    Found in server/routes/api/authenticate.js - About 1 hr to fix

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

                  <TextField
                    name="surname"
                    floatingLabelText="Surname"
                    value={surname}
                    onChange={onChange}
      Severity: Major
      Found in public/components/GiverDetailsForm.jsx and 6 other locations - About 1 hr to fix
      public/components/GiverDetailsForm.jsx on lines 63..72
      public/components/GiverDetailsForm.jsx on lines 97..106
      public/components/SectionForm.jsx on lines 82..82
      public/components/SetupForm.jsx on lines 46..46
      public/components/SignUpForm.jsx on lines 51..51
      public/components/WeddingProfileForm.jsx on lines 118..127

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

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

                  <TextField
                    name="forename"
                    floatingLabelText="Forename"
                    value={forename}
                    onChange={onChange}
      Severity: Major
      Found in public/components/GiverDetailsForm.jsx and 6 other locations - About 1 hr to fix
      public/components/GiverDetailsForm.jsx on lines 74..83
      public/components/GiverDetailsForm.jsx on lines 97..106
      public/components/SectionForm.jsx on lines 82..82
      public/components/SetupForm.jsx on lines 46..46
      public/components/SignUpForm.jsx on lines 51..51
      public/components/WeddingProfileForm.jsx on lines 118..127

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

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

                  <TextField
                    name="phoneNumber"
                    floatingLabelText="Telephone Number"
                    value={phoneNumber}
                    onChange={onChange}
      Severity: Major
      Found in public/components/GiverDetailsForm.jsx and 6 other locations - About 1 hr to fix
      public/components/GiverDetailsForm.jsx on lines 63..72
      public/components/GiverDetailsForm.jsx on lines 74..83
      public/components/SectionForm.jsx on lines 82..82
      public/components/SetupForm.jsx on lines 46..46
      public/components/SignUpForm.jsx on lines 51..51
      public/components/WeddingProfileForm.jsx on lines 118..127

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

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

                <TextField
                  name="coverTitle"
                  floatingLabelText="Cover Title"
                  value={coverTitle}
                  onChange={onChange}
      Severity: Major
      Found in public/components/WeddingProfileForm.jsx and 6 other locations - About 1 hr to fix
      public/components/GiverDetailsForm.jsx on lines 63..72
      public/components/GiverDetailsForm.jsx on lines 74..83
      public/components/GiverDetailsForm.jsx on lines 97..106
      public/components/SectionForm.jsx on lines 82..82
      public/components/SetupForm.jsx on lines 46..46
      public/components/SignUpForm.jsx on lines 51..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 55.

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

                <TextField name="title" floatingLabelText="Title" value={title} onChange={onChange} fullWidth style={styles.input} disabled={saving} required />
      Severity: Major
      Found in public/components/SectionForm.jsx and 6 other locations - About 1 hr to fix
      public/components/GiverDetailsForm.jsx on lines 63..72
      public/components/GiverDetailsForm.jsx on lines 74..83
      public/components/GiverDetailsForm.jsx on lines 97..106
      public/components/SetupForm.jsx on lines 46..46
      public/components/SignUpForm.jsx on lines 51..51
      public/components/WeddingProfileForm.jsx on lines 118..127

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

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

              <TextField name="name" floatingLabelText="Name" value={name} onChange={onChange} fullWidth style={styles.input} disabled={saving} required />
      Severity: Major
      Found in public/components/SetupForm.jsx and 6 other locations - About 1 hr to fix
      public/components/GiverDetailsForm.jsx on lines 63..72
      public/components/GiverDetailsForm.jsx on lines 74..83
      public/components/GiverDetailsForm.jsx on lines 97..106
      public/components/SectionForm.jsx on lines 82..82
      public/components/SignUpForm.jsx on lines 51..51
      public/components/WeddingProfileForm.jsx on lines 118..127

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

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

              <TextField name="name" floatingLabelText="Name" value={name} onChange={onChange} fullWidth style={styles.input} disabled={saving} required />
      Severity: Major
      Found in public/components/SignUpForm.jsx and 6 other locations - About 1 hr to fix
      public/components/GiverDetailsForm.jsx on lines 63..72
      public/components/GiverDetailsForm.jsx on lines 74..83
      public/components/GiverDetailsForm.jsx on lines 97..106
      public/components/SectionForm.jsx on lines 82..82
      public/components/SetupForm.jsx on lines 46..46
      public/components/WeddingProfileForm.jsx on lines 118..127

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

      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('should singularise items if there is only one item in the basket', () => {
          const wrapper = shallow(<BasketSummary {...props} basketCount={1} />);
      
          expect(wrapper).toMatchSnapshot();
        });
      Severity: Minor
      Found in public/components/BasketSummary/index.test.jsx and 1 other location - About 55 mins to fix
      public/components/BasketSummary/index.test.jsx on lines 44..48

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 54.

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

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

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

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

      Refactorings

      Further Reading

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

          reduce<T>(fn: (value: T, node: this, index: number) => T, initialValue?: T): Array<T>;
      Severity: Minor
      Found in flow-typed/npm/enzyme_v2.3.x.js and 1 other location - About 55 mins to fix
      flow-typed/npm/enzyme_v2.3.x.js on lines 59..59

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 54.

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

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

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

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

      Refactorings

      Further Reading

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

        it('should render if the basket count is 0', () => {
          const wrapper = shallow(<BasketSummary {...props} basketCount={0} />);
      
          expect(wrapper).toMatchSnapshot();
        });
      Severity: Minor
      Found in public/components/BasketSummary/index.test.jsx and 1 other location - About 55 mins to fix
      public/components/BasketSummary/index.test.jsx on lines 38..42

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 54.

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

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

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

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

      Refactorings

      Further Reading

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

          reduceRight<T>(fn: (value: T, node: this, index: number) => T, initialValue?: T): Array<T>;
      Severity: Minor
      Found in flow-typed/npm/enzyme_v2.3.x.js and 1 other location - About 55 mins to fix
      flow-typed/npm/enzyme_v2.3.x.js on lines 58..58

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 54.

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

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

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

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

      Refactorings

      Further Reading

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

            expect(
              reducer({ ...initialState, isSaving: false, users: [{ id: 1 }] }, { type: 'our-wedding-heroes/users/CREATE_USER_SUCCESS', payload: { id: 2 } })
            ).toEqual({
              isLoading: false,
              isSaving: false,
      Severity: Minor
      Found in public/redux/users.test.js and 1 other location - About 55 mins to fix
      public/redux/users.test.js on lines 235..243

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 54.

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

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

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

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

      Refactorings

      Further Reading

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

            expect(
              reducer({ ...initialState, isDeleting: false, users: [{ id: 1 }] }, { type: 'our-wedding-heroes/users/DELETE_USER_REQUEST', payload: { id: 1 } })
            ).toEqual({
              isLoading: false,
              isSaving: false,
      Severity: Minor
      Found in public/redux/users.test.js and 1 other location - About 55 mins to fix
      public/redux/users.test.js on lines 192..200

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 54.

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

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

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

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

      Refactorings

      Further Reading

      Function exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = ({ express, secure }) => {
        const router = new express.Router();
      
        router
          .route('/')
      Severity: Minor
      Found in server/routes/api/gift.js - About 55 mins 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

      Severity
      Category
      Status
      Source
      Language