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(3mo ago)02MITPHPPHP &gt;=8.1CI passing

Since Mar 5Pushed 3mo 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 3w ago

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

31

—

LowBetter than 66% of packages

Maintenance79

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

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

111d 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

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M518](/packages/shopware-core)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54642.4k4](/packages/jolicode-castor)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)[chameleon-system/chameleon-base

The Chameleon System core.

1027.9k4](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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