Open Johnnyevans32 opened 16 hours ago
The Code Complexity Analyzer Toolkit automates the analysis of Python codebases, evaluating key complexity metrics to assess code quality and maintainability.
profiles.yaml
my-profile: provider: openai processor: gpt-4o accelerator: gpt-4o-mini moderator: passive toolkits: - developer - complexity_analyzer
goose session start --profile my-profile
analyze complexity "<directory_path>"
The toolkit returns a dictionary with the following keys:
Example:
{ "avg_cyclomatic_complexity": 5.2, "avg_halstead_complexity": 140.1, "avg_maintainability_index": 68.5, "errors": [] }
Run tests using unittest:
unittest
uv run pytest tests -m "not integration"
goose-plugins
pyproject.toml
[project.entry-points."goose.toolkit"] complexity_analyzer = "goose.toolkit.complexity_analyzer:CodeComplexityToolkit"
Code Complexity Analyzer Toolkit for Goose
Resolves #62
Overview
The Code Complexity Analyzer Toolkit automates the analysis of Python codebases, evaluating key complexity metrics to assess code quality and maintainability.
Features
Usage
profiles.yaml
:Output
The toolkit returns a dictionary with the following keys:
Example:
Testing
Run tests using
unittest
:🛠️ Adding to
goose-plugins
pyproject.toml