PHPackages                             bamboohr/variable-analysis - 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. bamboohr/variable-analysis

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

bamboohr/variable-analysis
==========================

Provides PHP CodeSniffer sniffs to find unused and undefined variables.

v0.1.0(10y ago)4576.8k↓17.3%21PHPPHP &gt;=5.5.0

Since Feb 12Pushed 10y ago18 watchersCompare

[ Source](https://github.com/BambooHR/PHP_Codesniffer-VariableAnalysis)[ Packagist](https://packagist.org/packages/bamboohr/variable-analysis)[ RSS](/packages/bamboohr-variable-analysis/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

PHP\_CodeSniffer VariableAnalysis
=================================

[](#php_codesniffer-variableanalysis)

Plugin for PHP\_CodeSniffer static analysis tool that adds analysis of problematic variable use.

- Performs static analysis of variable use.
- Warns on use of undefined variables.
- Warns if variables are set or declared but never used within that scope.
- Warns if variables are redeclared within same scope.
- Warns if $this, self::$static\_member, static::$static\_member is used outside class scope.
- (new) Allows $this inside closures in PHP &gt;=5.4
- (new) Add analysis of instance variables ($this-&gt;...)

INSTALLATION
------------

[](#installation)

Run ./install.sh -h to get install help.

For a default install of PHP\_Codesniffer via PEAR with PEAR in ~/pear you should be safe to just run ./install.sh to use the default options, then copy the rules from ruleset.xml into your own ruleset.xml.

CUSTOMIZATION
-------------

[](#customization)

There's a variety of options to customize the behaviour of VariableAnalysis, take a look at the included ruleset.xml for commented examples of a configuration.

KNOWN ISSUES &amp; BUGS
-----------------------

[](#known-issues--bugs)

- File scope isn't currently analysed.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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

Unknown

Total

1

Last Release

3770d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5740925?v=4)[bamboohr](/maintainers/bamboohr)[@BambooHR](https://github.com/BambooHR)

![](https://avatars.githubusercontent.com/u/5857089?v=4)[Josh Davis](/maintainers/joshdavis11)[@joshdavis11](https://github.com/joshdavis11)

![](https://avatars.githubusercontent.com/u/1270371?v=4)[Jake Gardiner](/maintainers/jgardiner)[@jgardiner](https://github.com/jgardiner)

---

Top Contributors

[![illusori](https://avatars.githubusercontent.com/u/360670?v=4)](https://github.com/illusori "illusori (63 commits)")[![Fuco1](https://avatars.githubusercontent.com/u/2664959?v=4)](https://github.com/Fuco1 "Fuco1 (3 commits)")[![arnested](https://avatars.githubusercontent.com/u/190005?v=4)](https://github.com/arnested "arnested (2 commits)")[![joshdavis11](https://avatars.githubusercontent.com/u/5857089?v=4)](https://github.com/joshdavis11 "joshdavis11 (2 commits)")[![jongardiner](https://avatars.githubusercontent.com/u/6627104?v=4)](https://github.com/jongardiner "jongardiner (1 commits)")[![sompylasar](https://avatars.githubusercontent.com/u/498274?v=4)](https://github.com/sompylasar "sompylasar (1 commits)")

### Embed Badge

![Health badge](/badges/bamboohr-variable-analysis/health.svg)

```
[![Health](https://phpackages.com/badges/bamboohr-variable-analysis/health.svg)](https://phpackages.com/packages/bamboohr-variable-analysis)
```

###  Alternatives

[slevomat/coding-standard

Slevomat Coding Standard for PHP\_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.

1.5k130.4M2.1k](/packages/slevomat-coding-standard)[youwe/testing-suite

Contains Youwe's default testing packages for php.

13186.2k8](/packages/youwe-testing-suite)[hyva-themes/hyva-coding-standard

A set of Hyvä specific PHP CodeSniffer rules extending the Magento Coding Standard

2926.2k](/packages/hyva-themes-hyva-coding-standard)

PHPackages © 2026

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