k-kinzal/lm-cc-php
最新稳定版本:v0.2.0
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.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-05