PHPackages                             dzunke/panaly - 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. dzunke/panaly

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

dzunke/panaly
=============

Project Analyzer Tool - Get different sources of quality tools together into a single source of results

0146↓100%1PHPCI failing

Since Aug 13Pushed 1y ago2 watchersCompare

[ Source](https://github.com/DZunke/panaly)[ Packagist](https://packagist.org/packages/dzunke/panaly)[ RSS](/packages/dzunke-panaly/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Panaly - Project Analyzer
=========================

[](#panaly---project-analyzer)

[![Build Status](https://camo.githubusercontent.com/04fc6ca0e53c480032cbaf126dae6b0c7e9ea3630d1dc406b8697465929a39d9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f445a756e6b652f70616e616c792f63692e796d6c)](https://github.com/DZunke/panaly/actions)[![License](https://camo.githubusercontent.com/7a2a023e73c263a58731f70d09eb55b66d0426e7a0285ff7c32677c94bd9596c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f445a756e6b652f70616e616c79)](https://mit-license.org/)

This project aims to deliver an extendable tool to analyze a project's source code for various metrics. Whether you have a code coverage report, baselines for static analyzers, or file system metrics, Panaly can aggregate them based on your custom configuration and provide comprehensive reporting.

The plugin system ensures customization at every step, from configuration to metric collection, storage, and reporting. Future updates will enable active event listening, allowing plugins to further customize the analysis process.

Features
--------

[](#features)

- Extensible plugin system
- Customizable metric collection
- Comprehensive reporting

Setup
-----

[](#setup)

> ⚠️ **Work in Progress Project**

Install the package using Composer:

```
composer require --dev panaly/panaly
```

Create a `panaly.dist.yaml` file and configure it based on the plugins you need. Without any plugins, no actions will be performed. Refer to the example configuration in this repository for guidance.

Usage
-----

[](#usage)

By default, the CLI command searches for a `panaly.dist.yaml` configuration file. You can specify a different configuration file using the `-c` option:

```
vendor/bin/panaly -c my-own-config.yaml
```

Curated List of Plugins
-----------------------

[](#curated-list-of-plugins)

**Metric Plugins**

- [Quality Tool Baselines](https://github.com/DZunke/panaly-baseline-plugin)
- [Filesystem](https://github.com/DZunke/panaly-files)

**Storage Plugins**

- [JSON Timeline Storage](https://github.com/DZunke/panaly-json-timeline-storage)

**Reporting Plugins**

- [Markdown Report](https://github.com/DZunke/panaly-markdown-report)
- [Symfony Dump Output](https://github.com/DZunke/panaly-symfony-dump)

**Other Plugins**

- [CODEOWNERS Paths](https://github.com/DZunke/panaly-codeowners)

Example Configuration
---------------------

[](#example-configuration)

 panaly.dist.yaml```
# panaly.dist.yaml
plugins: # Registered plugins that deliver single metrics that could be utilized for metric groups
  Namespace/Of/The/Project/FilesystemPlugin: ~ # registers a "filesystem_directory_count" and a "filesystem_file_count" metric
  Namespace/Of/Another/Project/PHPStanBaselinePlugin: ~ # registers a simple "phpstan_baseline_total_count" metric
  I/Have/A/Storage/Engine/LocalJsonStoragePlugin: ~ # registers a "local_json" storage and also a "metric_history_timeframe" metric that shows from / to string of all-time metric reading
  My/Own/Plugin/HtmlReportPlugin: ~ # registers the "my_own_html_reporting" reporting that takes the result collection of the metrics and does something with it

groups:
  group1:
      title: "My Metrics"
      metrics:
          metric_history_timeframe:
              title: "Metrics in Storage (Timeframe)"
              storage: local_json
  group2:
      title: "Filesystem Metrics"
      metrics:
          filesystem_directory_count: ~
          filesystem_file_count:
              title: "Total project files"
              paths:
                  - src
                  - tests
          i_am_a_custom_identifier:
              metric: filesystem_file_count # This overwrites the key and is the metric to be utilized
              title: "Just test files"
              paths:
                  - src
                  - tests
  group3:
      title: "Static Analysis Metrics"
      metrics:
          phpstan_baseline_total_count:
              title: "PHPStan Debts"
              baseline: .baselines/phpstan-baseline.neon

storage:
  local_json:
      path: var/metric_storage

reporting:
  my_own_html_reporting: ~
```

Plugins
-------

[](#plugins)

Panaly relies on a wide plugin system and does not provide metric collection, storage, or reporting features by itself. Each plugin can specialize in a single task or deliver a full feature set from metric collection to storage handling and report generation.

Plugins are essential for configuring a Panaly run. Each plugin has a base class that defines how it interacts with Panaly and the features it provides. A plugin must implement the `Panaly\Plugin\Plugin interface`, which defines an `initialize` method.

The plugin will receive the full application configuration, the specific configuration associated with it, and the runtime configuration where metrics, storage, and reports can be added. It also has access to the event dispatcher to register listeners/subscribers for customizations.

A plugin example:

```
