Qodana EAP for CI/CD: Configuring Quality Gates with Pre-commit Analysis
Configure Qodana EAP with --threshold=WARN to automatically fail builds when code quality issues exceed acceptable levels. This guide covers GitHub Actions integration, memory tuning, and common pitfalls.
01 Feb 2026, 20:30 UTC

Quick Answer: Fail Builds on Code Quality Issues
Use Qodana EAP in your CI pipeline with a configured inspection profile and threshold to automatically fail builds when code quality issues exceed acceptable levels. The key is setting --threshold=WARN (or higher) to trigger build failures on WARNING severity issues.
How Qodana Quality Gates Work
Qodana EAP runs IntelliJ IDEA's static analysis engine as a command-line tool in your CI environment. It evaluates your Java or Kotlin code against inspection profiles (collections of predefined quality rules) and reports issues by severity: ERROR, WARNING, or WEAK WARNING.
Configure quality gates by combining three parameters:
--profile: Specifies which inspection rules to apply--threshold: Sets the minimum severity that will fail the build--output: Defines where to write the HTML report
Practical Configuration Example
Here's a complete GitHub Actions workflow using the jetbrains/qodana-ci action:
name: Qodana Analysis
on: [push, pull_request]
jobs:
qodana:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Run Qodana Analysis
uses: jetbrains/qodana-ci@v1
with:
threshold: 'WARN'
profile: 'InspectionProject'
project-dir: '/home/runner/work/repo/repo'
- name: Upload Qodana Report
uses: actions/upload-artifact@v4
if: always()
with:
name: qodana-report
path: 'report.html'
This configuration will:
- Run Qodana analysis on every push and pull request
- Fail the build if any WARNING or ERROR severity issues are found
- Upload the HTML report as an artifact for review
Local Verification Before CI Integration
Test your Qodana setup locally before committing to CI:
# Download qodana.jar from JetBrains Marketplace EAP section
# Run analysis with custom JVM memory for large projects
java -Xmx4g -jar qodana.jar --project-dir=/path/to/project \
--profile=InspectionProject --threshold=WARN --output=report.html
# Verify installation and available options
java -jar qodana.jar --help
Common Pitfalls and Limitations
Java Version Requirements
Qodana EAP requires Java 17 or later. Running with Java 8-11 will produce compatibility errors. Always verify your CI environment uses the correct JDK version.
Memory Constraints in Large Repositories
Default JVM heap may be insufficient for large monorepos. Add -Xmx4g or higher when running qodana.jar directly. The GitHub action handles this automatically, but self-hosted runners may need manual tuning.
Profile Management
Custom inspection profiles must be committed to source control for reproducible builds. Create a .qodana directory in your repository and reference it with --profile=.qodana.
EAP Stability Considerations
As an Early Access Program release, Qodana EAP may contain bugs or breaking changes. Test thoroughly in a feature branch before enabling in main branch protection rules.
Interpreting Results
Qodana generates:
- Issue counts by severity in the HTML report
- Affected files with inline annotations
- Fix suggestions including one-click auto-fixes for many issues
The build exit code is non-zero when issues exceed the threshold, causing CI pipelines to fail automatically.
Verification Checklist
- Confirm Java 17+ is available in your CI environment
- Run
java -jar qodana.jar --helplocally to verify installation - Test with a minimal Java project before full integration
- Check JetBrains Marketplace for current EAP release status
- Review the generated HTML report to ensure expected issues are detected
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.