BlindlyTeam/Blindly

View on GitHub

Showing 9 of 107 total issues

Class UserDAO has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

/**
 * Class that contains all the queries that can be made for the local database
 *
 */
@Dao
Severity: Minor
Found in app/src/main/java/ch/epfl/sdp/blindly/database/localDB/UserDAO.kt - About 2 hrs to fix

    Method toUser has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            /**
             * Converts the document received from firestore back into a User
             *
             * @return a User
             */
    Severity: Minor
    Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt - About 1 hr to fix

      Method onCreate has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          override fun onCreate(savedInstanceState: Bundle?) {
              super.onCreate(savedInstanceState)
              setContentView(R.layout.activity_edit_gender)
      
              val uid = userHelper.getUserId()

        Method onBindViewHolder has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring.
        Open

            /**
             * Binds all the content to the view, and handles click listeners.
             * This function is invoked by the layout manager.
             *
             * @param viewHolder the ViewHolder of the current item

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

            @RequiresApi(Build.VERSION_CODES.O)
            override fun onCreate(savedInstanceState: Bundle?) {
                super.onCreate(savedInstanceState)
                setContentView(R.layout.activity_match_profile)
        
        

          Method onCreate has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              override fun onCreate(savedInstanceState: Bundle?) {
                  super.onCreate(savedInstanceState)
                  setContentView(R.layout.activity_edit_profile)
          
                  val uid = userHelper.getUserId()

            Method startProfileBirthday has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                /**
                 * Gets the name of the user as input, checks it to be alphabetical and within
                 * character limits, if so passes it to builder and then fires Birthday Activity,
                 * if not outputs error message
                 *
            Severity: Minor
            Found in app/src/main/java/ch/epfl/sdp/blindly/profile_setup/ProfileName.kt - About 1 hr to fix

              Method getCurrentLocation has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  /**
                   * Get the current location of the user
                   * Get the location from the GPS and if disabled from the network
                   *
                   * @return the user's location or null if GPS and network are disabled

                Method onCreate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    override fun onCreate(savedInstanceState: Bundle?) {
                        super.onCreate(savedInstanceState)
                        setContentView(R.layout.activity_user_map)
                        // Obtain the SupportMapFragment and get notified when the map is ready to be used.
                        val mapFragment = supportFragmentManager
                  Severity
                  Category
                  Status
                  Source
                  Language