A Tier 1 SonarQube plugin providing comprehensive code quality analysis for Wolfram Mathematica with 559 rules, comparable to Java and Python support.
# 1. Install the plugin
cp wolfralyze-*.jar $SONARQUBE_HOME/extensions/plugins/
# Restart SonarQube
# 2. Configure your project
cat > sonar-project.properties << EOF
sonar.projectKey=my-mathematica-project
sonar.sources=.
sonar.inclusions=**/*.m,**/*.wl,**/*.wls
EOF
# 3. Run analysis
sonar-scannerView results at http://localhost:9000
π Full Documentation: https://github.com/bceverly/wolfralyze/wiki
The plugin includes native test coverage support with automatic line-by-line coverage tracking in SonarQube.
(* 1. Load the coverage utility *)
Get["CoverageUtils.wl"]
(* 2. Run your tests with coverage tracking *)
(* ... your test execution code ... *)
(* 3. Export coverage data *)
CoverageUtils`ExportCoverageJSON[coverageData, "coverage/coverage.json"]# 4. Run SonarQube scan (coverage is imported automatically)
sonar-scanner- β Automatic JSON Export - Converts Wolfram Association structures to clean JSON
- β Data Validation - Validates coverage data structure before export
- β Line-by-Line Coverage - Includes hit counts for every line of code
- β Native SonarQube Integration - Coverage appears directly in SonarQube UI
- β Efficient Format - Optimized for large codebases
- β AGPLv3 Licensed - Free to use in your projects
See the Wolfralyze Test Project for a complete working example including:
- β
Test runner with coverage tracking (
RunTests.wl) - β Sample Mathematica code with intentional issues
- β
Unit tests using
VerificationTest - β SonarQube project configuration
- β Makefile for easy automation
- β Full documentation and examples
π Coverage Documentation: See the Test Coverage Guide on the wiki for detailed instructions.
| Category | Rules | Description |
|---|---|---|
| Security Vulnerabilities | 30 | SQL injection, XSS, command injection, hardcoded credentials |
| Security Hotspots | 25 | Weak cryptography, authentication issues, certificate validation |
| Bugs | 200 | Null safety, resource leaks, type mismatches, infinite loops |
| Code Smells | 304 | Performance, complexity, readability, coding standards, best practices |
- β Taint Analysis - Track untrusted data through your code
- β Symbol Table - Cross-file analysis with full symbol resolution
- β Type Inference - Understand variable types through patterns
- β Data Flow - Track values, nulls, and resources
- β Control Flow - Detect unreachable code and infinite loops
- β Quick Fixes - 53 automated code corrections
- β Custom Rules - 3 templates for project-specific patterns
Covers 9 of 10 OWASP Top 10 2021 categories including injection, broken authentication, XSS, and more.
Complete documentation available on the Wiki:
- Installation - Install in 5 minutes
- Configuration - Set up your first project
- Quick Start - Run your first scan
- Test Project - Complete working example with tests and coverage
- Rule Catalog - All 559 rules indexed
- Security Vulnerabilities - Critical security issues
- Bug Detection - Reliability problems
- Code Smells - Maintainability issues
- Test Coverage - Set up and use test coverage
- Best Practices - Writing clean Mathematica code
- Troubleshooting - Common issues and solutions
- FAQ - Frequently asked questions
- CI/CD Integration - GitHub Actions, GitLab, Jenkins
- Architecture - Plugin internals
- Contributing - How to contribute
- Roadmap - Future development
- Detect vulnerabilities before they reach production
- OWASP Top 10 coverage with real Mathematica examples
- Taint analysis tracks untrusted data flows
- Hardcoded secret detection prevents credential leaks
- 1000Γ speedups by detecting AppendTo in loops
- Compilation opportunities - Find code that should use Compile[]
- Pattern optimization - Avoid catastrophic backtracking
- Memory leak detection - Prevent growing definition chains
- 200 bug rules catch runtime errors before they happen
- 304 code smell rules improve maintainability and coding standards
- Complexity metrics highlight code that needs refactoring
- Duplicate detection finds copy-paste code
- 53 Quick Fixes - One-click automated corrections
- IDE integration - Real-time feedback via SonarLint
- CI/CD ready - Works with GitHub Actions, GitLab, Jenkins
- Custom rules - Define project-specific patterns
This plugin provides best-in-class Mathematica support, comparable to major languages:
| Feature | Java | Python | Mathematica |
|---|---|---|---|
| Rules | 733 | 410 | 559 β |
| AST Parser | β | β | β |
| Symbol Table | β | β | β |
| Type System | β | β | β |
| Data Flow | β | β | β |
| Control Flow | β | β | β |
| Taint Analysis | β | β | β |
| Test Coverage | β | β | β |
| Quick Fixes | β | β | β |
| Custom Rules | β | β | β |
# Clone the repository
git clone git@github.com:bceverly/wolfralyze.git
cd wolfralyze
# Build
gradle clean build
# JAR file created at:
# build/libs/wolfralyze-*.jar
# SBOM (Software Bill of Materials) created at:
# build/reports/wolfralyze-*-sbom.json- Java 11+
- Gradle 8.0+
- SonarQube 9.9+ (LTS) or 10.x
Each release includes a CycloneDX SBOM (Software Bill of Materials) for transparency and security compliance:
- Format: CycloneDX 1.5 (JSON)
- What it contains: Complete dependency inventory with versions, licenses, and component metadata
- Why it matters: Enables supply chain security auditing, vulnerability tracking, and compliance verification
- Generated by: CycloneDX Gradle Plugin
- Verification: Each release includes SHA256 checksums for both JAR and SBOM files
For more details, see the SBOM Documentation.
Contributions are welcome! Please see:
- Define rule in
*RulesDefinition.java - Implement detector in
*Detector.java - Add tests
- Update documentation
- Submit pull request
See Architecture for details.
AGPL-3.0 License - See LICENSE for details.
- Documentation: https://github.com/bceverly/wolfralyze/wiki
- Issues: https://github.com/bceverly/wolfralyze/issues
- Discussions: https://github.com/bceverly/wolfralyze/discussions
- Total Rules: 559
- Lines of Code: 50,000+
- Test Coverage: Comprehensive detector tests
- Performance: Optimized for 12,000+ file codebases
- Documentation: 293 KB complete wiki
- Status: Tier 1 - Production Ready
Latest Version: 0.9.7+ Status: β Tier 1 Achieved (November 2025)