Add flag argument code smell to coding conventions
- Dominant language
- Java
- Stars
- 107
- Forks
- 29
- Avg merge
- 19h 46m
- Merged PRs (30d)
- 141
Description
We've had a number of PR reviews bring up methods that take a boolean parameter. This has caused problems because it's often hard to tell what this means. Particularly in tests, if you call a method passing a literal boolean, that makes it harder to read the test.
We'd like to explain this in our coding conventions document.
Here's a more detailed explanation of this problem:
https://www.codesmells.org/smells/flag-argument
Contributor guide
Research direction
Locate the repository's coding conventions document and read its existing guidance on method parameters and test readability. Use the linked flag-argument explanation as background, then add guidance explaining why boolean parameters can be unclear, especially when callers pass literal booleans. Done means the convention is documented clearly without changing code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100