You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[duplicate-code] Duplicate Code: Mount Validation Switch in Sandbox and MCP Config #42427
and both reimplement the same mount-entry decision tree on top of , including the same OK/format/mode/empty-source/empty-destination branches. The only differences are log prefixes, field paths, and error wording.
Duplication Details
Pattern: Shared mount-entry validation flow
Severity: Medium
Occurrences: 2
Locations:
(lines 30-65)
(lines 26-58)
Code Sample:
Impact Analysis
Maintainability: Any change to mount parsing or error handling must be made in two places.
Bug Risk: Divergence between sandbox mounts and MCP mount validation is likely over time.
Code Bloat: The switch bodies are nearly identical and add a lot of repeated branches.
Refactoring Recommendations
Extract a shared helper that maps to error construction.
Keep caller-specific prefixes and docs URLs as parameters.
Estimated effort: small.
Optionally centralize the logging and formatting around so both callers only describe context.
Activity