SkillSpector
SkillSpector copied to clipboard
[Refactor] mcp: centralize RISK_THRESHOLD constant and deduplicate cleanup helper
Follow-up from @rng1995's review on #36: https://github.com/NVIDIA/SkillSpector/pull/36#pullrequestreview-4539956136
"The cleanup block duplicates the private
_cleanup_resulthelper …RISK_THRESHOLD = 50is duplicated from the CLI's inline50"
Two small code-quality issues surfaced during review of #36:
RISK_THRESHOLD = 50is duplicated betweencli.py(inline) andmcp_server.py(module constant). If the threshold changes, both must be updated in sync.- The temp-dir cleanup
finallyblock inmcp_server.pyreimplements what_cleanup_result()incli.pyalready does. The two can drift independently.
Proposed Fix
- Extract
RISK_THRESHOLDto a shared module (e.g.skillspector/constants.py) and import it in both files. - Move
_cleanup_resultto a shared utility module and import it in both places.