SDP-GeoHunt/geo-hunt

View on GitHub

Showing 82 of 168 total issues

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

    chosenFeed: HomeScreenFeed,
    onUserClick: (User) -> Unit,
    onOpenMap: (Challenge) -> Unit,
    onOpenChallenge: (Challenge) -> Unit,
    onClaim: (Challenge) -> Unit,

    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 TeamProgressScreen has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

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

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

          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 BountyChallengeCard has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

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

              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 EditProfileContent has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

                  Method getInTimeRangeString has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                              rangeStart: LocalDateTime,
                              rangeEnd: LocalDateTime,
                              beforeStringId: Int,
                              whileStringId: Int,
                              afterStringId: Int
                  Severity: Minor
                  Found in app/src/main/java/com/github/geohunt/app/i18n/DateFormatUtils.kt - About 35 mins to fix

                    Method createChallenge has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            photo: LocalPicture,
                            location: Location,
                            difficulty: Challenge.Difficulty = Challenge.Difficulty.MEDIUM,
                            expirationDate: LocalDateTime? = null,
                            description: String? = null

                      Method drawYLabels has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

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

                        Method BountyClaimChallenge has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            bid: String,
                            cid: String,
                            onSuccess: (Claim) -> Unit = {},
                            onFailure: (Throwable) -> Unit = {},
                            viewModel: BountyClaimViewModel = viewModel(factory = BountyClaimViewModel.getFactory(bid))

                          Method ChallengeView has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              cid: String,
                              fnViewImageCallback: (String) -> Unit,
                              fnClaimHuntCallback: (String) -> Unit,
                              onBack: () -> Unit,
                              viewModel: ChallengeViewModel = viewModel(factory = ChallengeViewModel.Factory)

                            Method Graph has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    xValues: List<Long>,
                                    xBottom: Long,
                                    xTop: Long,
                                    xStrings: List<String>,
                                    yValues: List<Long>
                            Severity: Minor
                            Found in app/src/main/java/com/github/geohunt/app/ui/components/utils/Graph.kt - About 35 mins to fix

                              Method HuntClaimButton has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  state: ChallengeHuntState,
                                  onHunt: () -> Unit,
                                  onClaim: () -> Unit,
                                  showClaim: () -> Unit = { /* TODO Create a claim page */ },
                                  isBusy: () -> Boolean = { false }

                                Method SettingsDrawer has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    openProfileEdit: OptionalCallback,
                                    openLeaderboard: OptionalCallback,
                                    onLogout: OptionalCallback,
                                    openSettings: OptionalCallback,
                                    close: () -> Unit

                                  Method createChallenge has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          photo: LocalPicture,
                                          location: Location,
                                          difficulty: Challenge.Difficulty,
                                          expirationDate: LocalDateTime?,
                                          description: String?

                                    Method MainScreen has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    @OptIn(ExperimentalMaterialApi::class)
                                    @Composable
                                    fun MainScreen(viewModel: MainViewModel, logout: () -> Unit) {
                                        val navController = rememberNavController()
                                        val scaffoldState = rememberScaffoldState()
                                    Severity: Minor
                                    Found in app/src/main/java/com/github/geohunt/app/ui/screens/main/MainScreen.kt - About 35 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

                                    Method ActiveBountiesList has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    /**
                                     * Represents a List of bounties, bounties are displayed in a LazyRow and user can scroll through them
                                     * @param bounties The bounties to display
                                     * @param openExploreTab the callback that should be called by the button on the empty screen (No bounties)
                                     * @param openBountyView the callback that should be called when the user clicks on a bounty

                                    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

                                    Method ActiveHuntsList has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    /**
                                     * Creates a scrollable list of active hunts using the given list.
                                     *
                                     * If the list is empty, uses the [EmptyScreen] as fallback.
                                     *

                                    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