gchq / gchq/sleeper

Add flag argument code smell to coding conventions

Open Beginner friendly
#8,181 0 comments 0 reactions 0 assignees View on GitHub
documentation
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.