guess-It-SDP/guessIt

View on GitHub

Showing 50 of 201 total issues

Method EditDialog has a Cognitive Complexity of 81 (exceeds 20 allowed). Consider refactoring.
Open

// Dialog that edits any field given in argument
@Composable
fun EditDialog(
    text: MutableState<String>,
    setValue: String = SET_VALUE,
Severity: Minor
Found in app/src/main/java/com/github/freeman/bootcamp/EditProfileActivity.kt - About 1 day 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 onStartCommand has a Cognitive Complexity of 70 (exceeds 20 allowed). Consider refactoring.
Open

    override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
        if (firstStart) {
            Log.d("GameManagerD", "Game Manager Started")
            val gameID = intent!!.getStringExtra(getString(R.string.gameId_extra)).toString()
            val gameDBRef = getGameDBRef(this, gameID)

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 EditUserDetails has a Cognitive Complexity of 57 (exceeds 20 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: Minor
Found in app/src/main/java/com/github/freeman/bootcamp/EditProfileActivity.kt - About 6 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 createRecap has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
Open

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

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

File EditProfileActivity.kt has 412 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package com.github.freeman.bootcamp

import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
Severity: Minor
Found in app/src/main/java/com/github/freeman/bootcamp/EditProfileActivity.kt - About 5 hrs to fix

    Method AuthenticationForm has a Cognitive Complexity of 49 (exceeds 20 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
     */

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

    // Dialog that edits any field given in argument
    @Composable
    fun EditDialog(
        text: MutableState<String>,
        setValue: String = SET_VALUE,
    Severity: Major
    Found in app/src/main/java/com/github/freeman/bootcamp/EditProfileActivity.kt - About 4 hrs to fix

      File FirebaseAuthActivity.kt has 329 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      package com.github.freeman.bootcamp.auth
      
      import android.app.Activity
      import android.content.Context
      import android.content.Intent

        Method onCreate has a Cognitive Complexity of 39 (exceeds 20 allowed). Consider refactoring.
        Open

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

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

            override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
                if (firstStart) {
                    Log.d("GameManagerD", "Game Manager Started")
                    val gameID = intent!!.getStringExtra(getString(R.string.gameId_extra)).toString()
                    val gameDBRef = getGameDBRef(this, gameID)

          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

            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

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

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

                      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

                        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
                          Severity
                          Category
                          Status
                          Source
                          Language