SDP-GeoHunt/geo-hunt

View on GitHub

Showing 82 of 168 total issues

Method ChallengeFeed has a Cognitive Complexity of 77 (exceeds 20 allowed). Consider refactoring.
Open

@Composable
fun ChallengeFeed(
    chosenFeed: HomeScreenFeed,
    onUserClick: (User) -> Unit,
    onOpenMap: (Challenge) -> Unit,

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 ChallengeViewAuthor has a Cognitive Complexity of 71 (exceeds 20 allowed). Consider refactoring.
Open

@Composable
internal fun ChallengeViewAuthor(
    doFollow: () -> Unit,
    doUnfollow: () -> Unit,
    state: ChallengeViewModel.State

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 GeoHuntNavigationBar has a Cognitive Complexity of 52 (exceeds 20 allowed). Consider refactoring.
Open

/**
 * Creates the bottom navigation bar of the application.
 *
 * @param navController The navigation controller.
 * @param onCreate Callback used by the create button.

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 BountiesFeed has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring.
Open

@SuppressLint("FlowOperatorInvokedInComposition")
@OptIn(ExperimentalMaterialApi::class)
@Composable
fun BountiesFeed(
    onUserClick: (User) -> Unit,

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 TeamProgressScreenContent has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring.
Open

@OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class)
@Composable
fun TeamProgressScreenContent(
    onBack: () -> Unit,
    onLeaderboard: () -> Unit,

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 ChallengeViewAuthor has 87 lines of code (exceeds 25 allowed). Consider refactoring.
Open

@Composable
internal fun ChallengeViewAuthor(
    doFollow: () -> Unit,
    doUnfollow: () -> Unit,
    state: ChallengeViewModel.State

    Method BelowImageButton has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring.
    Open

    @Composable
    internal fun BelowImageButton(
        joinHunt: () -> Unit,
        leaveHunt: () -> Unit,
        fnClaimHuntCallback: (String) -> Unit,

    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 BountyChallengeCard has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring.
    Open

    @Composable
    fun BountyChallengeCard(
        challenge: Challenge?,
        currentLocation: Location?,
        onClaim: (Challenge) -> Unit,

    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 onCreate has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring.
    Open

        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
    
            setContent {
                GeoHuntTheme {
    Severity: Minor
    Found in app/src/main/java/com/github/geohunt/app/TutorialActivity.kt - About 3 hrs 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 BountyChallengeCard has 75 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    @Composable
    fun BountyChallengeCard(
        challenge: Challenge?,
        currentLocation: Location?,
        onClaim: (Challenge) -> Unit,

      Method SettingsDrawer has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring.
      Open

      @Composable
      fun SettingsDrawer(
          openProfileEdit: OptionalCallback,
          openLeaderboard: OptionalCallback,
          onLogout: OptionalCallback,

      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 HomeBountyCard has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring.
      Open

      @OptIn(ExperimentalFoundationApi::class)
      @Composable
      fun HomeBountyCard(
          author: Flow<User?>,
          onUserClick: (User) -> Unit,

      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 TeamSelector has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring.
      Open

      /**
       * A team entry in the team selector
       *
       * @param name The team's name
       * @param users the list of users, if any

      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 TeamProgressScreenContent has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      @OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class)
      @Composable
      fun TeamProgressScreenContent(
          onBack: () -> Unit,
          onLeaderboard: () -> Unit,

        Method TeamsSelector has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
        Open

        @Composable
        fun TeamsSelector(
            teams: List<Team>?,
            users: Map<String, List<User>>,
            join: (Team) -> Unit,

        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 LeaderboardPodiumItem has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        /**
         * Creates a podium list item for the top 3 users.
         * The position argument affects the exact UI of the item, including the background color and the
         * height of the item.
         *

          Method ChallengeFeed has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          @Composable
          fun ChallengeFeed(
              chosenFeed: HomeScreenFeed,
              onUserClick: (User) -> Unit,
              onOpenMap: (Challenge) -> Unit,

            Method TeamProgressTopAppBar has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
            Open

            /**
             * Creates the team progress top app bar.
             *
             * @param teamName The team name displayed as the title of the top bar.
             * @param onBack The callback used when pressing the back arrow.

            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 BelowImageButton has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            @Composable
            internal fun BelowImageButton(
                joinHunt: () -> Unit,
                leaveHunt: () -> Unit,
                fnClaimHuntCallback: (String) -> Unit,

              Method TeamCreator has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring.
              Open

              @Composable
              fun TeamCreator(createTeam: (String) -> Unit, disabled: Boolean) {
                  val name = remember { mutableStateOf("") }
              
                  Surface(elevation = 4.dp) {

              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