A Python-based Static Code Analysis Tool that analyzes Python source code using the Abstract Syntax Tree (AST) module. The platform evaluates code quality, software metrics, maintainability, security, and coding standards, and generates detailed reports in multiple formats.
- Function Count
- Class Count
- Import Count
- Total Lines of Code
- Code, Blank and Comment Line Count
- Cyclomatic Complexity
- Function Complexity Analysis
- File-wise Metrics
- Duplicate Function Detection
- Dead Code Detection
- Unused Import Detection
- Unused Variable Detection
- Long Function Detection
- Missing Docstring Detection
- Naming Convention Checker
- Function Argument Checker
- Nested Loop Detection
- Recursive Function Detection
- Lambda Function Detection
- Import Alias Detection
- Hardcoded Password Detection
- Empty Exception Handler Detection
- Global Variable Detection
- Magic Number Detection
- Try Blocks Without Finally
- Classes Without
__init__() - Large Class Detection
- Classes With Too Many Methods
- Inheritance Detection
- HTML Dashboard
- JSON Report
- Summary Chart
- Requirements File Generator
- README Generator
The following report was generated by analyzing the sample project included in this repository.
| Metric | Value |
|---|---|
| Overall Score | 84.83 / 100 |
| Grade | B |
| Complexity Rating | Excellent |
| Maintainability Score | 60.08 |
| Security Score | 96 / 100 (Excellent) |
| Metric | Value |
|---|---|
| Functions | 4 |
| Classes | 1 |
| Imports | 1 |
| Total Lines | 27 |
| Code Lines | 15 |
| Blank Lines | 12 |
| Comment Lines | 0 |
| Complexity Score | 1 |
- Largest Function:
factorial()(4 lines) - Smallest Function:
add()(2 lines) - Average Function Size: 2.50 lines
| Category | Count |
|---|---|
| Duplicate Functions | 0 |
| Unused Imports | 1 |
| Unused Variables | 1 |
| Missing Docstrings | 4 |
| Long Functions | 0 |
| Empty Exception Handlers | 0 |
| Global Variables | 1 |
| Dead Code | 0 |
| Hardcoded Passwords | 0 |
| Large Classes | 0 |
- TODO : 0
- FIXME : 0
- BUG : 0
- No third-party packages detected.
Note: These results are generated from the sample project (
sample_projects/demo.py). Running the analyzer on another Python project will generate a different report.
- Python 3
- Abstract Syntax Tree (AST)
- JSON
- HTML
- Matplotlib
Code Intelligence and Analysis Platform
│
├── src/
│ ├── analyzer.py
│ ├── metrics.py
│ ├── report_generator.py
│ ├── html_report.py
│ ├── json_report.py
│ └── ...
│
├── sample_projects/
│ └── demo.py
│
├── main.py
├── README.md
├── requirements.txt
├── report.html
├── report.json
└── summary_chart.png
git clone <repository-link>cd Code-Intelligence-and-Analysis-Platformpip install -r requirements.txtpython main.pyRunning the project automatically generates:
report.html– Interactive HTML Dashboardreport.json– Machine-readable JSON Reportsummary_chart.png– Visual Summary Chart
- Supports Python projects only.
- Duplicate detection identifies exact matches only.
- Dynamic imports may not always be detected.
- Dead code detection may report false positives for dynamically referenced code.
- PDF Report Generation
- Streamlit Web Dashboard
- VS Code Extension
- GitHub Repository Analysis
- AI-powered Code Review Suggestions