Closed TomMD closed 4 years ago
This is not aligned with Stan goals. The inspections are for users to understand their code better and choose the most suitable solution among proposed ones. This feature complicates design a lot with too little benefit: it's not always possible to suggest a replacement, it's not us who should decide what solution to suggest as a "drop-in solution", suggestions can use external dependencies and simple copy-paste won't work.
Generally, the static analyser is not an automatic code refactoring tool. Its goal is to help people gain better insight into their code, not just simply replace one code with another.
Either by default or via an option, the solutions presented to the user should be tailored to the specific code so the user can delete the startLine to endLine of the span and replace with the solution.
For example, we see:
And could instead see:
While underwhelming in this case, such operation could be more helpful either in complex code or as part of the JSON output (when paired with issue #335)