Showing 50 of 201 total issues
Method TopicSelectionScreen
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun VideoGallery(videos: Array<File>?) {
val pagerState = rememberPagerState()
val context = LocalContext.current
Method CreditsDisplay
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Composable
fun CreditsDisplay() {
Column(
modifier = Modifier
.testTag("creditsScreen")
Method createVideoFromImages
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method AppTitle
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Composable
fun AppTitle() {
val context = LocalContext.current
Box(
modifier = Modifier
Method GuessItRulesDisplay
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Composable
fun GuessItRulesDisplay() {
Column(
modifier = Modifier
.testTag("guessItRulesScreen")
Method MainMenuScreen
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Composable
fun MainMenuScreen() {
Surface {
Box(
Method onCreate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
val dbRef = Firebase.database.reference
Method PopUpScreen
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* This is the skeleton of any pop up
* @param text: The text that will be displayed inside the pop-up
*/
@Composable
Method drawObjectsOnFacesOnBitmapImage
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* Draws objects on the detected faces in the provided bitmap image using the specified overlay pictures and draw function.
*
* @param bitmap The bitmap image on which to draw the objects.
* @param overlayPic The overlay picture to use for drawing on the faces.
Method TopAppbarAccount
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Composable
fun TopAppbarAccount(context: Context = LocalContext.current) {
TopAppBar(
modifier = Modifier.testTag("topAppbarAccount"),
Method TopAppbarEditProfile
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Composable
fun TopAppbarEditProfile(context: Context = LocalContext.current) {
TopAppBar(
modifier = Modifier.testTag("topAppbarEditProfile"),
Method WordleRulesDisplay
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Composable
fun WordleRulesDisplay() {
Column(
modifier = Modifier
.testTag("wordleRulesScreen")
Method RoomScreen
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* allows to enter a video call room by entering a number in a textField and by clicking on a button
*
* @param onNavigate the navigation flow controller
* @param viewModel view model for RoomScreen display
Method TopAppbarWordleRules
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Composable
fun TopAppbarWordleRules(context: Context = LocalContext.current) {
TopAppBar(
modifier = Modifier.testTag("topAppbarWordleRules"),
Method TopAppbarCredits
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Composable
fun TopAppbarCredits(context: Context = LocalContext.current) {
TopAppBar(
modifier = Modifier.testTag("topAppbarCredits"),
Method TopAppbarGuessItRules
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Composable
fun TopAppbarGuessItRules(context: Context = LocalContext.current) {
TopAppBar(
modifier = Modifier.testTag("topAppbarGuessItRules"),
Method TopAppbarDisplayRecaps
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Composable
fun TopAppbarDisplayRecaps(context: Context = LocalContext.current) {
TopAppBar(
modifier = Modifier.testTag("topAppbarDisplayRecaps"),
Method createProfile
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* Creates a profile and stores it into Firebase
*
* @param context context of the activity
* @param userId Id of the user
Method onDataChange
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
Open
override fun onDataChange(snapshot: DataSnapshot) {
if (snapshot.exists()) {
when (snapshot.getValue<String>()!!) {
getString(R.string.state_initialize) -> {
if (isHost) {
- 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"