After the latest Code Coverage API release v2.0.4, https://github.com/jenkinsci/code-coverage-api-plugin/pull/265 was closed, and https://github.com/jenkinsci/code-coverage-api-plugin/pull/310 was merged instead.
https://www.jenkins.io/doc/pipeline/steps/code-coverage-api/ shows "NEVER_STORE, STORE_LAST_BUILD, STORE_ALL_BUILD" as levels of source file storage. After the PR 310 merge, these are defined in enum SourceFileResolverLevel. The level is passed in via the SourceFileResolver extension point but its sole implementation class DefaultSourceFileResolver is deprecated. I suppose that means Warnings NG should not imitate the SourceFileResolver extension point.
For my purposes, it would be sufficient to support only NEVER_STORE and STORE_ALL_BUILD. I would then use NEVER_STORE, forward the warnings to the version-control server via Checks API, and view them from there. The level in Warnings NG could still be an enum, to allow STORE_LAST_BUILD to be implemented later if needed.
For other users, it might make sense to offer a time-based preservation limit too, like in LogRotator. It would not be possible to use LogRotator itself, though.
If Jenkins does not store the source files, but they are available from the web UI of the version-control server, then it would be nice to have each warning link there. RepositoryBrowser currently supports only linking to change sets, and not to lines of files, but I imagine that could be added pretty easily.