-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify statistics computation and access to coverage data #837
Conversation
Use custom CoverageData, centralizing some common computation as well.
Imo/afaik this is an anti pattern, especially when combined with overriding initialize as due to optimizations your initialize might be skipped, which is of course kinda bad. This should retain all the functionality while not running into potentially dangerous territory.
It was the only non output place in the entire code base where we rounded it as best as I can tell. Rounding can be done in formatters (imo) and by doing it on the source file level we lost precision in the accumulation for all files. Went back all the way to #59 and couldn't see a reason why it _had_ to be rounded. Also, no tests fail so 🤷
This allows us to get rid off duplicated and inconsistent calculations. As a side effect of this, #565 is fixed now. So, fixes #565. The bigger purpose is multi step though where the access to coverage data is normalized and hence methods that work with expecting a minimum amount of coverage and formatters can work with the known good same data base as opposed to memoizing all different method names. At first I wanted to only do it for FileList and leave the rest for later. But the strength computation needed the total number of lines of code and so to pass it in I'd have had to calculate it but I wanted to calculate it only in CoverageData and there the avalanche started.... Commit also includes moving methods around in SourceFile to be private - it happened in the moment, forgive me for no extra commit (it was hard to determine what I could delete/what I need to adjust etc.).
I'm not super happy with this function in total (it's mostly used for counting/size and we could use coverage data now) but I don't want to break interface as much right here. So for compatibility this helps it not create arrays all over the place all the time.
No idea why the warning production/check hadn't worked for me locally in the rake task 🤔 |
deb32d6
to
e07c52c
Compare
Oh wow yeah, of course force pushing deletes references to comments. Sorry @krtschmr wanted to keep a relatively nice history 😅 |
Seems like a flaky we should fix - @deivid-rodriguez was this the one you saw before?
|
Nop, that's a different one. Mine was about timeouts in |
ugh, that one would seem hard to solve. Damn :( |
Same flaky again :'( |
And in a scenario I wrote again 😱 And I'm the one who always claims I'm sadly proficient at debugging flakies - makes me think it's that way because I write so many 😢 |
You're not alone @PragTob :) |
The bigger purpose is multi step where the access to coverage data is normalized and hence methods that work with expecting a minimum amount of coverage and formatters can work with the known good same data base as opposed to memoizing all different method names.
This is good enough as an intermediate PR.
By virtue of unifying coverage computation we also get rid of inconsistencies like #565
While I was there and happily modified things, I also got rid off inheriting from a core class (Array).