定制 codemetry/core 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固