IBM ZCodeScan Baseline management guide
IBM® ZCodeScan's baseline feature helps you manage code quality by tracking known issues and identifying new problems introduced during development. This guide explains how to use baseline commands to maintain code quality standards across your development lifecycle.
Baseline fundamentals
A baseline is a reference point that captures all detected issues at a specific point in time. Once you create a baseline, you can track known issues, identify new problems, and monitor improvements. All issues in the baseline remain visible but are marked as "known".
Baselines enable quality gates in CI/CD pipelines, support release management by tracking code quality across versions, facilitate technical debt management, and establish shared quality standards for team collaboration.
Commands
- Create Baseline
- This command creates a baseline file that captures the current state of your code quality. The command performs a complete scan of your codebase and saves all detected issues to a baseline file. All issues captured in the baseline are marked as "known issues" and will be suppressed in subsequent scans when you apply the baseline.
- Apply Baseline (Incremental Scans)
- This command compares your current code against an existing baseline to identify new issues. The command performs an incremental scan by comparing your current code quality state against a previously created baseline. The scan identifies three categories: new issues that require attention, known issues from the baseline, and resolved issues that have been fixed.
Baseline comparison results
- New Findings are issues detected in the current scan but not in the baseline. These issues require review and action. The system reports them in scan output and they cause a non-zero exit code.
- Suppressed Known Findings are issues present in both the baseline and current scan. The system tracks them for awareness but they don't block builds. They do not affect the exit code.
- Resolved Findings are issues from the baseline that are no longer detected. They indicate code improvements and do not affect the exit code.
✓ Baseline comparison complete: * New findings: 15 ← Action required * Suppressed known findings: 145 ← Tracked, suppressed * Resolved findings: 5 ← Improvements
This output indicates 15 new findings that need attention, 145 known findings still present but suppressed, and 5 findings successfully resolved.
Baseline file format
The system stores baselines in JSON format. Each baseline file contains metadata and a list of findings. The metadata includes a timestamp in ISO 8601 format (UTC) that indicates when the baseline was created.
- Metadata
-
-created_at: Timestamp indicating when the baseline was created, stored in ISO 8601 format (UTC). This helps track the baseline version and age.
- Findings:
-
- findings: An array containing all code quality issues detected at the time of baseline creation. Each finding includes: - fingerprint: A unique identifier that precisely identifies each issue. This fingerprint is used to match issues across scans, ensuring accurate tracking of new, known, and resolved issues. - rule_id: The identifier of the quality rule that detected the issue (for example., "COBOL.QualityGate.LineLength"). This links the issue to specific coding standards. - severity: The severity level of the issue, which can be: - BLOCKER: Critical issues that must be addressed immediately - HIGH: Serious issues requiring prompt attention - MEDIUM: Moderate issues that should be addressed - LOW: Minor issues for consideration - INFO: Informational findings for awareness - file: The relative path to the source file where the issue was detected, making it easy to locate the problem in your codebase. - message: Description of the issue, explaining what was detected and why it matters.
Known Limitations
IBM ZCodeScan currently supports only one baseline per scan. You cannot combine or merge multiple baselines in a single scan operation. For more information about troubleshooting, see IBM ZCodeScan Known issues and limitations.