codemetry/core
最新稳定版本:v1.4.1
Composer 安装命令:
composer require codemetry/core
包简介
Framework-agnostic Git repository analysis pipeline
README 文档
README
Framework-agnostic Git repository analysis pipeline that produces a metrics-based "mood proxy" (bad/medium/good) for each day or time window.
This package provides the core analysis engine. For Laravel integration, see codemetry/laravel.
Documentation | Getting Started
Requirements
- PHP 8.2+
- Git
Installation
composer require codemetry/core
Usage
use Codemetry\Core\Analyzer; use Codemetry\Core\Domain\AnalysisRequest; $analyzer = new Analyzer(); $request = new AnalysisRequest( days: 7, branch: 'main', ); $result = $analyzer->analyze('/path/to/repo', $request); foreach ($result->windows as $mood) { echo "{$mood->windowLabel}: {$mood->moodLabel->value} ({$mood->moodScore}%)\n"; }
Signal Providers
Built-in providers that generate metrics for each analysis window:
| Provider | Signals |
|---|---|
| ChangeShape | Additions, deletions, churn, commit count, files touched, churn per commit, scatter |
| CommitMessage | Fix/revert/wip keyword counts, fix ratio |
| FollowUpFix | Commits touching the same files within a configurable horizon, fix density |
Extending
Add a custom signal provider by implementing the SignalProvider interface:
use Codemetry\Core\Signals\SignalProvider; use Codemetry\Core\Domain\RepoSnapshot; use Codemetry\Core\Domain\SignalSet; use Codemetry\Core\Signals\ProviderContext; class MyProvider implements SignalProvider { public function id(): string { return 'my_provider'; } public function provide(RepoSnapshot $snapshot, ProviderContext $ctx): SignalSet { // Compute and return signals } }
Privacy
- All analysis runs locally via Git commands against your repository.
- No data is sent to external services unless AI engines are explicitly enabled.
License
MIT
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-05