Skip to main content

SKY-L032 · Logic and resilience

Mock or placeholder data

Varies

The catalog gives no severity. A test password under a credential name is HIGH; placeholder emails, phone numbers, UUIDs and placeholder words are MEDIUM; example domains and repeated characters under mock names are LOW.

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
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

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

payouts/alerts.py · PythonReported on line 5
"""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

payouts/alerts.py · Python
"""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

  1. Runs with --quality on Python files. Skips test files (test_*.py, *_test.py and conftest.py). Looks at string literals assigned to a name or attribute and at string default arguments.
  2. 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, localhost or invalid; a UUID made of one or two repeated digits; or a phone number such as 123-456-7890 or 000-000-0000.
  3. Reports HIGH for a credential name (password, api_key, *_token and similar) holding a common test value such as password123, secret or testpassword.
  4. For names that contain mock, fake, dummy, placeholder, sample, example, fixture, stub or demo, also reports a placeholder word such as changeme or dummy (MEDIUM), a value containing an example domain (LOW), or a short repeated value such as xxxx (LOW).
  5. 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.

payouts/alerts.py · Python · the fix, against the flagged file
"""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.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.