Code Analysis Tool
A comprehensive Python code analysis tool that generates code maps, detects issues, and provides detailed reports.
Features
- Code Mapping: Generates comprehensive maps of classes, functions, and dependencies
- Issue Detection: Identifies code quality problems and violations
- Multiple Report Formats: Outputs reports in YAML format
- Configurable Analysis: Customizable file size limits and analysis parameters
- CLI Interface: Easy-to-use command-line interface
Installation
From PyPI (recommended)
pip install code-analysis-tool
From source
git clone https://github.com/vasilyvz/code-analysis-tool.git
cd code-analysis-tool
pip install -e .
Usage
Basic usage
code_mapper
This will analyze the current directory and generate reports in the code_analysis folder.
Advanced usage
code_mapper --root-dir ./src --output-dir ./reports --max-lines 500 --verbose
Command line options
--root-dir, -r: Root directory to analyze (default: current directory)--output-dir, -o: Output directory for reports (default: code_analysis)--max-lines, -m: Maximum lines per file (default: 400)--verbose, -v: Enable verbose output--version: Show version information
Output Files
The tool generates the following files in the output directory:
code_map.yaml: Complete code map with classes, functions, and dependenciescode_issues.yaml: Detailed report of code quality issuesmethod_index.yaml: Index of methods organized by class
Detected Issues
The tool detects various code quality issues:
- Files without docstrings
- Classes without docstrings
- Methods without docstrings
- Methods with only
passstatements NotImplementedErrorin non-abstract methods- Files exceeding line limit
- Usage of
Anytype annotations - Generic exception handling
- Imports in the middle of files
Development
Setup development environment
git clone https://github.com/vasilyvz/code-analysis-tool.git
cd code-analysis-tool
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e ".[dev]"
Running tests
pytest
Code formatting
black .
flake8 .
mypy .
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Run the linters and fix any issues
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Vasiliy Zdanovskiy
- Email: vasilyvz@gmail.com
- GitHub: @vasilyvz
Changelog
1.0.2
- Changed console command name from
code-analysistocode_mapper - Fixed .gitignore to properly track source code directory
- All code quality checks passed
1.0.1
- Package configuration improvements
- Enhanced documentation
1.0.0
- Initial release
- Basic code analysis functionality
- CLI interface
- YAML report generation
- Issue detection
Metadata
Release files for code-analysis-tool 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| code_analysis_tool-1.0.3.tar.gz | 18.0 kB | Without provenance | Details for code_analysis_tool-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| code_analysis_tool-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for code_analysis_tool-1.0.3-py3-none-any.whl |
Total release size: 31.1 kB
Release files / code_analysis_tool-1.0.3.tar.gz
| Download URL | code_analysis_tool-1.0.3.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
550623e5d6cae1c6313a6bbc2b3159b03d8dcd21afb5b10d2394ba0d4d43731a
|
|
BLAKE2b-256 checksum How to use checksums |
ddc6acc2f64abe316c285d811a28df6d5e4437425dd404417a7061af65b8faa5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / code_analysis_tool-1.0.3-py3-none-any.whl
| Download URL | code_analysis_tool-1.0.3-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b30266824e73661874105464c3cfad2d60d9847fb0270436c536b89bf5411635
|
|
BLAKE2b-256 checksum How to use checksums |
4a9ba5a672fd2c96d53ce583d841d7bf028ccf37d0f4310e6ec43e5587b05ac3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for code-analysis-tool 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.