SiteShadow
Back to vulnerability library

QP12 Long Functions

What this means

SiteShadow flagged functions that are very long. Long functions tend to mix responsibilities (validation, auth, data access, business logic), which makes security reviews and safe refactoring harder.

Why it matters

Long functions are harder to understand, review, and secure.

Safer examples

1) Split into focused helpers

Separate parsing/validation, authorization, data access, and business rules.

2) Add guard clauses for security checks

Fail early and consistently when auth/validation fails.

3) Add tests around the boundary

Before refactoring, add tests for authz and key behaviors so refactors don't introduce bypasses.

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Request access View coverage