Showing 19 of 61 total issues
Method SignUpScreen
has a Cognitive Complexity of 56 (exceeds 20 allowed). Consider refactoring. Open
@Composable
fun SignUpScreen(
modifier: Modifier = Modifier,
accountService: AccountService = AccountService(),
onSuccessfulAccountCreationAndLogin: () -> Unit
- 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 VoteIcon
has a Cognitive Complexity of 53 (exceeds 20 allowed). Consider refactoring. Open
/**
* Component that shows an upvote/downvote icon (similar to reddit f.ex)
* @param counterValue the current value of the counter
* @param onChange the function that will be called when the counter changes, the int parameter is the relative change
* @param userVote the current vote of the user (0 if none, 1 if upvote, -1 if downvote)
- 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 LoginScreen
has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring. Open
@Composable
fun LoginScreen(
onSuccessfulLogin: () -> Unit,
onRegisterClick: () -> Unit,
modifier: Modifier = Modifier,
- 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 Cook4MeApp
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring. Open
@Composable
fun Cook4MeApp(
navController: NavHostController = rememberNavController(),
permissionStatusProvider: PermissionStatusProvider = ComposePermissionStatusProvider(
listOf(Manifest.permission.CAMERA, Manifest.permission.ACCESS_FINE_LOCATION)
- 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 RecipeListScreen
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
/**
* Displays a scrollable list of recipes
* @param recipeList the list of (id with the recipe) with the note to display
* @param onNoteUpdate the function to call when the note is updated (recipeId, note)
* @param userVotes the map of the user votes (recipeId, note) if no votes -> empty key
- 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 VoteIcon
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
modifier: Modifier = Modifier,
counterValue: Int = 0,
onChange: (Int) -> Unit = {},
userVote: Int = 0,
canClick: Boolean = true,
Method AddressField
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
/**
* A component that asks for an address
* @param question the question to be displayed
* @param onAddressChanged the function to be called when the address is changed
*/
- 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 FormButtons
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
@StringRes onCancelText: Int,
@StringRes onSaveText: Int,
modifier: Modifier = Modifier,
isLoading: Boolean = false,
onCancelClick: () -> Unit,
Method InputField
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
value: String,
@StringRes question: Int,
modifier: Modifier = Modifier,
@StringRes label: Int? = null,
isError: Boolean = false,
Method BiosField
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
icon: ImageVector,
preview: String,
value: String,
isError: Boolean,
onNewValue: (String) -> Unit,
Method MatchDialog
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
@Composable
fun MatchDialog(
user: String,
otherUser: String,
context: Context,
- 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 ProfileInfosField
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
icon: ImageVector,
preview: String,
value: String,
isError: Boolean,
onNewValue: (String) -> Unit,
Method RecipeListScreen
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
recipeList: List<RecipeNote>,
onNoteUpdate: (String, Int) -> Unit,
userVotes: Map<String, Int>,
isOnline: Boolean = true,
recipeImages: Map<String, ByteArray?>
Method PasswordField
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
value: String,
isError: Boolean,
onNewValue: (String) -> Unit,
modifier: Modifier = Modifier,
@StringRes text: Int? = null
Method MatchDialog
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
user: String,
otherUser: String,
context: Context,
onDismissRequest: () -> Unit,
profileImageRepository: ProfileImageRepository = ProfileImageRepository()
Method RecipeFeed
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
/**
* Displays the recipe feed screen
* @param service the service to use to get the recipes/notes and update the notes
* @param onCreateNewRecipe the callback to call when the user wants to create a new recipe
*/
- 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
Avoid too many return
statements within this method. Open
if (user != other.user) return false
Avoid too many return
statements within this method. Open
return true
Avoid too many return
statements within this method. Open
if (!image.contentEquals(other.image)) return false