Skip to content

Commit

Permalink
Merge pull request #1204 from uhafner/metrics
Browse files Browse the repository at this point in the history
Enable reporting of software metrics
  • Loading branch information
uhafner authored Oct 26, 2024
2 parents a9c3eb0 + a227815 commit 322023d
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .github/workflows/quality-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: jwalton/gh-find-current-pr@v1
id: pr
- name: Run Quality Monitor
uses: uhafner/quality-monitor@v1
uses: uhafner/quality-monitor@v1.12.0-beta-1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ steps.pr.outputs.number }}
Expand Down Expand Up @@ -129,5 +129,36 @@ jobs:
}
]
}
],
"metrics": [
{
"name": "Toplevel Metrics",
"tools": [
{
"name": "Cyclomatic Complexity",
"id": "metrics",
"pattern": "**/metrics.xml",
"metric": "CyclomaticComplexity"
},
{
"name": "Cognitive Complexity",
"id": "metrics",
"pattern": "**/metrics.xml",
"metric": "CognitiveComplexity"
},
{
"name": "Non Commenting Source Statements",
"id": "metrics",
"pattern": "**/metrics.xml",
"metric": "NCSS"
},
{
"name": "N-Path Complexity",
"id": "metrics",
"pattern": "**/metrics.xml",
"metric": "NPathComplexity"
}
]
}
]
}
40 changes: 40 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,46 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<linkXRef>false</linkXRef>
<targetJdk>${java.version}</targetJdk>
<skip>true</skip>
</configuration>
<dependencies>
<dependency>
<groupId>edu.hm.hafner</groupId>
<artifactId>pmd-core</artifactId>
<version>7.5.0-metrics</version>
</dependency>
<dependency>
<groupId>edu.hm.hafner</groupId>
<artifactId>pmd-java</artifactId>
<version>7.5.0-metrics</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>run-pmd-metrics</id>
<goals>
<goal>pmd</goal>
</goals>
<phase>verify</phase>
<configuration>
<targetDirectory>${project.build.directory}/pmd-metrics</targetDirectory>
<rulesets>
<ruleset>/category/java/metric.xml</ruleset>
</rulesets>
<format>net.sourceforge.pmd.renderers.MetricsRenderer</format>
<includeTests>false</includeTests>
<skip>${pmd.skip}</skip>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand Down

0 comments on commit 322023d

Please sign in to comment.