Skip to main content

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 dependencies
  • code_issues.yaml: Detailed report of code quality issues
  • method_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 pass statements
  • NotImplementedError in non-abstract methods
  • Files exceeding line limit
  • Usage of Any type 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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Run the linters and fix any issues
  6. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Vasiliy Zdanovskiy

Changelog

1.0.2

  • Changed console command name from code-analysis to code_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)

Source distribution for code-analysis-tool 1.0.3
File Size Uploaded Provenance
code_analysis_tool-1.0.3.tar.gz 18.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for code-analysis-tool 1.0.3
File Interpreter ABI Platform
code_analysis_tool-1.0.3-py3-none-any.whl Python 3 none any Details

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page