[core] Update metrics framework and some rules#3162
Merged
Conversation
This needs to wait for java-grammar to be finished + metrics to be ported.
adangel
reviewed
Mar 26, 2021
adangel
left a comment
Member
There was a problem hiding this comment.
Thanks, that looks very good. I like it, that the available metrics for a language are collected at one place now (e.g. JavaMetrics).
Your description in the release notes is accurate. I don't think, we can do anything for the deleted classes on master (such as deprecations), since they are all in use and there is no direct replacement.
I have just a few comments. I could understand most of the changed results from the metrics calculations, but I'm not sure why ATFD and NPath changed....
d7adab3 to
0457203
Compare
adangel
approved these changes
Mar 30, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the PR
Rewrite the metrics framework in large parts.
The main improvement of this is that we can support metrics for more than 2 node types per language, without requiring awkward changes to the ast like the MethodLikeNode interface. It's also much easier to manipulate metrics in a language-independent way.
All of the documentation about metrics that's on the website has been moved to the javadocs, as this is the place they're the most useful, and the easiest to keep in sync.
An overview of the rest of the changes is in the pmd 7 release notes.
This also updates the metrics implementations to the new java grammar and activates the tests of metrics rules.
Related issues
Ready?
./mvnw clean verifypasses (checked automatically by travis)