guess-It-SDP/guessIt

View on GitHub

Showing 181 of 201 total issues

Method EditUserDetails has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

@Composable
fun EditUserDetails(context: Context = LocalContext.current, displayName: MutableState<String>, profilePic: MutableState<Bitmap?>) {
    val dbRef = Firebase.database.reference
    val storageRef = Firebase.storage.reference
    val userId = Firebase.auth.currentUser?.uid
Severity: Major
Found in app/src/main/java/com/github/freeman/bootcamp/EditProfileActivity.kt - About 2 hrs to fix

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

    @OptIn(ExperimentalFoundationApi::class)
    @Composable
    fun VideoGallery(videos: Array<File>?) {
        val pagerState = rememberPagerState()
        val context = LocalContext.current

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

        @Test
        fun guessItButton() {
            composeRule.onNodeWithTag("guessItButton").assertIsDisplayed()
            composeRule.onNodeWithTag("guessItButton").assertTextContains("Guess It!")
            composeRule.onNodeWithTag("guessItButton").assertHasClickAction()
    app/src/androidTest/java/com/github/freeman/bootcamp/GamesMenuTest.kt on lines 54..64

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

    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

        @Test
        fun wordleButton() {
            composeRule.onNodeWithTag("wordleButton").assertIsDisplayed()
            composeRule.onNodeWithTag("wordleButton").assertTextContains("Wordle")
            composeRule.onNodeWithTag("wordleButton").assertHasClickAction()
    app/src/androidTest/java/com/github/freeman/bootcamp/GamesMenuTest.kt on lines 42..52

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

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

    /**
     * An alert which pops up when a user clicks to the account deletion button to be sure he/she want to continue
     * @param signInInfo the sign in info (authenticated as, not signed in, etc) which will be displayed on the screen
     * @param currentUser the current user of the app
     * @param show true if the warning need to be shown, becomes false when it needs to be closed

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

          @Test
          fun wordleMenuTopAppBar() {
              composeRule.onNodeWithText(PLAY).performClick()
              composeRule.onNodeWithText("Wordle").performClick()
      
      
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 60..71
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 89..98
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 100..109
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 121..132

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

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

          @Test
          fun authTopAppBar() {
              composeRule.onNodeWithText(SETTINGS).performClick()
              composeRule.onNodeWithText("Manage Account").performClick()
      
      
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 60..71
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 100..109
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 121..132
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 177..188

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

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

          @Test
          fun createJoinTopAppBar() {
              composeRule.onNodeWithText(PLAY).performClick()
              composeRule.onNodeWithText("Guess It!").performClick()
      
      
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 60..71
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 89..98
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 100..109
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 177..188

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

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

          @Test
          fun editProfileTopAppBar() {
              composeRule.onNodeWithText(SETTINGS).performClick()
              composeRule.onNodeWithTag("editProfileButton").performClick()
      
      
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 89..98
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 100..109
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 121..132
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 177..188

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

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

          @Test
          fun drawHatTopAppBar() {
              composeRule.onNodeWithText(SETTINGS).performClick()
              composeRule.onNodeWithText("Draw Your Hat").performClick()
      
      
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 60..71
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 89..98
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 121..132
      app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 177..188

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

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

      @Composable
      fun CreditsDisplay() {
          Column(
              modifier = Modifier
                  .testTag("creditsScreen")

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

      /**
       * Display authentication info and authentication buttons depending on the user authentication state
       * @param signInInfo the sign in info that will be displayed
       * @param currentUser the current user, can be anonymous
       */

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

            @Test
            fun settingsTopAppBar() {
                composeRule.onNodeWithText(SETTINGS).performClick()
        
                composeRule.onNodeWithTag("topAppbarProfile").assertIsDisplayed()
        app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 111..119

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

        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

            @Test
            fun gamesMenuTopAppBar() {
                composeRule.onNodeWithText(PLAY).performClick()
        
                composeRule.onNodeWithTag("topAppbarGamesMenu").assertIsDisplayed()
        app/src/androidTest/java/com/github/freeman/bootcamp/TopAppBarsTest.kt on lines 48..58

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

        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

                navigationIcon = {
                    IconButton(
                        modifier = Modifier
                            .testTag("appBarBack"),
                        onClick = {
        app/src/main/java/com/github/freeman/bootcamp/auth/FirebaseAuthActivity.kt on lines 236..250

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

        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

                navigationIcon = {
                    IconButton(
                        modifier = Modifier.testTag("appBarBack"),
                        onClick = {
                            val activity = (context as? Activity)
        app/src/main/java/com/github/freeman/bootcamp/EditProfileActivity.kt on lines 245..260

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

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

            override fun onCreate(savedInstanceState: Bundle?) {
                super.onCreate(savedInstanceState)
        
                signInLauncher = registerForActivityResult (
                    FirebaseAuthUIActivityResultContract()

          Method createRecap has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  /**
                   * Creates a recap video for the given game
                   *
                   * @param context context of the app
                   * @param gameId id of the game

            Method EditableItemStyle has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            @Composable
            private fun EditableItemStyle(item: EditableData) {
                Row(
                    modifier = Modifier
                        .fillMaxWidth()
            Severity: Major
            Found in app/src/main/java/com/github/freeman/bootcamp/EditProfileActivity.kt - About 2 hrs to fix

              Method initScreen has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @Before
                  fun initScreen() {
                      composeRule.setContent {
                          val context = LocalContext.current
              
              
              Severity: Major
              Found in app/src/androidTest/java/com/github/freeman/bootcamp/LobbyListTest.kt - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language