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

Since Mar 5Pushed 2mo 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 1mo 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

33

—

LowBetter than 75% of packages

Maintenance87

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

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

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M650](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

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

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[acquia/orca

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

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

Shopware deployment tools

19305.3k5](/packages/shopware-deployment-helper)

PHPackages © 2026

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