Pycode-Info is a Python toolkit for analyzing codebases. It provides language statistics, code complexity heatmaps, and integrates with Flake8 for linting reports. The tool is designed to help developers quickly understand the structure and quality of their code.
-
Language Statistics:
Summarizes the programming languages in your project, showing file counts, total size, and line counts per language with a visual usage bar. -
Cyclomatic Complexity Viewer:
Analyzes Python files for cyclomatic complexity, highlighting complex functions and providing a heatmap of code complexity. -
Flake8 Integration:
Runs Flake8 on all Python files and summarizes errors and warnings in a readable format.
The Flake8 report summarizes errors and warnings in your codebase:
{
"./main.py": [
{
"line_number": 5,
"column_number": 80,
"text": "line too long (115 > 79 characters)",
"code": "E501"
},
{
"line_number": 14,
"column_number": 80,
"text": "line too long (81 > 79 characters)",
"code": "E501"
}
]
}Run the tool from your project root:
python main.py summary # Show language statistics
python main.py heatmap # Show cyclomatic complexity heatmap for all Python files
python main.py flake8 # Run Flake8 and print a summary reportYou can also use the main features in your own scripts:
from pycode_info.lang_info import print_language_summary
from pycode_info.ccv import analyze_all_files_in_workspace
from pycode_info.flake8er import print_flake8_report
print_language_summary()
analyze_all_files_in_workspace()
print_flake8_report()- Logical Lines: Count only lines containing code.
- Comment Lines: Count only lines containing comments.
- Hotspot Gatherer: Identify the most edited files.
- Added/Removed Lines: Track code churn.
- Cyclomatic Complexity Viewer: Enhanced visualization and reporting.
MIT License
Developed by Justus Decker - Copyright 2025