Overview
CodeChecker is a Java-based static analysis tool built to evaluate code style and cyclomatic complexity in Java source files. The project emphasizes clean architecture, modular analysis passes, and automation-friendly output formats.
🚀 Features
Code Style Analysis
- Indentation validation (tabs and non-4-space indents)
- Detection of TODO and FIXME comments
- Trailing whitespace detection
Cyclomatic Complexity
- File-level cyclomatic complexity
- Method-level complexity analysis
- Detection of logical operators, loops, conditionals, and switches
Developer Tooling
- Command-line execution
- GitHub Actions CI integration
- Clean, conditional output reporting
JSON Output
- Optional structured JSON output
JsonReportGeneratorfor programmatic consumption
CodeChecker in Action 🚀
Below is a live demonstration of CodeChecker running in the terminal and printing analysis results in real time.
What this demo shows:
- Running CodeChecker on a Java file
- Simple & Advanced Cyclomatic Complexity
- Per-method complexity analysis
- Clean console output
- Optional JSON output support
🧠 How CodeChecker Works
- The entry point (
Main.java) reads the file path via CLI - Each checker analyzes the file independently
- Results are aggregated and printed only if issues exist
- Complexity metrics are computed using control-flow keywords
This modular design allows easy extension of new checks without impacting existing functionality.
🏗 Architecture Overview
Each checker follows the single-responsibility principle, ensuring clarity and testability.
📊 Example Output
=== CodeChecker ===
Simple Cyclomatic Complexity:
Total Complexity: 10
Advanced Cyclomatic Complexity per method:
Method: main → Complexity: 10
File Total Complexity: 10
No code style issues found!
⭐ Usage
Console Mode
java -cp src/main/java Main <filepath>
JSON Mode
java -cp src/main/java Main <filepath> --json
Sample JSON Output
{
"file": "src/ComplexityTest.java",
"indentationIssues": [],
"todoIssues": [],
"trailingWhitespaceIssues": [],
"simpleCyclomaticComplexity": 10,
"advancedCyclomaticComplexityTotal": 10,
"advancedCyclomaticComplexityPerMethod": { "main": 10 },
"anyIssues": false
}
🛣 Future Enhancements
- Configuration file support
- Package-level analysis
- Integration with build tools (Maven / Gradle)
- IDE plugin support
🎓 Academic & Portfolio Context
This project demonstrates strong Java fundamentals, understanding of software quality metrics, and practical static analysis design. It was built with clean architecture principles and CI automation, making it suitable as a systems-oriented portfolio project.