teamdigitale/italia-app

View on GitHub

Showing 4,862 of 4,862 total issues

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

    expect(
      store.getState().features.idPay.code.enrollmentRequest
    ).toStrictEqual(pot.someError(undefined, error));
Severity: Major
Found in ts/features/idpay/code/store/__tests__/store.test.ts and 6 other locations - About 35 mins to fix
ts/features/euCovidCert/store/reducers/__test__/byAuthCode.test.ts on lines 81..83
ts/features/idpay/code/store/__tests__/store.test.ts on lines 82..84
ts/features/idpay/details/store/__test__/store.test.ts on lines 167..169
ts/features/idpay/wallet/store/reducers/__test__/reducer.test.ts on lines 142..149
ts/features/services/details/store/reducers/__tests__/servicePreference.test.ts on lines 83..87
ts/features/services/details/store/reducers/__tests__/servicePreference.test.ts on lines 126..130

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

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

          <Stack.Screen
            name={PN_ROUTES.MAIN}
            component={PnStackNavigator}
            options={{
              gestureEnabled: false,
Severity: Major
Found in ts/features/messages/navigation/MessagesNavigator.tsx and 5 other locations - About 35 mins to fix
ts/features/itwallet/navigation/ItwStackNavigator.tsx on lines 183..187
ts/features/itwallet/navigation/ItwStackNavigator.tsx on lines 189..193
ts/features/messages/navigation/MessagesNavigator.tsx on lines 45..52
ts/features/messages/navigation/MessagesNavigator.tsx on lines 67..74
ts/features/payments/onboarding/navigation/navigator.tsx on lines 22..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 47.

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

    expect(store.getState().features.idPay.code.code).toStrictEqual(
      pot.someError(tCode, error)
    );
Severity: Major
Found in ts/features/idpay/code/store/__tests__/store.test.ts and 6 other locations - About 35 mins to fix
ts/features/euCovidCert/store/reducers/__test__/byAuthCode.test.ts on lines 81..83
ts/features/idpay/code/store/__tests__/store.test.ts on lines 105..107
ts/features/idpay/details/store/__test__/store.test.ts on lines 167..169
ts/features/idpay/wallet/store/reducers/__test__/reducer.test.ts on lines 142..149
ts/features/services/details/store/reducers/__tests__/servicePreference.test.ts on lines 83..87
ts/features/services/details/store/reducers/__tests__/servicePreference.test.ts on lines 126..130

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

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

    <Stack.Screen
      name={PaymentsMethodDetailsRoutes.PAYMENT_METHOD_DETAILS_SCREEN}
      component={PaymentsMethodDetailsScreen}
      options={{ gestureEnabled: isGestureEnabled, headerShown: true }}
    />
Severity: Major
Found in ts/features/payments/details/navigation/navigator.tsx and 5 other locations - About 35 mins to fix
ts/features/payments/checkout/navigation/navigator.tsx on lines 24..31
ts/features/payments/checkout/navigation/navigator.tsx on lines 32..39
ts/features/payments/checkout/navigation/navigator.tsx on lines 49..56
ts/features/payments/checkout/navigation/navigator.tsx on lines 57..64
ts/features/payments/checkout/navigation/navigator.tsx on lines 65..72

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

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

    <Stack.Screen
      name={PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_OUTCOME}
      component={WalletPaymentOutcomeScreen}
      options={{
        gestureEnabled: isGestureEnabled,
Severity: Major
Found in ts/features/payments/checkout/navigation/navigator.tsx and 5 other locations - About 35 mins to fix
ts/features/payments/checkout/navigation/navigator.tsx on lines 24..31
ts/features/payments/checkout/navigation/navigator.tsx on lines 32..39
ts/features/payments/checkout/navigation/navigator.tsx on lines 49..56
ts/features/payments/checkout/navigation/navigator.tsx on lines 65..72
ts/features/payments/details/navigation/navigator.tsx on lines 19..23

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

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

    const h4RegularbluegreyLight = TestRenderer.create(
      <H4 weight={"Regular"} color={"bluegreyLight"}>
        Text
      </H4>
    ).toJSON();
Severity: Major
Found in ts/components/core/typography/__test__/typography.test.tsx and 5 other locations - About 35 mins to fix
ts/components/core/typography/__test__/typography.test.tsx on lines 38..42
ts/components/core/typography/__test__/typography.test.tsx on lines 80..84
ts/components/core/typography/__test__/typography.test.tsx on lines 94..98
ts/components/core/typography/__test__/typography.test.tsx on lines 124..128
ts/components/core/typography/__test__/typography.test.tsx on lines 130..134

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

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

    expect(
      store.getState().features.services.details.servicePreference
    ).toStrictEqual(
      pot.someError(servicePreferenceResponseSuccess, servicePreferenceError)
    );
ts/features/euCovidCert/store/reducers/__test__/byAuthCode.test.ts on lines 81..83
ts/features/idpay/code/store/__tests__/store.test.ts on lines 82..84
ts/features/idpay/code/store/__tests__/store.test.ts on lines 105..107
ts/features/idpay/details/store/__test__/store.test.ts on lines 167..169
ts/features/idpay/wallet/store/reducers/__test__/reducer.test.ts on lines 142..149
ts/features/services/details/store/reducers/__tests__/servicePreference.test.ts on lines 126..130

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

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

    expect(
      store.getState().features.services.details.servicePreference
    ).toStrictEqual(
      pot.someError(servicePreferenceResponseSuccess, servicePreferenceError)
    );
ts/features/euCovidCert/store/reducers/__test__/byAuthCode.test.ts on lines 81..83
ts/features/idpay/code/store/__tests__/store.test.ts on lines 82..84
ts/features/idpay/code/store/__tests__/store.test.ts on lines 105..107
ts/features/idpay/details/store/__test__/store.test.ts on lines 167..169
ts/features/idpay/wallet/store/reducers/__test__/reducer.test.ts on lines 142..149
ts/features/services/details/store/reducers/__tests__/servicePreference.test.ts on lines 83..87

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

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

    <Stack.Screen
      name={PaymentsOnboardingRoutes.PAYMENT_ONBOARDING_SELECT_METHOD}
      component={PaymentsOnboardingSelectMethodScreen}
      options={{ gestureEnabled: false, headerShown: true }}
    />
Severity: Major
Found in ts/features/payments/onboarding/navigation/navigator.tsx and 5 other locations - About 35 mins to fix
ts/features/itwallet/navigation/ItwStackNavigator.tsx on lines 183..187
ts/features/itwallet/navigation/ItwStackNavigator.tsx on lines 189..193
ts/features/messages/navigation/MessagesNavigator.tsx on lines 45..52
ts/features/messages/navigation/MessagesNavigator.tsx on lines 55..62
ts/features/messages/navigation/MessagesNavigator.tsx on lines 67..74

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

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

    const h5Regularblue = TestRenderer.create(
      <H5 weight={"Regular"} color={"blue"}>
        Text
      </H5>
    ).toJSON();
Severity: Major
Found in ts/components/core/typography/__test__/typography.test.tsx and 5 other locations - About 35 mins to fix
ts/components/core/typography/__test__/typography.test.tsx on lines 38..42
ts/components/core/typography/__test__/typography.test.tsx on lines 80..84
ts/components/core/typography/__test__/typography.test.tsx on lines 87..91
ts/components/core/typography/__test__/typography.test.tsx on lines 94..98
ts/components/core/typography/__test__/typography.test.tsx on lines 124..128

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

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

  const settingsActionInMessageSection: HeaderActionProps = useMemo(
    () => ({
      icon: "coggle",
      accessibilityLabel: I18n.t("global.buttons.settings"),
      onPress: navigateToSettingMainScreenFromMessageSection
Severity: Major
Found in ts/navigation/components/HeaderFirstLevelHandler.tsx and 5 other locations - About 35 mins to fix
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 164..171
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 182..189
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 201..210
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 227..234
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 236..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 47.

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

    const h4Regularwhite = TestRenderer.create(
      <H4 weight={"Regular"} color={"white"}>
        Text
      </H4>
    ).toJSON();
Severity: Major
Found in ts/components/core/typography/__test__/typography.test.tsx and 5 other locations - About 35 mins to fix
ts/components/core/typography/__test__/typography.test.tsx on lines 38..42
ts/components/core/typography/__test__/typography.test.tsx on lines 80..84
ts/components/core/typography/__test__/typography.test.tsx on lines 87..91
ts/components/core/typography/__test__/typography.test.tsx on lines 124..128
ts/components/core/typography/__test__/typography.test.tsx on lines 130..134

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

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

  it("should return the string as is if under the maximum length", () => {
    const input = "abcde";
    const result = trimAndLimitValue(input, 10);
    expect(result).toBe("abcde");
  });
Severity: Major
Found in ts/features/payments/checkout/utils/__tests__/index.test.ts and 5 other locations - About 35 mins to fix
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 4..8
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 10..14
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 22..26
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 28..32
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 34..38

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

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

  it("should return an empty string when input is an empty string", () => {
    const input = "";
    const result = trimAndLimitValue(input, 5);
    expect(result).toBe("");
  });
Severity: Major
Found in ts/features/payments/checkout/utils/__tests__/index.test.ts and 5 other locations - About 35 mins to fix
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 4..8
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 10..14
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 16..20
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 22..26
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 34..38

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

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

    expect(store.getState().features.idPay.initiative.timeline).toStrictEqual(
      pot.someUpdating(paginatedTimeline, paginatedTimeline)
    );
Severity: Major
Found in ts/features/idpay/details/store/__test__/store.test.ts and 6 other locations - About 35 mins to fix
ts/features/euCovidCert/store/reducers/__test__/byAuthCode.test.ts on lines 81..83
ts/features/idpay/code/store/__tests__/store.test.ts on lines 82..84
ts/features/idpay/code/store/__tests__/store.test.ts on lines 105..107
ts/features/idpay/wallet/store/reducers/__test__/reducer.test.ts on lines 142..149
ts/features/services/details/store/reducers/__tests__/servicePreference.test.ts on lines 83..87
ts/features/services/details/store/reducers/__tests__/servicePreference.test.ts on lines 126..130

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

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

    const h4Regularbluegrey = TestRenderer.create(
      <H4 weight={"Regular"} color={"bluegrey"}>
        Text
      </H4>
    ).toJSON();
Severity: Major
Found in ts/components/core/typography/__test__/typography.test.tsx and 5 other locations - About 35 mins to fix
ts/components/core/typography/__test__/typography.test.tsx on lines 38..42
ts/components/core/typography/__test__/typography.test.tsx on lines 87..91
ts/components/core/typography/__test__/typography.test.tsx on lines 94..98
ts/components/core/typography/__test__/typography.test.tsx on lines 124..128
ts/components/core/typography/__test__/typography.test.tsx on lines 130..134

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

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

    const h5Regularbluegrey = TestRenderer.create(
      <H5 weight={"Regular"} color={"bluegrey"}>
        Text
      </H5>
    ).toJSON();
Severity: Major
Found in ts/components/core/typography/__test__/typography.test.tsx and 5 other locations - About 35 mins to fix
ts/components/core/typography/__test__/typography.test.tsx on lines 38..42
ts/components/core/typography/__test__/typography.test.tsx on lines 80..84
ts/components/core/typography/__test__/typography.test.tsx on lines 87..91
ts/components/core/typography/__test__/typography.test.tsx on lines 94..98
ts/components/core/typography/__test__/typography.test.tsx on lines 130..134

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

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

  const settingsActionInServicesSection: HeaderActionProps = useMemo(
    () => ({
      icon: "coggle",
      accessibilityLabel: I18n.t("global.buttons.settings"),
      onPress: navigateToSettingsOrServicesPreferences
Severity: Major
Found in ts/navigation/components/HeaderFirstLevelHandler.tsx and 5 other locations - About 35 mins to fix
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 164..171
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 173..180
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 201..210
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 227..234
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 236..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 47.

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

  const helpAction: HeaderActionProps = useMemo(
    () => ({
      icon: "help",
      accessibilityLabel: I18n.t(
        "global.accessibility.contextualHelp.open.label"
Severity: Major
Found in ts/navigation/components/HeaderFirstLevelHandler.tsx and 5 other locations - About 35 mins to fix
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 164..171
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 173..180
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 182..189
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 227..234
ts/navigation/components/HeaderFirstLevelHandler.tsx on lines 236..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 47.

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

  it("should limit the string to the maximum length", () => {
    const input = "abcdefghij";
    const result = trimAndLimitValue(input, 5);
    expect(result).toBe("abcde");
  });
Severity: Major
Found in ts/features/payments/checkout/utils/__tests__/index.test.ts and 5 other locations - About 35 mins to fix
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 4..8
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 16..20
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 22..26
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 28..32
ts/features/payments/checkout/utils/__tests__/index.test.ts on lines 34..38

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

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