Showing 82 of 168 total issues
Method ChallengeFeed
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
chosenFeed: HomeScreenFeed,
onUserClick: (User) -> Unit,
onOpenMap: (Challenge) -> Unit,
onOpenChallenge: (Challenge) -> Unit,
onClaim: (Challenge) -> Unit,
Method EditProfileContent
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
user: User,
eu: EditedUser,
onDisplayNameChange: (String) -> Unit,
onProfilePictureChange: (Uri) -> Unit,
isSaving: Boolean,
Method BountyChallengeCard
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
challenge: Challenge?,
currentLocation: Location?,
onClaim: (Challenge) -> Unit,
isEnabled: Boolean,
isClaimed: Boolean,
Method drawXLabels
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
drawScope: DrawScope,
textMeasurer: TextMeasurer,
strings: List<String>,
xPadding: Float,
width: Float,
Method SettingsListDropdownQuick
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
title: String,
items: List<String>,
value: Int,
icon: ImageVector,
onItemSelected: ((Int, String) -> Unit),
Method FlatLongButton
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
icon: ImageVector,
text: String,
onClick: () -> Unit,
modifier: Modifier = Modifier,
textColor: Color = MaterialTheme.typography.bodyMedium.color,
Method TeamProgressScreen
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
onBack: () -> Unit,
onLeaderboard: () -> Unit,
onChat: () -> Unit,
onClaim: (Challenge) -> Unit,
bountyId: String,
Method TeamProgressTopAppBar
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
teamName: String,
onBack: () -> Unit,
onLeaderboard: () -> Unit,
onChat: () -> Unit,
newMessagesState: StateFlow<Int>,
Method SettingsDrawer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
openProfileEdit: OptionalCallback,
openLeaderboard: OptionalCallback,
onLogout: OptionalCallback,
openSettings: OptionalCallback,
close: () -> Unit
Method getInTimeRangeString
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
rangeStart: LocalDateTime,
rangeEnd: LocalDateTime,
beforeStringId: Int,
whileStringId: Int,
afterStringId: Int
Method Graph
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
xValues: List<Long>,
xBottom: Long,
xTop: Long,
xStrings: List<String>,
yValues: List<Long>
Method drawYLabels
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
drawScope: DrawScope,
textMeasurer: TextMeasurer,
yStrings: List<String>,
height: Float,
xOffset: Float
Method BountyClaimChallenge
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
bid: String,
cid: String,
onSuccess: (Claim) -> Unit = {},
onFailure: (Throwable) -> Unit = {},
viewModel: BountyClaimViewModel = viewModel(factory = BountyClaimViewModel.getFactory(bid))
Method createChallenge
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
photo: LocalPicture,
location: Location,
difficulty: Challenge.Difficulty,
expirationDate: LocalDateTime?,
description: String?
Method ChallengeView
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
cid: String,
fnViewImageCallback: (String) -> Unit,
fnClaimHuntCallback: (String) -> Unit,
onBack: () -> Unit,
viewModel: ChallengeViewModel = viewModel(factory = ChallengeViewModel.Factory)
Method HuntClaimButton
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
state: ChallengeHuntState,
onHunt: () -> Unit,
onClaim: () -> Unit,
showClaim: () -> Unit = { /* TODO Create a claim page */ },
isBusy: () -> Boolean = { false }
Method createChallenge
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
photo: LocalPicture,
location: Location,
difficulty: Challenge.Difficulty = Challenge.Difficulty.MEDIUM,
expirationDate: LocalDateTime? = null,
description: String? = null
Method MainScreen
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
@OptIn(ExperimentalMaterialApi::class)
@Composable
fun MainScreen(viewModel: MainViewModel, logout: () -> Unit) {
val navController = rememberNavController()
val scaffoldState = rememberScaffoldState()
- 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 ActiveBountiesList
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
/**
* Represents a List of bounties, bounties are displayed in a LazyRow and user can scroll through them
* @param bounties The bounties to display
* @param openExploreTab the callback that should be called by the button on the empty screen (No bounties)
* @param openBountyView the callback that should be called when the user clicks on a bounty
- 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 ActiveHuntsList
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
/**
* Creates a scrollable list of active hunts using the given list.
*
* If the list is empty, uses the [EmptyScreen] as fallback.
*
- 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"