pfxprobe scans Pricefx configuration code and reports common issues and improvement opportunities. It is based loosely on CodeClimate.
Reports are written to .pfxprobe/ in the working directory:
.pfxprobe/codeclimate.json.pfxprobe/codeclimate.sarif.json.pfxprobe/pfxprobe-quality.md
-qualitygate controls failure behavior only.
The markdown quality report is always written and does not fail builds.
There are two analysis types:
- Probe - Custom regex-based rules for Pricefx patterns
- Narc - Generic Groovy static analysis via CodeNarc
This project is distributed as:
stages:
- analyze
pfxprobe:
image: pricefx/pfxprobe
stage: analyze
only:
- develop
- merge_requests
script:
- pfxprobe -dir .
artifacts:
when: always
reports:
codequality: .pfxprobe/codeclimate.json
paths:
- ./.pfxprobe/codeclimate.json
- ./.pfxprobe/codeclimate.sarif.json
- ./.pfxprobe/pfxprobe-quality.md
On Windows, with cmd:
docker run --rm -it --name pfxprobe -v %cd%:/code pricefx/pfxprobe pfxprobe -dir code
On Mac / Linux with bash:
docker run --rm -it --name pfxprobe -v ${PWD}:/code pricefx/pfxprobe pfxprobe -dir code
java -jar pfxprobe.jar -dir <directory> [options]
Options:
-dir <arg> Directories to be scanned (CodeNarc runs on first directory only)
-n Execute CodeNarc analysis only
-p Execute pfxprobe analysis only
-rulefile <arg> Path to CodeNarc ruleset file (defaults to ./codenarc.ruleset)
-qualitygate [level] Enable quality gate mode with optional severity threshold
Displays detailed report and fails build if issues found
Valid levels: info, minor, major, critical
Default: info (fails on any issue)
Examples:
java -jar pfxprobe.jar -dir .
java -jar pfxprobe.jar -dir . -qualitygate
java -jar pfxprobe.jar -dir . -qualitygate major
java -jar pfxprobe.jar -dir src -rulefile ./custom-rules.ruleset -qualitygate criticalDirect Maven execution with JDK 21 + Maven installed:
mvn test
mvn package exec:java -Dexec.mainClass=Main -Dexec.args="-dir fixtures"pfxprobe -dir <directory> [options]
Options:
-dir <arg> Directories to be scanned (CodeNarc runs on first directory only)
-n Execute CodeNarc analysis only
-p Execute pfxprobe analysis only
-rulefile <arg> Path to CodeNarc ruleset file (defaults to ./codenarc.ruleset)
-qualitygate [level] Enable quality gate mode with optional severity threshold
Displays detailed report and fails build if issues found
Valid levels: info, minor, major, critical
Default: info (fails on any issue)
Examples:
pfxprobe -dir .
pfxprobe -dir . -qualitygate
pfxprobe -dir . -qualitygate major
pfxprobe -dir src -rulefile ./custom-rules.ruleset -qualitygate critical-qualitygate prints a detailed console report and fails when issues are at or above the selected severity.
Reports are still written regardless of gate usage.
Severity Levels (from lowest to highest):
info- Informational issuesminor- Minor code quality issuesmajor- Significant issues that should be addressedcritical- Critical issues requiring immediate attention
Usage in CI/CD:
pfxprobe:
image: pricefx/pfxprobe
stage: analyze
script:
- pfxprobe -dir . -qualitygate major # Fail on major+ issues
artifacts:
when: always
reports:
codequality: .pfxprobe/codeclimate.json
paths:
- ./.pfxprobe/codeclimate.json
- ./.pfxprobe/codeclimate.sarif.json
- ./.pfxprobe/pfxprobe-quality.mdQuality Gate Output:
- Individual issue details with file location and description
- Summary grouped by severity level
- Summary grouped by check type
- Exit code 1 if threshold exceeded, 0 if passed
Quality Report Output:
- Markdown file at
.pfxprobe/pfxprobe-quality.md - Includes issue list and severity/rule summaries
- Never changes exit code