SDP-GeoHunt/geo-hunt

View on GitHub

Showing 168 of 168 total issues

Method TeamSelector has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    name: String,
    users: List<User>? = listOf(),
    onAction: () -> Unit = {},
    disabled: Boolean = false,
    isUserInside: Boolean = false,

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

        // Bounties challenges
        private val _bountyChallenges: MutableStateFlow<Map<String, List<Challenge>>> = MutableStateFlow(mapOf())
    app/src/main/java/com/github/geohunt/app/ui/screens/bounty_team_select/BountyTeamSelectViewModel.kt on lines 54..54

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

    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

        private val _users: MutableStateFlow<Map<String, List<User>>> = MutableStateFlow(mapOf())
    app/src/main/java/com/github/geohunt/app/ui/screens/home/BountyFeedViewModel.kt on lines 35..36

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

    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

                        HomeScreenFeed.Discover -> ChallengeFeed(
                            chosenFeed = feed,
                            onUserClick = onUserClick,
                            onOpenMap = onOpenMap,
                            onOpenChallenge = onOpenChallenge,
    app/src/main/java/com/github/geohunt/app/ui/screens/teamprogress/TeamProgressScreenContent.kt on lines 57..67

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 78.

    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

                    SettingsMenuLinkQuick(stringResource(id = R.string.app_settings), Icons.Default.Settings)
                        { navigate(SecondaryScreen.AppSettings) }
    app/src/main/java/com/github/geohunt/app/ui/settings/SettingsPage.kt on lines 42..43

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 78.

    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

            topBar = { TeamProgressTopAppBar(
                // Try to limit team name to 20 characters, otherwise it is truncated in the app bar,
                // which is generally bad UX. The current work-around is to have ellipsis (...)
                // when the team name is too long.
                teamName = teamName,
    app/src/main/java/com/github/geohunt/app/ui/screens/home/HomeScreen.kt on lines 34..41

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

    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

                    SettingsMenuLinkQuick(stringResource(id = R.string.privacy_settings), Icons.Default.Shield)
                        { navigate(SecondaryScreen.PrivacySettings) }
    app/src/main/java/com/github/geohunt/app/ui/settings/SettingsPage.kt on lines 39..40

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

    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

        /**
         * Asks the auth repository to logout
         */
        fun logout(a: ComponentActivity, then: () -> Unit) {
            viewModelScope.launch {
    app/src/main/java/com/github/geohunt/app/ui/screens/login/LoginViewModel.kt on lines 92..103

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

    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

        /**
         * Accepts the given Identity Provider (Idp) response and calls the given callback.
         *
         * @param response The response given by [registerLoginPrompt]'s `onSuccess` argument.
         * @param andThen The callback used after the response is correctly processed.
    app/src/main/java/com/github/geohunt/app/ui/screens/main/MainViewModel.kt on lines 42..50

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

    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

        private fun fetchLocation() {
            viewModelScope.launch {
                locationRepository.getLocations(viewModelScope).collect {
                    _userLocation.value = it
                }
    app/src/main/java/com/github/geohunt/app/ui/screens/teamprogress/TeamProgressViewModel.kt on lines 110..116

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 76.

    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

        private fun fetchLocation() {
            viewModelScope.launch {
                locationRepository.getLocations(viewModelScope).collect {
                    _currentLocation.value = it
                }
    app/src/main/java/com/github/geohunt/app/ui/screens/home/HomeFeedViewModel.kt on lines 137..143

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

    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

    Method BountyChallengeCard has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        challenge: Challenge?,
        currentLocation: Location?,
        onClaim: (Challenge) -> Unit,
        isEnabled: Boolean,
        isClaimed: Boolean,

      Method TeamProgressScreen has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          onBack: () -> Unit,
          onLeaderboard: () -> Unit,
          onChat: () -> Unit,
          onClaim: (Challenge) -> Unit,
          bountyId: String,

        Method SettingsListDropdownQuick has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            title: String,
            items: List<String>,
            value: Int,
            icon: ImageVector,
            onItemSelected: ((Int, String) -> Unit),

          Method TeamProgressTopAppBar has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              teamName: String,
              onBack: () -> Unit,
              onLeaderboard: () -> Unit,
              onChat: () -> Unit,
              newMessagesState: StateFlow<Int>,

            Method FlatLongButton has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                icon: ImageVector,
                text: String,
                onClick: () -> Unit,
                modifier: Modifier = Modifier,
                textColor: Color = MaterialTheme.typography.bodyMedium.color,

              Method drawXLabels has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      drawScope: DrawScope,
                      textMeasurer: TextMeasurer,
                      strings: List<String>,
                      xPadding: Float,
                      width: Float,
              Severity: Minor
              Found in app/src/main/java/com/github/geohunt/app/ui/components/utils/Graph.kt - About 45 mins to fix

                Method EditProfileContent has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    user: User,
                    eu: EditedUser,
                    onDisplayNameChange: (String) -> Unit,
                    onProfilePictureChange: (Uri) -> Unit,
                    isSaving: Boolean,

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

                      Button(
                          onClick = onClick,
                          enabled = enabled,
                          contentPadding = ButtonDefaults.ButtonWithIconContentPadding,
                          colors = ButtonDefaults.buttonColors(
                  app/src/main/java/com/github/geohunt/app/ui/components/buttons/HuntButton.kt 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 74.

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

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

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

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

                  Refactorings

                  Further Reading

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

                      Button(
                          onClick = onClick,
                          enabled = enabled,
                          contentPadding = ButtonDefaults.ButtonWithIconContentPadding,
                          colors = ButtonDefaults.buttonColors(
                  app/src/main/java/com/github/geohunt/app/ui/components/buttons/HuntButton.kt on lines 33..40

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

                  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