SDP-GeoHunt/geo-hunt

View on GitHub

Showing 168 of 168 total issues

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

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

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

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

              /**
               * Convert the given nullable localtime to a ISO 8601 compliant String of the corresponding time at
               * UTC. The string will be "null" when no localDateTime was provided
               *
               * @param localDateTime the datetime to be converted
          Severity: Minor
          Found in app/src/main/java/com/github/geohunt/app/utility/DateUtils.kt and 1 other location - About 35 mins to fix
          app/src/main/java/com/github/geohunt/app/utility/DateUtils.kt on lines 84..94

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

          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

              /**
               * Convert a ISO 8601 compliant String at UTC to the corresponding nullable local date time
               *
               * @param value the ISO 8601 complaint String to be converted, also can be "null"
               */
          Severity: Minor
          Found in app/src/main/java/com/github/geohunt/app/utility/DateUtils.kt and 1 other location - About 35 mins to fix
          app/src/main/java/com/github/geohunt/app/utility/DateUtils.kt on lines 62..73

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

          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

                  model = ImageRequest.Builder(LocalContext.current)
                      .data(source)
                      .crossfade(true)
                      .build(),
          app/src/main/java/com/github/geohunt/app/ui/components/ImageView.kt on lines 31..34

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

          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

              // Bounties teams number
              private val _nbParticipating: MutableStateFlow<Map<String, Int>> = MutableStateFlow(mapOf())
          app/src/main/java/com/github/geohunt/app/ui/screens/home/BountyFeedViewModel.kt on lines 31..32

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

          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

                      AsyncImage(model = ImageRequest.Builder(LocalContext.current)
                              .data(url)
                              .crossfade(true)
                              .build(),
          app/src/main/java/com/github/geohunt/app/ui/components/user/ProfileIcon.kt on lines 58..61

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

          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

              // Bounties authors
              private val _bountyAuthors: MutableStateFlow<Map<String, User>> = MutableStateFlow(mapOf())
          app/src/main/java/com/github/geohunt/app/ui/screens/home/BountyFeedViewModel.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 66.

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

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

              body1 = TextStyle(
                  fontFamily = FontFamily.Default,
                  fontWeight = FontWeight.Normal,
                  fontSize = 16.sp
              ),
          Severity: Minor
          Found in app/src/main/java/com/github/geohunt/app/ui/theme/Type.kt and 2 other locations - About 35 mins to fix
          app/src/main/java/com/github/geohunt/app/ui/theme/Type.kt on lines 24..28
          app/src/main/java/com/github/geohunt/app/ui/theme/Type.kt on lines 30..34

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

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

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

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

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

          Refactorings

          Further Reading

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

              h3 = TextStyle(
                  fontFamily = FontFamily.Default,
                  fontWeight = FontWeight.Normal,
                  fontSize = 12.sp
              ),
          Severity: Minor
          Found in app/src/main/java/com/github/geohunt/app/ui/theme/Type.kt and 2 other locations - About 35 mins to fix
          app/src/main/java/com/github/geohunt/app/ui/theme/Type.kt on lines 18..22
          app/src/main/java/com/github/geohunt/app/ui/theme/Type.kt on lines 24..28

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

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

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

              h1 = TextStyle(
                  fontFamily = FontFamily.Default,
                  fontWeight = FontWeight.Normal,
                  fontSize = 27.sp
              ),
          Severity: Minor
          Found in app/src/main/java/com/github/geohunt/app/ui/theme/Type.kt and 2 other locations - About 35 mins to fix
          app/src/main/java/com/github/geohunt/app/ui/theme/Type.kt on lines 18..22
          app/src/main/java/com/github/geohunt/app/ui/theme/Type.kt on lines 30..34

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

          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

                      activeHunts
                          .child(currentUser.id)
                          .child(challenge.id)
                          .setValue(value)
                          .await()
          app/src/main/java/com/github/geohunt/app/data/repository/bounties/BountyClaimRepository.kt on lines 79..81

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

          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

                      claimIdByTeamId.child(currentTeam.teamId)
                          .child(challenge.id)
                          .setValue(claimId).asDeferred()
          app/src/main/java/com/github/geohunt/app/data/repository/ActiveHuntsRepository.kt on lines 39..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 63.

          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

              /**
               * Returns the follow state of the currently authenticated user with regards to the given user.
               *
               * If there is no currently authenticated user, throws a [UserNotLoggedInException].
               */
          app/src/main/java/com/github/geohunt/app/data/repository/FollowRepositoryInterface.kt on lines 47..53

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

          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

              /**
               * Returns the follow state of the currently authenticated user with regards to the given user.
               *
               * If there is no currently authenticated user, throws a [UserNotLoggedInException].
               */
          app/src/main/java/com/github/geohunt/app/data/repository/FollowRepositoryInterface.kt on lines 39..45

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

          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