Skip to content
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

Rewrite metrics to support all new PMD metrics #133

Merged
merged 1 commit into from
Nov 10, 2024
Merged

Conversation

uhafner
Copy link
Member

@uhafner uhafner commented Nov 9, 2024

Add support for all new PMD metrics (see pmd/pmd@main...uhafner:pmd:7.7.0-patch-2). These new PMD metrics have been introduced in the bachelor theses of Maximilian Waidelich here at the University of Applied Sciences Munich, see #119.

The following metrics are now supported:

📐   Toplevel Metrics

Icon Name Total Min Max Mean Median
🌀 Cyclomatic Complexity 355 1 8 1.73 1
🧠 Cognitive Complexity 172 0 11 0.84 0
📏 Lines of Code 3859 1 35 6.52 1
📝 Non Commenting Source Statements 1199 1 21 3.81 1
🔭 Access to foreign data 87 0 6 0.32 0
🔗 Class cohesion 0 0.00% 71.43% 13.59% 0.00%
📤 Fan out 224 0 13 1.78 0
📲 Number of accessors 14 0 2 0.54 0
🏋️ Weight of a class 1 0.00% 100.00% 83.65% 0.00%
📐 Weighted method count 354 3 46 14.75 3
N-Path Complexity 432 1 30 2.11 1

@uhafner uhafner added the enhancement Enhancement of existing functionality label Nov 9, 2024
.reduce(accumulator));
}

protected Optional<Value> getDefaultValue(final Node node, final Metric searchMetric) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'searchMetric' is never used.
Copy link

github-actions bot commented Nov 9, 2024

☀️   Quality Monitor

   🚦   Tests: 100% successful (✔️ 298 passed)
   〰️   Line Coverage: 96% (87 missed lines)
   ➰   Branch Coverage: 92% (75 missed branches)
   PIT   Mutation Coverage: 90% (118 survived mutations)
   💪   Test Strength: 93% (79 survived mutations in tested code)
   CheckStyle   CheckStyle: No warnings
   PMD   PMD: No warnings
   SpotBugs   SpotBugs: No bugs
   🐛   Error Prone: No bugs
   OWASP Dependency Check   OWASP Dependency Check: No vulnerabilities
   🌀   Cyclomatic Complexity: 661
   🧠   Cognitive Complexity: 528
   📝   Non Commenting Source Statements: 2973
   ➿   N-Path Complexity: 1485


Created by Quality Monitor v1.13.0 (#d2d7e89). More details are shown in the GitHub Checks Result.

Copy link

codecov bot commented Nov 9, 2024

Codecov Report

Attention: Patch coverage is 98.52941% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.49%. Comparing base (4f5a182) to head (2b7b7f1).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/main/java/edu/hm/hafner/coverage/Metric.java 98.03% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #133      +/-   ##
============================================
+ Coverage     93.28%   93.49%   +0.21%     
- Complexity      842      850       +8     
============================================
  Files            28       28              
  Lines          2308     2322      +14     
  Branches        340      338       -2     
============================================
+ Hits           2153     2171      +18     
+ Misses           84       82       -2     
+ Partials         71       69       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

☀️   Quality Monitor

   🚦   Tests: 100% successful (✔️ 299 passed)
   〰️   Line Coverage: 96% (82 missed lines)
   ➰   Branch Coverage: 92% (75 missed branches)
   PIT   Mutation Coverage: 90% (113 survived mutations)
   💪   Test Strength: 93% (79 survived mutations in tested code)
   CheckStyle   CheckStyle: No warnings
   PMD   PMD: 25 warnings (normal: 25)
   SpotBugs   SpotBugs: No bugs
   🐛   Error Prone: No bugs
   OWASP Dependency Check   OWASP Dependency Check: No vulnerabilities
   🌀   Cyclomatic Complexity: 668
   🧠   Cognitive Complexity: 529
   📝   Non Commenting Source Statements: 3001
   ➿   N-Path Complexity: 1492


Created by Quality Monitor v1.13.0 (#d2d7e89). More details are shown in the GitHub Checks Result.

Copy link

☀️   Quality Monitor

   🚦   Tests: 100% successful (✔️ 299 passed)
   〰️   Line Coverage: 96% (82 missed lines)
   ➰   Branch Coverage: 92% (75 missed branches)
   PIT   Mutation Coverage: 90% (113 survived mutations)
   💪   Test Strength: 93% (79 survived mutations in tested code)
   CheckStyle   CheckStyle: No warnings
   PMD   PMD: No warnings
   SpotBugs   SpotBugs: No bugs
   🐛   Error Prone: No bugs
   OWASP Dependency Check   OWASP Dependency Check: No vulnerabilities
   🌀   Cyclomatic Complexity: 668
   🧠   Cognitive Complexity: 529
   📝   Non Commenting Source Statements: 3001
   ➿   N-Path Complexity: 1492


Created by Quality Monitor v1.13.0 (#d2d7e89). More details are shown in the GitHub Checks Result.

@uhafner uhafner merged commit 2886483 into main Nov 10, 2024
33 checks passed
@uhafner uhafner deleted the all-pmd-metrics branch November 10, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant