k-kinzal/lm-cc-php
Composer 安装命令:
composer require k-kinzal/lm-cc-php
包简介
LM-CC: Language Model Code Complexity metric for PHP
README 文档
README
Language Model Code Complexity metric for PHP codebases.
LM-CC measures code complexity from the LLM's perspective. Based on arXiv:2602.07882, it correlates at r=-0.92 to -0.97 with LLM task performance — lowering LM-CC improves LLM repair (+20.9%) and translation (+10.2%) success rates.
Installation
composer require k-kinzal/lm-cc-php
Requires an LLM backend:
# Option A: Ollama (recommended, free, local) ollama pull llama3 ollama serve # Option B: OpenAI API export LMCC_API_KEY=sk-...
Quick Start
# Analyze source directory vendor/bin/lm-cc analyze src/ # With CI threshold (exit code 1 if exceeded) vendor/bin/lm-cc analyze src/ --threshold 50.0 # JSON output vendor/bin/lm-cc analyze src/ --format json # Generate config file vendor/bin/lm-cc init
Configuration
Place lm-cc.yaml in your project root:
backend: ollama model: llama3 base_url: "http://localhost:11434" alpha: 0.8 percentile: 67.0 threshold: 50.0 format: text exclude: - "vendor/*" - "tests/*"
See docs/usage.md for all options.
CI Integration
# GitHub Actions - name: LM-CC Analysis run: vendor/bin/lm-cc analyze src/ --threshold 50.0
See docs/ci-integration.md for full examples.
Documentation
- What is LM-CC? — Theory and formula
- Installation — Backend setup
- Usage — CLI reference
- CI Integration — Pipeline setup
Acknowledgments
This tool is an implementation of the LM-CC metric proposed in:
Mingjie Liu, Zichao Li, Chengyu Huang, Yihong Dong, Yongqiang Chen, Shuijing He, Bo Zheng, and Ge Li. LM-CC: Language Model Code Complexity — A New Metric from the LLM's Perspective. arXiv:2602.07882, 2025.
License
MIT — see LICENSE.
k-kinzal/lm-cc-php 适用场景与选型建议
k-kinzal/lm-cc-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ci」 「static-analysis」 「code-quality」 「llm」 「code-complexity」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 k-kinzal/lm-cc-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 k-kinzal/lm-cc-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 k-kinzal/lm-cc-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Check a project's code coverage, optionally enforcing a minimum value
A generic package for implementing Laravel Pint coding standards across Laravel packages
PHPStan extension for detecting parameters that should use SensitiveParameter
Provider-agnostic code review guardian for PHP projects. Works with any PHP project (Symfony, Laravel, Yii, CodeIgniter, etc.) and any Git provider (GitHub, GitLab, Bitbucket, etc.)
Validates PHPDoc @param and @return tags against method signatures
Rules for the bdd-analyser CLI tool
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-05