0.1.0 • Published 10 years ago

grunt-phpdcd v0.1.0

Weekly downloads
54
License
BSD
Repository
github
Last release
10 years ago

grunt-phpdcd

Grunt plugin for running PHP Dead Code Detector.

This plugin is developed for Grunt 0.4.0 and is not tested for backward compatibility with Grunt 0.3.x.

Getting Started

  1. Install this grunt plugin with the follwing command:
npm install grunt-phpdcd --save-dev
  1. Install PHPDCD

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

grunt.loadNpmTasks('grunt-phpdcd');

PHPDCD task

Run this task with the grunt phpdcd command.

This task is a multi task so any targets, files and options should be specified according to the multi task documentation.

Usage Example

phpdcd: {
  application: {
	  dir: ['application']
	},
	options: {
	  namesExclude: 'config.php,settings.php'
	}
}

Target Properties

dir

Type: Array

The files or directories where phpdcd should search for files.

Options

bin

Type: String Default: 'phpdcd'

The binary name if it is in your PATH or the full path if not.

names

Type: String Default: false

A comma-separated list of file names to check (default: "*.php").

namesExclude

Type: String Default: false

A comma-separated list of file names to exclude.

exclude

Type: Array Default: false

A list of directories where phpdcd should not search for files.

recursive

Type: Boolean Default: false

Report code as dead if it is only called by dead code.

quiet

Type: Boolean Default: false

Do not output any message.

verbose

Type: Number [1-3] Default: false

Increase the verbosity of messages.

  • 1 for normal output
  • 2 for more verbose output
  • 3 for debug

maxBuffer

Type: Number Default: 200*1024

Override the maxBuffer-Size of nodejs's exec() function if you expect a long output on stdout.


Inspired by grunt-phpmd