Showing 9 of 107 total issues
Class UserDAO
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
/**
* Class that contains all the queries that can be made for the local database
*
*/
@Dao
Method toUser
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* Converts the document received from firestore back into a User
*
* @return a User
*/
Method onCreate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
- Read upRead up
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
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
Open
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_edit_profile)
val uid = userHelper.getUserId()
Method getCurrentLocation
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 startProfileBirthday
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
*
Method onCreate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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