Pablissimo / SonarTsPlugin

SonarQube plugin for TypeScript files
MIT License
185 stars 105 forks source link

Improve coverable-lines-of-code tracking #116

Open Pablissimo opened 7 years ago

Pablissimo commented 7 years ago

Need to filter LCOV output to ignore non-executable lines, since source mapping will frequently claim a line that is just a definition in TypeScript is actually executed (due to the fact that it really is executed in JS land).

Pablissimo commented 7 years ago

Current thinking goes along two lines: 1) Implement a minimal TypeScript parser to track executable lines in the TypeScript sense 2) Implement a custom tool in TypeScript using the TypeScript language service and walk the parse tree

First one's fragile and irritating, and likely to not catch all cases (but can be done cheaply for a 90%-right-probably solution). Second one's now a new dependency for the plugin, delivered... somehow, requires Node and the tool on the box running the scanner...