Skip to content

[core] Update metrics framework and some rules#3162

Merged
adangel merged 67 commits into
pmd:pmd/7.0.xfrom
oowekyala:pmd7-update-metrics
Mar 30, 2021
Merged

[core] Update metrics framework and some rules#3162
adangel merged 67 commits into
pmd:pmd/7.0.xfrom
oowekyala:pmd7-update-metrics

Conversation

@oowekyala

@oowekyala oowekyala commented Mar 6, 2021

Copy link
Copy Markdown
Member

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?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by travis)
  • Added (in-code) documentation (if needed)
    • Javadocs
    • Flesh out java features page somewhat
    • Add pointers in major_adding_new_language
    • Add pointers in writing_java_rules

@adangel adangel self-requested a review March 22, 2021 20:00

@adangel adangel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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....

Comment thread docs/_data/sidebars/pmd_sidebar.yml
Comment thread docs/_data/sidebars/pmd_sidebar.yml
Comment thread pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/metrics/ApexMetrics.java Outdated
Comment thread pmd-core/src/main/java/net/sourceforge/pmd/lang/metrics/Metric.java Outdated
@oowekyala oowekyala marked this pull request as draft March 27, 2021 17:50
@oowekyala oowekyala force-pushed the pmd7-update-metrics branch from d7adab3 to 0457203 Compare March 28, 2021 17:27
@oowekyala oowekyala marked this pull request as ready for review March 28, 2021 22:30
@adangel adangel self-assigned this Mar 30, 2021
@adangel adangel merged commit df06d15 into pmd:pmd/7.0.x Mar 30, 2021
@oowekyala oowekyala deleted the pmd7-update-metrics branch March 30, 2021 18:04
oowekyala added a commit to oowekyala/pmd-designer that referenced this pull request Apr 2, 2021
@adangel adangel mentioned this pull request Jan 23, 2023
55 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in:metrics Affects the metrics framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants