PHPackages                             sebastian/lines-of-code - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. sebastian/lines-of-code

ActiveLibrary[Testing &amp; Quality](/categories/testing)

sebastian/lines-of-code
=======================

Library for counting the lines of code in PHP source code

5.0.0(3mo ago)1.2k528.9M—5.5%8[3 issues](https://github.com/sebastianbergmann/lines-of-code/issues)[2 PRs](https://github.com/sebastianbergmann/lines-of-code/pulls)12BSD-3-ClausePHPPHP &gt;=8.4CI passing

Since Jul 22Pushed today2 watchersCompare

[ Source](https://github.com/sebastianbergmann/lines-of-code)[ Packagist](https://packagist.org/packages/sebastian/lines-of-code)[ Docs](https://github.com/sebastianbergmann/lines-of-code)[ GitHub Sponsors](https://github.com/sebastianbergmann)[ Fund](https://liberapay.com/sebastianbergmann)[ RSS](/packages/sebastian-lines-of-code/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (17)Used By (12)

[![Latest Stable Version](https://camo.githubusercontent.com/4c727cb814b8800db8ecd1fc932e598a27a155ba3dc7816f43c70256a68ed134/68747470733a2f2f706f7365722e707567782e6f72672f73656261737469616e2f6c696e65732d6f662d636f64652f76)](https://packagist.org/packages/sebastian/lines-of-code)[![CI Status](https://github.com/sebastianbergmann/lines-of-code/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/lines-of-code/actions)[![codecov](https://camo.githubusercontent.com/ce94076bb528b83a6e911c28f30121470c088427e5277acdf6d780e42daaf899/68747470733a2f2f636f6465636f762e696f2f67682f73656261737469616e626572676d616e6e2f6c696e65732d6f662d636f64652f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/sebastianbergmann/lines-of-code)

sebastian/lines-of-code
=======================

[](#sebastianlines-of-code)

Library for counting the lines of code in PHP source code.

Installation
------------

[](#installation)

You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):

```
composer require sebastian/lines-of-code

```

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

```
composer require --dev sebastian/lines-of-code

```

###  Health Score

74

↑

ExcellentBetter than 100% of packages

Maintenance92

Actively maintained with recent releases

Popularity77

Solid adoption and visibility

Community24

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 97.1% 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 ~135 days

Recently: every ~91 days

Total

16

Last Release

102d ago

Major Versions

1.0.x-dev → 3.0.02024-02-02

3.0.1 → 4.0.02025-02-07

2.0.x-dev → 3.0.x-dev2025-09-26

3.0.x-dev → 4.0.x-dev2025-12-31

4.0.x-dev → 5.0.02026-02-06

PHP version history (6 changes)1.0.0PHP ^7.3 || ^8.0

1.0.1PHP &gt;=7.3

2.0.0PHP &gt;=8.1

3.0.0PHP &gt;=8.2

4.0.0PHP &gt;=8.3

5.0.0PHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1089?v=4)[Sebastian Probst Eide](/maintainers/sebastian)[@sebastian](https://github.com/sebastian)

---

Top Contributors

[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (329 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (9 commits)")[![Ayesh](https://avatars.githubusercontent.com/u/811553?v=4)](https://github.com/Ayesh "Ayesh (1 commits)")

---

Tags

lines-of-codesoftware-metrics

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sebastian-lines-of-code/health.svg)

```
[![Health](https://phpackages.com/badges/sebastian-lines-of-code/health.svg)](https://phpackages.com/packages/sebastian-lines-of-code)
```

###  Alternatives

[phpunit/php-code-coverage

Library that provides collection, processing, and rendering functionality for PHP code coverage information.

8.9k892.4M1.5k](/packages/phpunit-php-code-coverage)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k26.2M1.8k](/packages/infection-infection)[sebastian/complexity

Library for calculating the complexity of PHP code units

1.3k528.8M12](/packages/sebastian-complexity)[phpmetrics/phpmetrics

Static analyzer tool for PHP : Coupling, Cyclomatic complexity, Maintainability Index, Halstead's metrics... and more !

2.6k14.5M299](/packages/phpmetrics-phpmetrics)

PHPackages © 2026

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