SKY-L032 · Logic and resilience
Mock or placeholder data
Sample data left in application code: an address at example.com, a phone number such as 123-456-7890, an all-zero UUID or a password like password123. It usually comes from a tutorial, a generated scaffold or a quick test and was meant to be replaced.
- Languages
- Python
- Quality gate
- counted toward the gate limits (full and diff scans)
- Finding type
- review
Why it matters
The code runs with the sample value. In the example below every failed payout alert goes to example.com, a domain reserved for documentation, so the finance team never hears about a failed payout.
What Skylos flags
"""Send alerts when a payout fails.""" from payouts.notifications import send_email ALERT_RECIPIENT = "finance-alerts@example.com" def notify_failed_payout(payout): send_email( to=ALERT_RECIPIENT, subject=f"Payout {payout.id} failed", body=payout.failure_reason, )What Skylos leaves alone
"""Send alerts when a payout fails.""" import os from payouts.notifications import send_email ALERT_RECIPIENT = os.environ["PAYOUT_ALERT_EMAIL"]RECIPIENT_HINT = "Use a shared inbox, for example finance@example.com" def notify_failed_payout(payout): send_email( to=ALERT_RECIPIENT, subject=f"Payout {payout.id} failed", body=payout.failure_reason, )Why Skylos leaves it alone
The hint mentions example.com, but inside a sentence shown to a user, which is what the reserved domain is for. Skylos only reports a string that is a whole placeholder address, and the real recipient now comes from the environment.
How Skylos decides
- Runs with
--qualityon Python files. Skips test files (test_*.py,*_test.pyandconftest.py). Looks at string literals assigned to a name or attribute and at string default arguments. - Reports MEDIUM for a value that is a whole email address at
example.com,example.org,example.net,test.com,test.org,test.net,foo.com,bar.com,localhostorinvalid; a UUID made of one or two repeated digits; or a phone number such as123-456-7890or000-000-0000. - Reports HIGH for a credential name (
password,api_key,*_tokenand similar) holding a common test value such aspassword123,secretortestpassword. - For names that contain mock, fake, dummy, placeholder, sample, example, fixture, stub or demo, also reports a placeholder word such as
changemeordummy(MEDIUM), a value containing an example domain (LOW), or a short repeated value such asxxxx(LOW). - The finding is on the line of the literal.
How to fix it
Take the real value from configuration, so each deployment sets its own recipient and a missing setting fails at start-up.
"""Send alerts when a payout fails.""" Added: import osAdded: from payouts.notifications import send_email Removed: ALERT_RECIPIENT = "finance-alerts@example.com"Added: ALERT_RECIPIENT = os.environ["PAYOUT_ALERT_EMAIL"] def notify_failed_payout(payout): send_email( to=ALERT_RECIPIENT, subject=f"Payout {payout.id} failed", body=payout.failure_reason, )When it can be wrong
- Demo or seed scripts that are meant to use sample data, such as
seed_demo.py, are reported; only test files are skipped. - Placeholder data passed straight to a call, such as
send_email(to="ops@example.com"), is missed, because only assignments and default arguments are read.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Put the marker on the line of the literal.
Python DEMO_USER_EMAIL = "demo@example.com" # skylos: ignore[SKY-L032] seed data[tool.skylos] ignore = ["SKY-L032"]turns the rule off for the project.