The reviewer flagged the helper as dead code, but a string in the config was the only caller
A static review, human and AI, both mark processRefundLegacy as unused. Nothing imports it directly, no test calls it, and the diff to remove it looks like a clean deletion. It is reached from a string key in a dispatch table that only activates under a non-default payment flow, and deleting it breaks that flow on the next release. A function can be reached without a direct call Many codebases…
The static review flagged the processRefundLegacy function as dead code, but a closer examination revealed the function was only called through a string key in a dispatch table. This lookup only activated under a non-default payment flow, and removing the function would break that flow on the next release. Despite codebases often employing registries to route behavior instead of conditional chains, the reviewer failed to recognize the string-based caller and marked the function as unused.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.