Snyk Code only trusts my sanitizer function if it's copy-pasted into every file — anyone actually solved this?
Hitting something annoying with Snyk Code on a .NET codebase and want to know if anyone's actually cracked it before I accept defeat. We sanitize strings before logging them to avoid log injection (CRLF stuffing basically): csharp private string SafeLog(string input) { if (string.IsNullOrWhiteSpace(input)) return string.Empty; return input.Replace("\r", "").Replace("\n", ""); } Works fine, and Snyk is happy with it — but only if it's declared in the same file as the code calling it. The second I pull it out into a shared static class or extension method in a different file, Snyk goes right back to flagging it as unsanitized, even though it's calling the literal same code. We've got this
…