Inclusive Variable Name
ID |
python.inclusive_variable |
Severity |
info |
Remediation Complexity |
trivial |
Remediation Risk |
low |
Remediation Effort |
low |
Resource |
Best Practice |
Language |
Python |
Tags |
inclusive, naming |
Description
Reports plain-identifier assignments and formal parameters whose name contains a non-inclusive term (the default deny-list: blacklist, whitelist, master, slave, grandfather, dummy, sanity).
blacklist = [] # FLAW
master = "primary-host" # FLAW
def f(dummy): # FLAW
return dummy
denylist = [] # OK
primary = "primary-host" # OK
Rationale
Variable names propagate through every reference and every log message; the default deny-list terms have neutral, equally clear alternatives.
Remediation
Rename to a precise alternative: denylist, allowlist, primary / replica, legacy, placeholder, quick_check.