PHPackages                             k-kinzal/lm-cc-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. k-kinzal/lm-cc-php

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

k-kinzal/lm-cc-php
==================

LM-CC: Language Model Code Complexity metric for PHP

v0.2.0(2w ago)02↓100%MITPHPPHP &gt;=8.1CI passing

Since Mar 5Pushed 2w agoCompare

[ Source](https://github.com/k-kinzal/lm-cc-php)[ Packagist](https://packagist.org/packages/k-kinzal/lm-cc-php)[ Docs](https://github.com/k-kinzal/lm-cc-php)[ RSS](/packages/k-kinzal-lm-cc-php/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

LM-CC PHP
=========

[](#lm-cc-php)

**Language Model Code Complexity** metric for PHP codebases.

LM-CC measures code complexity from the LLM's perspective. Based on [arXiv:2602.07882](https://arxiv.org/abs/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
------------

[](#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
-----------

[](#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
-------------

[](#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](docs/usage.md) for all options.

CI Integration
--------------

[](#ci-integration)

```
# GitHub Actions
- name: LM-CC Analysis
  run: vendor/bin/lm-cc analyze src/ --threshold 50.0
```

See [docs/ci-integration.md](docs/ci-integration.md) for full examples.

Documentation
-------------

[](#documentation)

- [What is LM-CC?](docs/lm-cc.md) — Theory and formula
- [Installation](docs/installation.md) — Backend setup
- [Usage](docs/usage.md) — CLI reference
- [CI Integration](docs/ci-integration.md) — Pipeline setup

Acknowledgments
---------------

[](#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](https://arxiv.org/abs/2602.07882), 2025.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

36

—

LowBetter than 83% of packages

Maintenance96

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

17d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4458a22db62c885006248e08715301bcb73e78c1057e2bbf686af001729165d5?d=identicon)[kinzal](/maintainers/kinzal)

---

Top Contributors

[![k-kinzal](https://avatars.githubusercontent.com/u/1281825?v=4)](https://github.com/k-kinzal "k-kinzal (3 commits)")

---

Tags

static analysiscode qualitycillmcode-complexity

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/k-kinzal-lm-cc-php/health.svg)

```
[![Health](https://phpackages.com/badges/k-kinzal-lm-cc-php/health.svg)](https://phpackages.com/packages/k-kinzal-lm-cc-php)
```

###  Alternatives

[andres-montanez/magallanes

The Deployment Tool for PHP Applications

6951.1M5](/packages/andres-montanez-magallanes)[acquia/orca

A tool for testing a company's software packages together in the context of a realistic, functioning, best practices Drupal build

32896.7k](/packages/acquia-orca)[shopware/deployment-helper

Shopware deployment tools

19276.3k4](/packages/shopware-deployment-helper)[klapaudius/symfony-mcp-server

Build your own LLM tools inside your symfony project by adding to it a Model Context Protocol Server

2614.3k](/packages/klapaudius-symfony-mcp-server)[kohkimakimoto/altax

Altax is an extensible deployment tool for PHP.

2002.8k](/packages/kohkimakimoto-altax)[mmoreram/translation-server

PHP translation server

233.7k2](/packages/mmoreram-translation-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
