Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct readme explaining ruleset and report. #679

Merged
merged 2 commits into from
Oct 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 31 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,42 @@ Command line usage

Type ``phpmd [filename|directory] [report format] [ruleset file]``, i.e: ::

mapi@arwen ~ $ phpmd PHP/Depend/DbusUI/ xml rulesets/codesize.xml

While the ``rulesets/codesize.xml`` ruleset file could look like this::
mapi@arwen ~ $ phpmd php/PDepend/DbusUI/ xml rulesets.xml

While the ``rulesets.xml`` ruleset file could look like this::

<?xml version="1.0"?>
<ruleset name="My first PHPMD rule set"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="
http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
My custom rule set that checks my code...
</description>

<rule ref="rulesets/codesize.xml" />
<rule ref="rulesets/cleancode.xml" />
<rule ref="rulesets/controversial.xml" />
<rule ref="rulesets/design.xml" />
<rule ref="rulesets/naming.xml" />
<rule ref="rulesets/unusedcode.xml" />
</ruleset>

The xml report would like like this::

<?xml version="1.0" encoding="UTF-8" ?>
<pmd version="0.0.1" timestamp="2009-12-19T22:17:18+01:00">
<file name="/projects/pdepend/PHP/Depend/DbusUI/ResultPrinter.php">
<violation beginline="67"
endline="224"
rule="TooManyMethods"
ruleset="Code Size Rules"
package="PHP_Depend\DbusUI"
class="PHP_Depend_DbusUI_ResultPrinter"
<violation beginline="81"
endline="81"
rule="UnusedFormalParameter"
ruleset="Unused Code Rules"
externalInfoUrl="https://phpmd.org/rules/unusedcode.html#unusedformalparameter"
priority="3">
This class has too many methods, consider refactoring it.
Avoid unused parameters such as '$builder'.
</violation>
</file>
</pmd>
Expand Down