This task runs PHP_Depend, a software analyzer and metric tool for PHP Code. You need an installed version of this software to use this task.
NB: if you have installed the
PHP_Depend Phar file, make sure you set the
pharLocation
attribute!
Table C.87: Attributes
Name | Type | Description | Default | Required |
---|---|---|---|---|
file | String | Path to source file or path | n/a | Only when there are no nested
fileset elements |
configFile | String | Path to PHP_Depend configuration file | n/a | No |
allowedFileExtensions | String | Comma-separated list of valid file extensions (without dot) for analyzed files. | php,php5 | No |
excludeDirectories | String | Comma-separated list of directory patterns to ignore. | .git , .svn ,
CVS | No |
excludePackages | String | Comma-separated list of packages to ignore. | n/a | No |
withoutAnnotations | Boolean | Should the parse ignore doc comment annotations? | false | No |
supportBadDocumentation | Boolean | Should PHP_Depend treat +global as a regular
project package? | false | No |
debug | Boolean | Enable debug output? | false | No |
haltonerror | Boolean | Stop the build process if errors occurred during the run. | false | No |
pharlocation | String | Location of the PHP_Depend Phar file. | n/a | No |
<phpdepend file="path/to/source"> <logger type="phpunit-xml" outfile="reports/metrics.xml"/> </phpdepend>
Running code analysis for source files in the given path.
<phpdepend> <fileset dir="${builddir}"> <include name="apps/**/*.php" /> <include name="lib/de/**/*.php" /> </fileset> <logger type="jdepend-xml" outfile="reports/jdepend.xml"/> <analyzer type="coderank-mode" value="method"/> </phpdepend>
Running code analysis for source files in the fileset pathes with CodeRank
strategy method
.
This nested tag is required when the file
attribute is
not set.
logger
The results of the analysis can be parsed by differed loggers. At least one logger is required. Output will always be sent to a file.
Table C.88: Attributes
Name | Type | Description | Default | Required |
---|---|---|---|---|
type | String | The name of the logger. Valid loggers are:
jdepend-chart ,
jdepend-xml ,
overview-pyramid ,
phpunit-xml and
summary-xml . | n/a | Yes |
outfile | String | Path to write output file to. | n/a | Yes |
analyzer
Some additional analyzers can be added to the runner.
Table C.89: Attributes
Name | Type | Description | Default | Required |
---|---|---|---|---|
type | String | The name of the analyzer. Valid analyzers are:
coderank-mode . | n/a | Yes |
value | String | The value for the analyzer. | n/a | Yes |