-
Notifications
You must be signed in to change notification settings - Fork 424
RecipeRunStats source file count exceeds number of files in project #4876
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
Comments
Thanks for the analysis with examples here @Bananeweizen ! Agree that it looks off, and would be better if we ensure these numbers line up with the number of files, as opposed to number of files * number of recipes (?). I'll raise this to the team! |
At a quick glance those all seem to be multiples of the number of files, where What are you proposing in terms of a fix? |
Yes, it seems that if a recipe is run with different parameters, the number of files visited is summed up. In terms of fix:
|
The counter issue is related to rewrite/rewrite-core/src/main/java/org/openrewrite/table/RecipeRunStats.java Lines 62 to 68 in 6e31800
When the same recipe is executed several times with different parameters, the So, we can't simply change the Perhaps, there is some other suitable // @timtebeek |
Unit test with the reproducer https://github.com/openrewrite/rewrite/compare/stats-issue-4876 |
Thanks again for pointing out this mismatch @Bananeweizen ! |
What is the smallest, simplest way to reproduce the problem?
Enable datatables on a small project, open RecipeRunStats.csv and sort by first column (edited source files).
What did you see instead?
That's from a project with 2600 files in the repo (Java, Maven, adoc, ....), therefore I would expect none of the numbers to be larger than 2600.
If you agree to that assumption, then
rewrite/rewrite-core/src/main/java/org/openrewrite/scheduling/RecipeRunCycle.java
Line 122 in d11eae9
It might need to be moved inside the
if visitor.isAcceptable()
condition.This bug does not create any wrong code with rewrite recipes. It just makes it harder to use the numbers in the data tables to look for "extreme" recipes or similar oddities.
Are you interested in contributing a fix to OpenRewrite?
The text was updated successfully, but these errors were encountered: