SARIF increased fidelity
Suggest an idea for Knip
The new SARIF reporter as of Release 6.30.0 is very cool -- I had my own re-parser of the JSON report structure to get to SARIF for some broader scale analysis. Given that I had a parallel implementation, I'd like to share a feature I implemented for your consideration (and / or I'd be happy to create a PR if it is desired).
In the SARIF schema, the most important reference for a "result" is the physicalLocation which you return accurately to my opinion. However, you may also return logicalLocations which is how a result can return the identifier name that could be parsed and used various ways by a consumer. I.e. if you were currently to derive another format (markdown for instance) from the SARIF format you could not as we are missing the identifier name in question other than re-parsing the message.text. (I round-tripping reporters isn't a real usecase, but I'm trying to make the argument of orthogonality and the value that other reporters have placed on this data I'm trying to represent).
Thank you for the tool and your consideration.
Source: webpro-nl/knip