npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

grunt-phpmetrics

v0.4.0

Published

Grunt plugin for running PHP Metrics

Readme

grunt-phpmetrics

Grunt plugin for running PHP Metrics.

Getting started

  1. Install grunt-phpmetrics
npm install grunt-phpmetrics --save-dev
  1. Install PHP Metrics

  2. Add this to your project's Gruntfile.js:

grunt.loadNpmTasks('grunt-phpmetrics');

Usage Example

Run this task with the grunt phpmetrics command.

phpmetrics: {
	options: {
		bin: 'vendor/bin/phpmetrics', //path to bin phpmetrics file
		reportHtml: 'report.html', //example configuration
	},
	application: {
		dir: 'test/' //path to directory for phpmetrics
  }
}

Target Properties

dir

Type: String || Array

The file or directory to analyze.

###Options

For more information about options check configuration options of PHP Metrics.

bin

Type: String Default: phpmetrics

The path to phpmetrics. (For composer, use vendor/bin/phpmetrics).

config

Type: String Default: null

Path to config file (YAML) config.yml

reportHtml

Type: String Default: null

Path to save report in HTML format. report.html

reportXml

Type: String Default: null

Path to save report in XML format. report.xml

reportCli

Type: Boolean Default: null

Enable report in terminal.

violationsXml

Type: String Default: null

Path to save violations in XML format. violations.xml

reportCsv

Type: String Default: null

_ Path to save summary report in CSV format. report.csv_

reportJson

Type: String Default: null

Path to save detailed report in JSON format. report.json

chartBubbles

Type: String Default: null

Path to save Bubbles chart, in SVG format. charts.svg

level

Type: Integer Default: null

Depth of summary report. 3

extensions

Type: String Default: null

Regex of extensions to include. php|inc

excludedDirs

Type: String Default: null

Regex of subdirectories to exclude. cache|vendor

symlinks

Type: Boolean Default: null

_Enable following symlinks. _

withoutOOP

Type: Boolean Default: null

If provided, tool will not extract any information about OOP model (faster).

failureCondition

Type: String Default: null

Optional failure condition, in english. Example: average.maintainabilityIndex < 50 or sum.loc > 10000

templateTitle

Type: String Default: null

Title for the HTML summary report

@see https://github.com/zarubatomas/grunt-phpmetrics.