guess-It-SDP/guessIt

View on GitHub

Showing 181 of 201 total issues

File MainMenuActivity.kt has 253 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package com.github.freeman.bootcamp

import android.content.Context
import android.content.Intent
import android.graphics.BitmapFactory
Severity: Minor
Found in app/src/main/java/com/github/freeman/bootcamp/MainMenuActivity.kt - About 2 hrs to fix

    Method TopicSelectionScreen has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    @Composable
    fun TopicSelectionScreen(dbref: DatabaseReference, gameId: String) {
        val context = LocalContext.current
    
        //the current round and turn (in the round)

      Method VideoGallery has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

                        FirebaseUtilities.databaseGetMap(dbRef.child(context.getString(R.string.players_path)))
                            .thenAccept {
                                playerIds.value = it as HashMap<String, Map<String, Int>>
                            }
        app/src/main/java/com/github/freeman/bootcamp/games/guessit/ScoreActivity.kt on lines 182..185

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

        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

            FirebaseUtilities.databaseGetMap(dbRef.child(context.getString(R.string.players_path)))
                .thenAccept {
                    playerIds.value = it as HashMap<String, Map<String, Int>>
                }
        app/src/androidTest/java/com/github/freeman/bootcamp/ScoreActivity2Test.kt on lines 39..42

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

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

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

          Method createVideoFromImages has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private fun createVideoFromImages(context: Context, bitmapList: List<Bitmap>, videoName: String, videoDir: File, gameID: String) {
          
                      val videoFileName = "${videoName}_$gameID.mp4"
                      val videoFile = File(videoDir, videoFileName)
                      val videoFilePath = videoFile.absolutePath

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

                private fun startMainActivityFromHomeScreen() {
                    val instrumentation = InstrumentationRegistry.getInstrumentation()
                    device = UiDevice.getInstance(instrumentation)
            
                    composeRule.setContent {
            app/src/androidTest/java/com/github/freeman/bootcamp/StatsTest.kt on lines 34..44

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

            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

                fun startStatsActivityFromHomeScreen() {
                    val instrumentation = InstrumentationRegistry.getInstrumentation()
                    device = UiDevice.getInstance(instrumentation)
            
                    composeRule.setContent {
            app/src/androidTest/java/com/github/freeman/bootcamp/videocall/auth/FirebaseAuthActivityTest.kt on lines 28..38

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

            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

            fun guessing(context: Context, gameId: String) {
                context.startActivity(Intent(context, GuessingActivity::class.java).apply {
                    putExtra(context.getString(R.string.gameId_extra), gameId)
                })
            }
            app/src/main/java/com/github/freeman/bootcamp/MainMenuActivity.kt on lines 190..194

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

            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

            fun drawing(context: Context, gameId: String) {
                context.startActivity(Intent(context, DrawingActivity::class.java).apply {
                    putExtra(context.getString(R.string.gameId_extra), gameId)
                })
            }
            app/src/main/java/com/github/freeman/bootcamp/MainMenuActivity.kt on lines 184..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 127.

            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

                        if (currentUser.value!!.isAnonymous || signInInfo.value == ACCOUNT_DELETED_INFO || signInInfo.value == SIGNED_OUT_INFO) {
                            // if the user is authenticated anonymously
            
                            ElevatedButton(
                                modifier = Modifier.testTag("google_sign_in_button"),
            app/src/main/java/com/github/freeman/bootcamp/auth/FirebaseAuthActivity.kt on lines 360..373

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

            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

                    if (currentUser.value == null) {
                        // if the user is not authenticated
            
                        ElevatedButton(
                            modifier = Modifier.testTag("google_sign_in_button"),
            app/src/main/java/com/github/freeman/bootcamp/auth/FirebaseAuthActivity.kt on lines 374..385

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

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

            @Composable
            fun AppTitle() {
                val context = LocalContext.current
                Box(
                    modifier = Modifier
            Severity: Minor
            Found in app/src/main/java/com/github/freeman/bootcamp/MainMenuActivity.kt - About 1 hr to fix

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

                  @Test
                  fun mediumButtonIsDisplayedHasClickActionAndCorrectTextAndSendIntent() {
                      TestCompanion.testButton(
                          WordleMenu.Companion.Difficulty.MEDIUM.prettyText,
                          WordleGameActivity::class.java.name,
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 49..57
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 69..77
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 79..87
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 89..97

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

              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 easyButtonIsDisplayedHasClickActionAndCorrectTextAndSendIntent() {
                      TestCompanion.testButton(
                          WordleMenu.Companion.Difficulty.EASY.prettyText,
                          WordleGameActivity::class.java.name,
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 59..67
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 69..77
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 79..87
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 89..97

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

              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 veryVeryHardButtonIsDisplayedHasClickActionAndCorrectTextAndSendIntent() {
                      TestCompanion.testButton(
                          WordleMenu.Companion.Difficulty.VERY_VERY_HARD.prettyText,
                          WordleGameActivity::class.java.name,
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 49..57
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 59..67
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 69..77
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 79..87

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

              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 veryHardButtonIsDisplayedHasClickActionAndCorrectTextAndSendIntent() {
                      TestCompanion.testButton(
                          WordleMenu.Companion.Difficulty.VERY_HARD.prettyText,
                          WordleGameActivity::class.java.name,
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 49..57
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 59..67
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 69..77
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 89..97

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

              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 hardButtonIsDisplayedHasClickActionAndCorrectTextAndSendIntent() {
                      TestCompanion.testButton(
                          WordleMenu.Companion.Difficulty.HARD.prettyText,
                          WordleGameActivity::class.java.name,
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 49..57
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 59..67
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 79..87
              app/src/androidTest/java/com/github/freeman/bootcamp/wordle/WordleMenuTest.kt on lines 89..97

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

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

                  @Test
                  fun clickingSettingsSendsIntent() {
                      Intents.init()
                      composeRule.onNodeWithTag("settingsButton").performClick()
                      Intents.intended(IntentMatchers.hasComponent(SettingsProfileActivity::class.java.name))
              app/src/androidTest/java/com/github/freeman/bootcamp/CreatePublicPrivateActivityTest.kt on lines 77..85
              app/src/androidTest/java/com/github/freeman/bootcamp/MainMenuTest.kt on lines 52..60
              app/src/androidTest/java/com/github/freeman/bootcamp/MainMenuTest.kt on lines 85..91
              app/src/androidTest/java/com/github/freeman/bootcamp/SettingsProfileActivityTest.kt on lines 72..81
              app/src/androidTest/java/com/github/freeman/bootcamp/SettingsProfileActivityTest.kt on lines 83..92

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

              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