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

Add "tool" property to main "pmd" tag in XML report #834

Merged
merged 2 commits into from
Oct 18, 2020
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/main/php/PHPMD/Renderer/XMLRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function renderReport(Report $report)
{
$writer = $this->getWriter();
$writer->write('<pmd version="' . PHPMD::VERSION . '" ');
$writer->write('tool="phpmd" ');
$writer->write('timestamp="' . date('c') . '">');
$writer->write(PHP_EOL);

Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/files/pmd/default-xml.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<pmd version="@package_version@" timestamp="">
<pmd version="@package_version@" tool="phpmd" timestamp="">
<file name="#{rootDirectory}_DS_source_DS_ccn_function.php">
<violation beginline="21" endline="52" rule="CyclomaticComplexity" ruleset="Code Size Rules" package="+global" externalInfoUrl="https://phpmd.org/rules/codesize.html#cyclomaticcomplexity" function="ccn_function" priority="3">
The function ccn_function() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/files/pmd/single-directory.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<pmd version="@package_version@" timestamp="">
<pmd version="@package_version@" tool="phpmd" timestamp="">
<file name="#{rootDirectory}_DS_source_DS_ccn_function.php">
<violation beginline="21" endline="52" rule="CyclomaticComplexity" ruleset="Code Size Rules" package="+global" externalInfoUrl="https://phpmd.org/rules/codesize.html#cyclomaticcomplexity" function="ccn_function" priority="3">
The function ccn_function() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/files/pmd/single-file.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<pmd version="@package_version@" timestamp="">
<pmd version="@package_version@" tool="phpmd" timestamp="">
<file name="#{rootDirectory}_DS_source_DS_ccn_function.php">
<violation beginline="21" endline="52" rule="CyclomaticComplexity" ruleset="Code Size Rules" package="+global" externalInfoUrl="https://phpmd.org/rules/codesize.html#cyclomaticcomplexity" function="ccn_function" priority="3">
The function ccn_function() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<pmd version="@package_version@" timestamp="">
<pmd version="@package_version@" tool="phpmd" timestamp="">
<file name="/bar.php">
<violation beginline="23" endline="42" rule="RuleStub" ruleset="TestRuleSet" package="TestStubPackage" externalInfoUrl="https://phpmd.org/rules/index.html" priority="5">
Test description
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<pmd version="@package_version@" timestamp="">
<pmd version="@package_version@" tool="phpmd" timestamp="">
<error filename="/tmp/foo.php" msg="Failed for file &quot;/tmp/foo.php&quot;." />
<error filename="/tmp/bar.php" msg="Failed for file &quot;/tmp/bar.php&quot;." />
<error filename="/tmp/baz.php" msg="Failed for file &quot;/tmp/baz.php&quot;." />
Expand Down