Comprehensive static analysis for Bloomreach Experience Manager (brXM) projects
A powerful static analysis tool for Bloomreach Experience Manager (brXM) projects, available as both an IntelliJ IDEA plugin and a standalone CLI tool. Detects common issues, performance bottlenecks, security vulnerabilities, and configuration problems based on analysis of 1,700+ community forum topics.
-
Repository Tier (6 inspections, 40% priority)
- JCR Session Leak Detection
- Session.refresh() Dangerous Calls
- Content Bean Mapping Issues
- Document Workflow Implementation Issues
- Workflow Action Availability Checks
- Node Listener Memory Leak Detection
-
Configuration (16 inspections, 25% priority)
- Bootstrap UUID Conflict Detection
- Sitemap Pattern Shadowing Detection
- Component Parameter Null Checks
- Cache Configuration Issues
- HST Component Lifecycle Issues
- HST Component Thread Safety Issues
- HttpSession Usage in HST
- HST Filter Implementation Issues
- System.out/err Usage
- Static Request/Session Storage (Concurrency Bug)
- HST Configuration Root Path Issues
- HTML Comment Stripping Detection
- Load Balancer Affinity / 409 Conflict Detection
- Magic String Detection
- Missing Input Validation
- Channel Configuration Node Issues
-
Performance (6 inspections, 15% priority)
- Unbounded JCR Query Detection
- Missing Database Index Detection
- HippoFolder.getDocuments() Performance Issues
- HstQueryResult.getSize() Performance Issues
- Synchronous HTTP Calls in Components
- N+1 Query Pattern Detection
-
Security (8 inspections, 10% priority)
- Hardcoded Credentials Detection
- Hardcoded JCR Paths Detection
- Missing REST Authentication
- JCR Query SQL Injection (String Concatenation)
- Missing XSS Output Escaping
- Security Header Configuration
- User Role Authentication Checks
- XML External Entity (XXE) Detection
-
Deployment (2 inspections)
- Docker/Kubernetes Configuration Issues
- Project Version Configuration & Compatibility
- IntelliJ IDEA Plugin - Real-time analysis as you code
- CLI Tool - Batch analysis for CI/CD integration
- Parallel inspection execution
- Smart parse caching
- Incremental analysis
- Fast file scanning with glob patterns
- Real-time issue highlighting in IDE
- Quick fixes (Alt+Enter)
- Detailed issue descriptions with examples
- Progress reporting
- Multiple report formats (HTML, Markdown, JSON)
Supported IDEs: IntelliJ IDEA Community Edition 2023.2.5+ (builds 232-242.*)
- Build the plugin:
./gradlew :intellij-plugin:build
- Locate plugin:
intellij-plugin/build/distributions/intellij-plugin-1.2.0.zip - Open IntelliJ IDEA
- Go to Settings > Plugins
- Click gear icon βοΈ > Install Plugin from Disk...
- Select the built ZIP file
- Restart IDE
- Go to Settings > Tools > Bloomreach CMS Inspections to configure
Features after installation:
- Real-time code inspection highlighting
- Quick fixes via Alt+Enter (Cmd+Enter on Mac)
- "Bloomreach Inspections" tool window with statistics
- Per-inspection severity configuration
- Enable/disable individual inspections
# Build the CLI
./gradlew :cli:build
# Run it
java -jar cli/build/libs/cli-1.0.7.jar --help# Build distribution package
./gradlew :cli:build
# Extract and install
unzip cli/build/distributions/cli-1.0.7.zip -d /usr/local/
# Add to PATH (for Linux/Mac)
echo 'export PATH="/usr/local/cli-1.0.7/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Test installation
brxm-inspect --versionREM Build and extract to Program Files
gradlew :cli:build
powershell Expand-Archive -Path cli\build\distributions\cli-1.0.7.zip -DestinationPath "C:\Program Files"
REM Add C:\Program Files\cli-1.0.7\bin to PATH environment variable
REM Then restart terminal and test
brxm-inspect --version- Open a Bloomreach project in IntelliJ
- Watch for issues - Highlighted in real-time as you type
- View all issues - Press Alt+6 (Cmd+6 on Mac) for Problems panel
- Apply fixes - Press Alt+Enter (Option+Enter on Mac) on highlighted issues
- Tool window - Click "Bloomreach Inspections" tab at bottom
# Analyze a brXM project directory
java -jar cli/build/libs/cli-1.0.7.jar analyze /path/to/bloomreach-project
# Analyze with verbose output
java -jar cli/build/libs/cli-1.0.7.jar analyze /path/to/project --verbose
# Analyze with parallel execution (faster)
java -jar cli/build/libs/cli-1.0.7.jar analyze /path/to/project --parallel --threads 8# List all available inspections
java -jar cli/build/libs/cli-1.0.7.jar list-inspections
# List only ERROR severity
java -jar cli/build/libs/cli-1.0.7.jar list-inspections --severity ERROR
# List by category
java -jar cli/build/libs/cli-1.0.7.jar list-inspections --category SECURITY# Generate HTML, Markdown, and JSON reports
java -jar cli/build/libs/cli-1.0.7.jar analyze /path/to/project \
--format html,markdown,json \
--output ./brxm-reports
# Only report warnings and errors (skip info level)
java -jar cli/build/libs/cli-1.0.7.jar analyze /path/to/project \
--min-severity WARNING \
--output ./reports# Initialize configuration file
java -jar cli/build/libs/cli-1.0.7.jar config init > brxm-inspections.yaml
# Edit the configuration file to customize inspections
# Analyze using configuration
java -jar cli/build/libs/cli-1.0.7.jar analyze /path/to/project \
--config brxm-inspections.yaml# Exit with error code if issues found above threshold
java -jar cli/build/libs/cli-1.0.7.jar analyze /path/to/project \
--fail-on-error \
--max-errors 5
# Generate report for Jenkins/GitLab CI
java -jar cli/build/libs/cli-1.0.7.jar analyze /path/to/project \
--format json \
--output ./reports/analysis.jsonReal-time highlighting in editor:
Session session = repository.login(); // β ERROR: Session Leak
// ... code ...
// Missing: session.logout() in finally blockTool Window Display:
Bloomreach Inspections
βββββββββββββββββββββββββββββββββββββββββ
Total Issues: 47
π΄ Errors: 12
π‘ Warnings: 23
π΅ Info: 10
π‘ Hints: 2
By Category:
Repository Tier: 12 issues
Configuration: 18 issues
Performance: 14 issues
Security: 3 issues
Files with Issues: 8
βββββββββββββββββββββββββββββββββββββββββ
Recent Issues:
π΄ repository.session-leak at SessionService.java:42
JCR Session not closed in finally block
π΄ security.hardcoded-credentials at DatabaseConfig.java:23
Hardcoded password detected in configuration
π‘ performance.unbounded-query at ContentDAO.java:156
Query executed without setLimit()
π‘ config.sitemap-shadowing at sitemap.xml:45
General pattern shadows specific pattern
Analysis output:
$ java -jar cli-1.0.7.jar analyze /path/to/project
Bloomreach CMS Inspections - Analyzing project
ββββββββββββββββββββββββββββββββββββββββββββββ
Scanning project structure...
Found 1,234 files to analyze
[ββββββββββββββββββββββββββββββββββββββββββ] 62% (765/1234) - SessionService.java
Analysis complete in 45.3s
ANALYSIS RESULTS
ββββββββββββββββββββββββββββββββββββββββββββββ
Total Issues Found: 47
Severity Breakdown:
π΄ Errors: 12 (Critical - Requires immediate attention)
π‘ Warnings: 23 (Important - Should be addressed)
π΅ Info: 10 (Informational - Optimization opportunities)
π‘ Hints: 2 (Suggestions - Consider for improvement)
By Category:
Repository Tier: 12 issues β³ SessionService, ContentDAO
Configuration: 18 issues β³ SitemapConfig, CacheConfig
Performance: 14 issues β³ QueryDAO, HttpClient
Security: 3 issues β³ Credentials, Authentication
Deployment: 0 issues β
Top Issues:
π΄ 12 occurrences of JCR Session Leak (repository.session-leak)
π΄ 3 occurrences of Bootstrap UUID Conflict (config.bootstrap-uuid-conflict)
π‘ 15 occurrences of Unbounded Query (performance.unbounded-query)
FILES WITH MOST ISSUES
ββββββββββββββββββββββββββββββββββββββββββββββ
1. SessionService.java 8 issues
2. ContentDAO.java 6 issues
3. SitemapConfiguration.xml 5 issues
4. CacheConfig.java 4 issues
5. DatabaseConfiguration.java 3 issues
REPORTS GENERATED
ββββββββββββββββββββββββββββββββββββββββββββββ
Generated in: ./brxm-inspection-reports
Files:
β inspection-report.html (Detailed interactive report)
β inspection-report.md (Markdown for documentation)
β inspection-report.json (Machine-readable format)
Next Steps:
1. Review issues in inspection-report.html
2. Address π΄ Errors first (critical issues)
3. Use Alt+Enter in IDE to apply quick fixes
4. Run analysis again to verify fixesJSON Report Sample:
{
"analysis": {
"project": "/path/to/project",
"timestamp": "2025-12-11T10:30:00Z",
"duration": "45.3s",
"fileCount": 1234,
"summary": {
"totalIssues": 47,
"byServerity": {
"ERROR": 12,
"WARNING": 23,
"INFO": 10,
"HINT": 2
}
},
"issues": [
{
"id": "repository.session-leak",
"severity": "ERROR",
"file": "src/main/java/SessionService.java",
"line": 42,
"message": "JCR Session 'session' is not closed in finally block",
"description": "Unclosed sessions cause session pool exhaustion...",
"quickFix": "Add finally block with session.logout()"
}
]
}
}- User Guide - Complete usage guide for plugin and CLI
- Inspection Catalog - All inspections with examples
- Configuration Reference - Configuration options
- Developer Guide - Adding custom inspections
- Sprint Summaries - Implementation progress and details
Settings > Tools > Bloomreach CMS Inspections
- Enable/disable all inspections
- Toggle parse cache
- Configure parallel execution
Settings > Editor > Inspections > Bloomreach CMS
- Enable/disable individual inspections
- Set severity levels per inspection
Create brxm-inspections.yaml:
enabled: true
minSeverity: INFO
parallel: true
maxThreads: 8
cacheEnabled: true
excludePaths:
- "**/target/**"
- "**/build/**"
inspections:
repository.session-leak:
enabled: true
severity: ERROR
performance.unbounded-query:
enabled: true
severity: WARNINGbrxm-inspections-tool/
βββ core/ # Framework-agnostic inspection engine
β βββ engine/ # Execution engine, caching, indexing
β βββ inspections/ # All inspection implementations
β βββ parsers/ # Java, XML, YAML parsers
β βββ config/ # Configuration management
β
βββ intellij-plugin/ # IntelliJ IDEA plugin
β βββ inspections/ # IDE inspection wrappers
β βββ bridge/ # Core <-> IDE adapters
β βββ services/ # Project-level services
β βββ toolwindow/ # UI components
β
βββ cli/ # Standalone CLI tool
βββ commands/ # CLI command implementations
βββ runner/ # File scanning, analysis coordination
- Separation of Concerns - Core logic independent of IDE/CLI
- Plugin Architecture - Easy to add new inspections
- Performance First - Parallel execution, caching, incremental analysis
- Extensibility - ServiceLoader-based inspection discovery
# All tests
./gradlew test
# Core tests only
./gradlew :core:test
# Build everything
./gradlew buildSample files for testing inspections are in test-samples/:
cd test-samples
java -jar ../cli/build/libs/cli-1.0.7.jar analyze .See test-samples/README.md for details.
| ID | Name | Severity | Description |
|---|---|---|---|
repository.session-leak |
JCR Session Leak Detection | π΄ ERROR | Detects JCR sessions not closed in finally blocks. Unclosed sessions cause session pool exhaustion and memory leaks. |
repository.session-refresh |
Dangerous Session.refresh() Call | π΄ ERROR | Detects unsafe use of session.refresh() which can cause data consistency issues. |
repository.content-bean-mapping |
Content Bean Mapping Issues | π‘ WARNING | Identifies issues in content bean JCR-to-POJO mapping and property access. |
repository.document-workflow |
Document Workflow Implementation Issues | π‘ WARNING | Detects problems in SCXML workflow implementations. |
repository.workflow-action |
Workflow Action Availability Check | π‘ WARNING | Ensures workflow actions check availability before execution. |
| ID | Name | Severity | Description |
|---|---|---|---|
config.bootstrap-uuid-conflict |
Bootstrap UUID Conflict | π΄ ERROR | Detects duplicate UUIDs in hippoecm-extension.xml files that cause bootstrap failures. |
config.sitemap-shadowing |
Sitemap Pattern Shadowing | π‘ WARNING | Identifies HST sitemap patterns where general patterns shadow specific ones. |
config.component-parameter-null |
Component Parameter Null Check | π‘ WARNING | Detects HST component parameters accessed without null checks. |
config.cache-configuration |
Cache Configuration Issues | π‘ WARNING | Identifies caching configuration problems and optimization opportunities. |
config.hst-component-lifecycle |
HST Component Lifecycle Issues | π‘ WARNING | Detects improper HST component lifecycle management. |
config.hst-component-thread-safety |
HST Component Thread Safety | π‘ WARNING | Identifies thread safety issues in HST component implementations. |
config.http-session-use |
HttpSession Usage in HST | π‘ WARNING | Detects improper HttpSession usage in stateless HST components. |
config.hst-filter |
HST Filter Implementation Issues | π‘ WARNING | Identifies problems in HST filter configuration and implementation. |
config.system-out-calls |
System.out/err Usage | π΅ INFO | Detects System.out/err calls that should use logging. |
config.static-request-session |
Static Request/Session Storage | π΄ ERROR | Detects static storage of request/session objects causing concurrency bugs. |
| ID | Name | Severity | Description |
|---|---|---|---|
performance.unbounded-query |
Unbounded JCR Query | π‘ WARNING | Detects JCR queries without setLimit() causing memory exhaustion. |
performance.missing-index |
Missing Database Index | π΅ INFO | Identifies potential missing database indexes on queried properties. |
performance.get-documents |
HippoFolder.getDocuments() Performance | π‘ WARNING | Detects inefficient use of getDocuments() that can cause performance issues. |
performance.get-size |
HstQueryResult.getSize() Performance | π‘ WARNING | Identifies inefficient getSize() calls that count all results. |
performance.http-calls |
Synchronous HTTP Calls | π‘ WARNING | Detects blocking HTTP calls in HST components. |
| ID | Name | Severity | Description |
|---|---|---|---|
security.hardcoded-credentials |
Hardcoded Credentials | π΄ ERROR | Detects hardcoded passwords, API keys, and access tokens in code. |
security.hardcoded-paths |
Hardcoded JCR Paths | π‘ WARNING | Identifies hardcoded JCR paths that reduce configuration flexibility and security. |
security.rest-authentication |
Missing REST Authentication | π΄ ERROR | Detects REST endpoints without proper authentication. |
security.jcr-parameter-binding |
JCR SQL Injection | π΄ ERROR | Detects SQL injection vulnerabilities from string concatenation in queries. |
security.missing-jsp-escaping |
Missing XSS Escaping | π΄ ERROR | Identifies missing output escaping that can cause XSS vulnerabilities. |
| ID | Name | Severity | Description |
|---|---|---|---|
deployment.docker-config |
Docker/Kubernetes Configuration | π‘ WARNING | Identifies Docker and Kubernetes configuration issues. |
- π΄ ERROR - Critical issue requiring immediate attention
- π‘ WARNING - Important issue that should be addressed
- π΅ INFO - Informational issue for optimization
- π‘ HINT - Suggestion for improvement
We welcome contributions! To add a new inspection:
- Create inspection class in
core/src/main/kotlin/org/bloomreach/inspections/core/inspections/{category}/ - Implement
Inspectioninterface with required properties (id, name, description, category, severity, applicableFileTypes) - Create AST visitor or parser for analysis logic
- Add unit tests in
core/src/test/kotlin/ - Register in
META-INF/services/org.bloomreach.inspections.core.engine.Inspection - (Optional) Create IDE wrapper in
intellij-plugin/src/main/kotlin/.../inspections/ - (Optional) Register wrapper in
plugin.xml
See Developer Guide for detailed examples and best practices.
| Component | Status | Inspections | Coverage |
|---|---|---|---|
| Core Engine | β Complete | 38 inspections | 100% |
| IntelliJ Plugin | β Complete | 38 wrappers | 93% tests |
| CLI Tool | β Complete | Full support | - |
| Documentation | β Complete | Comprehensive | 100% |
- β
38 core inspections implemented across all categories
- 5 Repository Tier inspections
- 10 Configuration inspections
- 5 Performance inspections
- 5 Security inspections
- 1 Deployment inspection
- β IntelliJ plugin with real-time analysis (12+ inspection wrappers)
- β CLI tool with progress reporting and batch analysis
- β ServiceLoader-based dynamic discovery
- β Parallel execution engine for performance
- β Smart parse caching and AST reuse
- β Project-wide cross-file indexing
- β Quick fixes for most inspections
- β Tool window with statistics and filtering
- β Comprehensive settings panel
- β Full test coverage (93 tests, 100% pass rate)
- π Report Generation - Enhanced HTML/Markdown/JSON output formats
- π Quick Fixes - Expand quick fix support for more inspections
- π Custom Rules - User-defined inspection rules and patterns
- π Gradle Plugin - Gradle plugin for build-time analysis
- π Maven Plugin - Maven plugin for CI/CD integration
- π VS Code Extension - Visual Studio Code extension support
- π JetBrains Marketplace - Publish IntelliJ plugin to official marketplace
- π Additional Inspections - Community-requested inspections based on forum analysis
Built with analysis of 1,700+ Bloomreach community forum topics to identify the most common real-world issues faced by developers.
Inspired by:
- intellij-hippoecm plugin by @machak
- Bloomreach Community feedback and issues
- IntelliJ Platform inspection framework
- Picocli CLI framework
Apache License 2.0
Copyright 2025 Bloomreach
- Issues: Create an issue in this repository
- Community: Bloomreach Community
- Documentation: Bloomreach Documentation
- User Guide - Complete usage documentation
- Inspection Catalog - Detailed inspection guide with examples
- Configuration Reference - All configuration options
- Developer Guide - Guide for adding custom inspections
- Test Samples - Example problematic and correct code
- Build Verification - Build and test setup
- Implementation Plan - Technical architecture
- Sprint 1 Summary - Core engine foundation
- Sprint 3 Summary - IntelliJ plugin completion
Built with β€οΈ for the Bloomreach Community