teamdigitale/italia-app

View on GitHub
ts/screens/profile/DeveloperModeSection.tsx

Summary

Maintainability
F
5 days
Test Coverage

File DeveloperModeSection.tsx has 567 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  ButtonSolid,
  ContentWrapper,
  Divider,
  H2,
Severity: Major
Found in ts/screens/profile/DeveloperModeSection.tsx - About 1 day to fix

    Function PlaygroundsSection has 106 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const PlaygroundsSection = () => {
      const dispatch = useIODispatch();
      const navigation = useIONavigation();
      const isIdPayTestEnabled = useIOSelector(isIdPayTestEnabledSelector);
      const isPagoPATestEnabled = useIOSelector(isPagoPATestEnabledSelector);
    Severity: Major
    Found in ts/screens/profile/DeveloperModeSection.tsx - About 4 hrs to fix

      Function DeveloperActionsSection has 102 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const DeveloperActionsSection = () => {
        const dispatch = useIODispatch();
      
        const handleClearCachePress = () => {
          Alert.alert(
      Severity: Major
      Found in ts/screens/profile/DeveloperModeSection.tsx - About 4 hrs to fix

        Function DeveloperDataSection has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const DeveloperDataSection = () => {
          const isFastLoginEnabled = useIOSelector(isFastLoginEnabledSelector);
          const sessionToken = useIOSelector(sessionTokenSelector);
          const walletToken = useIOSelector(walletTokenSelector);
          const { id: notificationId, token: notificationToken } = useIOSelector(
        Severity: Major
        Found in ts/screens/profile/DeveloperModeSection.tsx - About 3 hrs to fix

          Function DeveloperModeSection has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const DeveloperModeSection = () => {
            const { showModal } = React.useContext(LightModalContext);
            const dispatch = useIODispatch();
            const isDebugModeEnabled = useIOSelector(isDebugModeEnabledSelector);
          
          
          Severity: Minor
          Found in ts/screens/profile/DeveloperModeSection.tsx - About 1 hr to fix

            Function onPagoPAEnvironmentToggle has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const onPagoPAEnvironmentToggle = (enabled: boolean) => {
                if (enabled) {
                  Alert.alert(
                    I18n.t("profile.main.pagoPaEnvironment.alertConfirmTitle"),
                    I18n.t("profile.main.pagoPaEnvironment.alertConfirmMessage"),
            Severity: Minor
            Found in ts/screens/profile/DeveloperModeSection.tsx - About 1 hr to fix

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

              const DesignSystemSection = () => {
                const navigation = useIONavigation();
                const { themeType, setTheme } = useIOThemeContext();
              
                return (
              Severity: Minor
              Found in ts/screens/profile/DeveloperModeSection.tsx - About 1 hr to fix

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

                  return (
                    <FlatList
                      ListHeaderComponent={<ListItemHeader label="Playground" />}
                      scrollEnabled={false}
                      keyExtractor={(item: PlaygroundsNavListItem, index: number) =>
                Severity: Major
                Found in ts/screens/profile/DeveloperModeSection.tsx and 1 other location - About 4 hrs to fix
                ts/screens/profile/DeveloperModeSection.tsx on lines 280..294

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

                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

                  return (
                    <FlatList
                      ListHeaderComponent={<ListItemHeader label="Data" />}
                      scrollEnabled={false}
                      keyExtractor={(item: DevDataCopyListItem, index: number) =>
                Severity: Major
                Found in ts/screens/profile/DeveloperModeSection.tsx and 1 other location - About 4 hrs to fix
                ts/screens/profile/DeveloperModeSection.tsx on lines 427..441

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

                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

                    {
                      condition: isDevEnv && !!walletToken,
                      label: "Wallet token",
                      value: `${walletToken}`,
                      onPress: () => clipboardSetStringWithFeedback(`${walletToken}`)
                Severity: Major
                Found in ts/screens/profile/DeveloperModeSection.tsx and 1 other location - About 1 hr to fix
                ts/screens/profile/DeveloperModeSection.tsx on lines 218..223

                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

                    {
                      condition: isDevEnv && !!sessionToken,
                      label: "Session token",
                      value: `${sessionToken}`,
                      onPress: () => clipboardSetStringWithFeedback(`${sessionToken}`)
                Severity: Major
                Found in ts/screens/profile/DeveloperModeSection.tsx and 1 other location - About 1 hr to fix
                ts/screens/profile/DeveloperModeSection.tsx on lines 224..229

                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

                    {
                      condition: !!thumbprint,
                      label: "Thumbprint",
                      value: `${thumbprint}`,
                      onPress: () => clipboardSetStringWithFeedback(`${thumbprint}`)
                Severity: Minor
                Found in ts/screens/profile/DeveloperModeSection.tsx and 1 other location - About 50 mins to fix
                ts/screens/profile/DeveloperModeSection.tsx on lines 236..241

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

                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

                    {
                      condition: !!notificationToken,
                      label: "Notification token",
                      value: `${notificationToken}`,
                      onPress: () => clipboardSetStringWithFeedback(`${notificationToken}`)
                Severity: Minor
                Found in ts/screens/profile/DeveloperModeSection.tsx and 1 other location - About 50 mins to fix
                ts/screens/profile/DeveloperModeSection.tsx on lines 247..252

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

                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

                type DevDataCopyListItem = {
                  value: string;
                  condition?: boolean;
                } & Pick<
                  ComponentProps<typeof ListItemInfoCopy>,
                Severity: Minor
                Found in ts/screens/profile/DeveloperModeSection.tsx and 1 other location - About 40 mins to fix
                ts/screens/profile/DeveloperModeSection.tsx on lines 60..66

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

                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

                type PlaygroundsNavListItem = {
                  value: string;
                  condition?: boolean;
                } & Pick<
                  ComponentProps<typeof ListItemNav>,
                Severity: Minor
                Found in ts/screens/profile/DeveloperModeSection.tsx and 1 other location - About 40 mins to fix
                ts/screens/profile/DeveloperModeSection.tsx on lines 68..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 48.

                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

                    {
                      condition: isFastLoginEnabled,
                      label: "Fast Login",
                      value: `${isFastLoginEnabled}`,
                      onPress: () => clipboardSetStringWithFeedback(`${isFastLoginEnabled}`)
                Severity: Minor
                Found in ts/screens/profile/DeveloperModeSection.tsx and 1 other location - About 35 mins to fix
                ts/screens/profile/DeveloperModeSection.tsx on lines 230..235

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

                    {
                      condition: isDevEnv,
                      label: "Notification ID",
                      value: `${notificationId}`,
                      onPress: () => clipboardSetStringWithFeedback(`${notificationId}`)
                Severity: Minor
                Found in ts/screens/profile/DeveloperModeSection.tsx and 1 other location - About 35 mins to fix
                ts/screens/profile/DeveloperModeSection.tsx on lines 212..217

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

                  const renderDevDataCopyItem = ({
                    item: { label, value, onPress, testID, condition }
                  }: ListRenderItemInfo<DevDataCopyListItem>) => {
                    // If condition is either true or undefined, render the item
                    if (condition !== false) {
                Severity: Minor
                Found in ts/screens/profile/DeveloperModeSection.tsx and 1 other location - About 35 mins to fix
                ts/screens/profile/PrivacyMainScreen.tsx on lines 266..277

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

                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

                    {
                      value: I18n.t("profile.main.trial.titleSection"),
                      onPress: () =>
                        navigation.navigate(ROUTES.PROFILE_NAVIGATOR, {
                          screen: ROUTES.TRIALS_SYSTEM_PLAYGROUND
                Severity: Minor
                Found in ts/screens/profile/DeveloperModeSection.tsx and 1 other location - About 35 mins to fix
                ts/screens/profile/ProfileMainScreen.tsx on lines 86..92

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

                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

                There are no issues that match your filters.

                Category
                Status