PHPackages                             automattic/jetpack-analyzer - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. automattic/jetpack-analyzer

ActiveJetpack-library[Utility &amp; Helpers](/categories/utility)

automattic/jetpack-analyzer
===========================

Analyze differences between Jetpack versions

v3.0.2(5mo ago)491GPL-2.0-or-laterPHPPHP &gt;=7.2CI passing

Since Sep 5Pushed 4d agoCompare

[ Source](https://github.com/Automattic/jetpack-analyzer)[ Packagist](https://packagist.org/packages/automattic/jetpack-analyzer)[ RSS](/packages/automattic-jetpack-analyzer/feed)WikiDiscussions trunk Synced 2d ago

READMEChangelogDependencies (2)Versions (32)Used By (0)

Jetpack Code Analyzer
---------------------

[](#jetpack-code-analyzer)

Analyzes public classes, methods, variables and functions to search for breaking changes between versions

### Running

[](#running)

```
composer run example

```

### API

[](#api)

#### Declarations

[](#declarations)

This class represents a list of public declarations accumulated from one or more files.

Public declarations include:

- classes
- class methods (static and instance)
- public class properties
- functions

`Declarations` can find each declaration by scanning files and directories using `$declarations->scan( $dir, $exclude = array() )`.

You can `print`, `load`, and `save` those declarations as CSV.

You can also generate a list of differences between old and new code bases, e.g. Jetpack 7.4 and Jetpack 7.5, using `->find_differences( $previous_declarations )`, which returns an instance of `Automattic\Jetpack\Analyzer\Differences`.

```
$declarations = new Automattic\Jetpack\Analyzer\Declarations();

// single file
$declarations->scan( $base_path . '/class.jetpack.php' );

// OR recursively scan a directory
$exclude = array( '.git', 'vendor', 'tests', 'docker', 'bin', 'scss', 'images', 'docs', 'languages', 'node_modules' );
$declarations->scan( $base_path, $exclude );

// print the declarations
$declarations->print();

// save the declarations as CSV
$declarations->save( 'path/to/jetpack-trunk.csv' );

// load some other declarations
$jp74_declarations->load( 'path/to/jetpack-branch-7.4.csv' );
```

You can use instances of `Declarations` as input to `(new Differences())->find( $new_codebase, $old_codebase )`

Supported declarations:

- Class
- Class property (static or instance)
- Class method (static or instance)
- Function

#### Differences

[](#differences)

A list of differences can be used to check compatibity against a set of invocations.

This is performed by parsing any external file looking for invocations. If those invocations match any functions, methods, classes or properties that have been changed between the two Jetpack versions, then a list of warnings or errors will be produced.

```
// load declarations from a file, or scan using ->scan()
$trunk_declarations->load( 'path/to/codebase-1.0.csv' );
$other_declarations->load( 'path/to/codebase-2.0.csv' );
// OR
$trunk_declarations->scan( 'path/to/trunk_branch', array( '.git', 'node_modules' ) );
$other_declarations->scan( 'path/to/other_branch', array( '.git', 'node_modules' ) );

$differences = new Automattic\Jetpack\Analyzer\Differences();
$differences->find( $trunk_declarations, $jp74_declarations );
$differences->print();
```

Supported differences:

- Class missing
- Class moved to another file
- Class property missing
- Class property moved to another file
- Class method missing
- Class method moved to another file
- Function missing
- Function moved to another file

### Invocations

[](#invocations)

A list of invocations of every relevant type:

- function calls
- static and instance method calls
- instantiation via `new`
- references to class props

This is ALL invocations of these types. To find just the invocations of missing/different functions, look at Warnings below.

```
$invocations = new Automattic\Jetpack\Analyzer\Invocations();
$invocations->scan( 'path/to/example.php' ); // can be a file or directory
// OR
$invocations->scan( 'path/to/repo', array( '.git', '.gitmodules', 'assets' ) );

$invocations->print();
```

Supported invocations:

- new Class
- assign/read static Class property
- invoke static Class method
- call Function

#### Warnings

[](#warnings)

A list of warnings generated by comparing an `Invocations` object with a `Differences` object.

```
// assumes `$differences` and `$invocations` have already been generated as per above
$warnings = new Automattic\Jetpack\Analyzer\Warnings();
$warnings->generate( $invocations, $differences );
$warnings->print();
```

Supported warnings:

- new Class
- assign/read static Class property
- invoke static Class method
- call Function

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance87

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~122 days

Recently: every ~267 days

Total

20

Last Release

170d ago

Major Versions

v1.7.3 → v2.0.02024-02-07

v2.0.0 → v3.0.02024-12-04

PHP version history (2 changes)v2.0.0PHP &gt;=7.0

v3.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c5869ecbb8e0eac7e8b8e0f3cf7bdd8d5fcdc4abc10a72281872c53f8639d44?d=identicon)[automattic](/maintainers/automattic)

![](https://www.gravatar.com/avatar/11609890f6e7a840715f4cfc9622d77ea64b7dfc024df5643fbf8471a18c00f3?d=identicon)[kraft](/maintainers/kraft)

![](https://www.gravatar.com/avatar/5326730499ec14e274f51b9bcc39db6aac0fb38b33849715aae0e2587a2b93df?d=identicon)[jeherve](/maintainers/jeherve)

![](https://www.gravatar.com/avatar/6e220e167e341c28b1aa10bf0bb0374999068329f8683d3187ee3cf6749b8837?d=identicon)[dereksmart](/maintainers/dereksmart)

---

Top Contributors

[![anomiex](https://avatars.githubusercontent.com/u/1030580?v=4)](https://github.com/anomiex "anomiex (85 commits)")[![tbradsha](https://avatars.githubusercontent.com/u/32492176?v=4)](https://github.com/tbradsha "tbradsha (26 commits)")[![kraftbj](https://avatars.githubusercontent.com/u/88897?v=4)](https://github.com/kraftbj "kraftbj (14 commits)")[![jeherve](https://avatars.githubusercontent.com/u/426388?v=4)](https://github.com/jeherve "jeherve (10 commits)")[![samiff](https://avatars.githubusercontent.com/u/15803018?v=4)](https://github.com/samiff "samiff (10 commits)")[![zinigor](https://avatars.githubusercontent.com/u/374293?v=4)](https://github.com/zinigor "zinigor (7 commits)")[![gravityrail](https://avatars.githubusercontent.com/u/51896?v=4)](https://github.com/gravityrail "gravityrail (7 commits)")[![sdixon194](https://avatars.githubusercontent.com/u/33553323?v=4)](https://github.com/sdixon194 "sdixon194 (4 commits)")[![dereksmart](https://avatars.githubusercontent.com/u/7129409?v=4)](https://github.com/dereksmart "dereksmart (4 commits)")[![coder-karen](https://avatars.githubusercontent.com/u/16754605?v=4)](https://github.com/coder-karen "coder-karen (4 commits)")[![manzoorwanijk](https://avatars.githubusercontent.com/u/18226415?v=4)](https://github.com/manzoorwanijk "manzoorwanijk (3 commits)")[![gmjuhasz](https://avatars.githubusercontent.com/u/36671565?v=4)](https://github.com/gmjuhasz "gmjuhasz (3 commits)")[![ice9js](https://avatars.githubusercontent.com/u/8056203?v=4)](https://github.com/ice9js "ice9js (2 commits)")[![brbrr](https://avatars.githubusercontent.com/u/5654161?v=4)](https://github.com/brbrr "brbrr (2 commits)")[![paulopmt1](https://avatars.githubusercontent.com/u/1044309?v=4)](https://github.com/paulopmt1 "paulopmt1 (1 commits)")[![psealock](https://avatars.githubusercontent.com/u/1922453?v=4)](https://github.com/psealock "psealock (1 commits)")[![puntope](https://avatars.githubusercontent.com/u/5908855?v=4)](https://github.com/puntope "puntope (1 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (1 commits)")[![sergeymitr](https://avatars.githubusercontent.com/u/1341249?v=4)](https://github.com/sergeymitr "sergeymitr (1 commits)")[![simison](https://avatars.githubusercontent.com/u/87168?v=4)](https://github.com/simison "simison (1 commits)")

---

Tags

analyzerjetpackstatic analysisjetpack

### Embed Badge

![Health badge](/badges/automattic-jetpack-analyzer/health.svg)

```
[![Health](https://phpackages.com/badges/automattic-jetpack-analyzer/health.svg)](https://phpackages.com/packages/automattic-jetpack-analyzer)
```

###  Alternatives

[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k7.9M105](/packages/deptrac-deptrac)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[phpdocumentor/reflection

Reflection library to do Static Analysis for PHP Projects

12524.8M137](/packages/phpdocumentor-reflection)[icanhazstring/composer-unused

Show unused packages by scanning your code

1.7k7.6M215](/packages/icanhazstring-composer-unused)[v.chetkov/php-clean-architecture

PHP Clean Architecture

14659.9k](/packages/vchetkov-php-clean-architecture)[php-stubs/generator

Generate stubs from any PHP code for IDE completion and static analysis.

80318.6k61](/packages/php-stubs-generator)

PHPackages © 2026

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