Showing 50 of 109 total issues
Method SignIn
has a Cognitive Complexity of 68 (exceeds 20 allowed). Consider refactoring. Open
/**
* The function that launches the call to firebase and the google api to sign in
*/
@Composable
fun SignIn (navController: NavController, viewModel: AuthViewModel) {
- 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 CreateNavigationBar
has a Cognitive Complexity of 59 (exceeds 20 allowed). Consider refactoring. Open
@SuppressLint("UnrememberedMutableState")
@Composable
fun CreateNavigationBar(navController: NavHostController, currentUser: String, activity: MainActivity) {
val context = LocalContext.current
- 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 ProfileTopInterface
has a Cognitive Complexity of 59 (exceeds 20 allowed). Consider refactoring. Open
/**
* The top interface of the user's profile displaying the user's information
* username, bio, number of followers, number of followings, profile picture
*/
@Composable
- 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 searchAsong
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
override fun searchAsong(songName: String, artistName: String): String {
Log.d("ENTER MOCK", songName)
return "{\n" +
" \"data\": [\n" +
" {\n" +
Method WelcomeOperation
has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring. Open
/**
* 1) Stores the access token along with the userName
* 2) Fetch the user Id using the Deezer API
* 3) Create a orkest Playlist then waits for the playlist ID
* 4) Stores the playlist id back into the database
- 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 createUI
has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring. Open
@Composable
fun createUI(bluetoothServiceManager: BluetoothInterface) {
val recompose by rememberUpdatedState(update)
//bluetoothServiceManager.acceptConnections()
- 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
File FireStoreDatabaseAPI.kt
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.github.orkest.domain
import android.content.ContentValues
import android.content.ContentValues.TAG
import android.content.Context
Method SignIn
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
/**
* The function that launches the call to firebase and the google api to sign in
*/
@Composable
fun SignIn (navController: NavController, viewModel: AuthViewModel) {
Method SearchUi
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
/**
* @param viewModel use to communicate with the Backend
*
*This method display the search bar, and support the drawing of the future users that will
* be find in the database
Method onCreate
has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring. Open
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
OrkestTheme {
// A surface container using the 'background' color from the theme
- 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 createUI
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Composable
fun createUI(bluetoothServiceManager: BluetoothInterface) {
val recompose by rememberUpdatedState(update)
//bluetoothServiceManager.acceptConnections()
Method updateUserFollowers
has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring. Open
/**
* toFollow: Boolean = states whether we should add the current user or retrieve it from the user's followers' list
* Update the followers' list of the visited profile
* The multiple future.complete allow to reduce the complexity of the function and make sure to handle all the errors
*/
- 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 updateCurrentUserFollowings
has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring. Open
/**
* toFollow: Boolean = states whether we should add the visited user or retrieve it from the current user's followings' list
* Update the followings' list of the current logged in user
*/
open fun updateCurrentUserFollowings(toFollow: Boolean): CompletableFuture<Boolean> {
- 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 ProfileTopInterface
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
/**
* The top interface of the user's profile displaying the user's information
* username, bio, number of followers, number of followings, profile picture
*/
@Composable
Class FireStoreDatabaseAPI
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
open class FireStoreDatabaseAPI {
companion object{
val db = Firebase.firestore
fun isOnline(context: Context): Boolean {
Method CreateNavigationBar
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressLint("UnrememberedMutableState")
@Composable
fun CreateNavigationBar(navController: NavHostController, currentUser: String, activity: MainActivity) {
val context = LocalContext.current
Method onCreate
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
/**
* This override of the onCreate method is used to get the text from the intent
* The text corresponds to a spotify song URL that is used to get the song ID and
* song name.
*
Method updatePostLikesInDatabase
has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring. Open
/**
* This function updates the nbLikes and likeList of the given post depending on whether the user wants to like or dislike the post
* The user is always CURRENT_LOGGED_USER because he/she is the only one who can react to a post when logged in
* @param post: the post to which we want to like or dislike the content
* @param like: boolean that indicates if the user wants to like or dislike the post
- 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 WelcomeOperation
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
/**
* 1) Stores the access token along with the userName
* 2) Fetch the user Id using the Deezer API
* 3) Create a orkest Playlist then waits for the playlist ID
* 4) Stores the playlist id back into the database
Method Playlist
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
/*
* This is a Composable that fetches the songs from the database and displays them.
*/
@Composable
fun Playlist(playlistViewModel: PlaylistViewModel,