[doc] [xml] Adjust externalInfoUrl properties to new site - Part 11

Note: I also took the chance to fix tab damage
This commit is contained in:
Andreas Dangel
2017-08-15 11:20:16 +02:00
parent ceef1819e5
commit 819da2c3b4
3 changed files with 125 additions and 119 deletions

View File

@ -8,30 +8,28 @@
The Basic POM Ruleset contains a collection of good practices regarding Maven's POM files.
</description>
<rule name="ProjectVersionAsDependencyVersion"
language="xml"
since="5.4"
message="Do not use project's version to express a dependency's version."
class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/rules/pom/basic.html#ProjectVersionAsDependencyVersion">
<description>
<![CDATA[
Using that expression in dependency declarations seems like a shortcut, but it can go wrong. By far the most common problem is the use of
${project.version} in a BOM or parent POM.
]]>
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<value>
<![CDATA[
<rule name="ProjectVersionAsDependencyVersion"
language="pom"
since="5.4"
message="Do not use project's version to express a dependency's version."
class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_pom_basic.html#projectversionasdependencyversion">
<description>
Using that expression in dependency declarations seems like a shortcut, but it can go wrong.
By far the most common problem is the use of ${project.version} in a BOM or parent POM.
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<value>
<![CDATA[
//dependency/version/text[contains(@Image,'{project.version}')]
]]>
</value>
</property>
</properties>
<example>
<![CDATA[
</value>
</property>
</properties>
<example>
<![CDATA[
<project...>
...
<dependency>
@ -39,33 +37,34 @@ ${project.version} in a BOM or parent POM.
<version>${project.dependency}</version>
</dependency>
</project>
]]>
</example>
</rule>
]]>
</example>
</rule>
<rule name="InvalidDependencyTypes"
language="xml"
language="pom"
since="5.4"
message="By default, Maven only recognized the following types: $validTypes."
class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/rules/pom/basic.html#InvalidDependencyTypes">
<description><![CDATA[
While Maven will not failed if you use an invalid type for a dependency in the dependency management section, it will not also uses the dependency. ]]>
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<value>
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_pom_basic.html#invaliddependencytypes">
<description>
While Maven will not failed if you use an invalid type for a dependency in the
dependency management section, it will not also uses the dependency.
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<value>
<![CDATA[
//dependencyManagement/dependency/type/text[not(contains('pom, jar, maven-plugin, ejb, war, ear, rar, par',@Image))]
]]>
</value>
</property>
<!-- FIXME: property injection seems to be failing with XML.... -->
<!-- property name="validTypes" value="pom, jar, maven-plugin, ejb, war, ear, rar, par" description="Set of valid types."-->
</properties>
<example>
<![CDATA[
</value>
</property>
<!-- FIXME: property injection seems to be failing with XML.... -->
<!-- property name="validTypes" value="pom, jar, maven-plugin, ejb, war, ear, rar, par" description="Set of valid types."-->
</properties>
<example>
<![CDATA[
<project...>
...
<dependencyManagement>
@ -81,7 +80,7 @@ While Maven will not failed if you use an invalid type for a dependency in the d
</dependencyManagement>
</project>
]]>
</example>
</rule>
</example>
</rule>
</ruleset>
</ruleset>

View File

@ -8,29 +8,30 @@
The Basic XML Ruleset contains a collection of good practices which everyone should follow.
</description>
<rule name="MistypedCDATASection"
language="xml"
since="5.0"
message="Potentialy mistyped CDATA section with extra [ at beginning or ] at the end."
class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/rules/xml/basic.html#MistypedCDATASection">
<description>
<rule name="MistypedCDATASection"
language="xml"
since="5.0"
message="Potentialy mistyped CDATA section with extra [ at beginning or ] at the end."
class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_xml_basic.html#mistypedcdatasection">
<description>
An XML CDATA section begins with a &lt;!CDATA[ marker, which has only one [, and ends with a ]]&gt; marker, which has only two ].
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<value>
<![CDATA[
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<value>
<![CDATA[
//cdata-section[starts-with(@Image,'[') or ends-with(@Image,']')]
]]>
</value>
</property>
</properties>
<example>
<![CDATA[
</value>
</property>
</properties>
<example>
<![CDATA[
An extra [ looks like &lt;!CDATA[[]]&gt;, and an extra ] looks like &lt;!CDATA[]]]&gt;.
]]>
</example>
</rule>
]]>
</example>
</rule>
</ruleset>

View File

@ -8,49 +8,57 @@
This ruleset regroups a collection of good practices regarding XPath querying and functions inside an XSL.
</description>
<rule name="UseConcatOnce"
language="xsl"
since="5.0"
message="The xpath concat() function accepts as many arguments as required, you may be able to factorize this expression"
class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/rules/xsl/xpath.html#UseConcatOnce">
<description>
The XPath concat() functions accepts as many arguments as required so you can have "concat($a,'b',$c)" rather than "concat($a,concat('b',$c)".
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<value>
<![CDATA[
//node()[contains(substring-after(@select,'concat'),'concat')]
]]>
<rule name="UseConcatOnce"
language="xsl"
since="5.0"
message="The xpath concat() function accepts as many arguments as required, you may be able to factorize this expression"
class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_xsl_xpath.html#useconcatonce">
<description>
The XPath concat() functions accepts as many arguments as required so you can have
"concat($a,'b',$c)" rather than "concat($a,concat('b',$c)".
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<!-- the use of node() allow to target any node with an select attribute
but also workaround the ambiguity of having the xsl namespace in the
node name.-->
</value>
</property>
</properties>
<example>
<![CDATA[
<xsl:variable name="var" select="concat("Welcome",concat("to you ",$name))"/>
<xsl:variable name="var" select="concat("Welcome","to you ",$name))">
]]>
</example>
</rule>
<rule name="AvoidAxisNavigation"
language="xsl"
since="5.0"
message="Axis navigation has the largest impact when writing an XPath query."
class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/rules/xsl/xpath.html#AvoidAxisNavigation">
<description>
Avoid using the 'following' or 'preceeding' axes whenever possible, as these can cut through 100% of the document in the worst case. Also, try to avoid using 'descendant' or 'descendant-self' axes, as if you're at the top of the Document, it necessarily means cutting through 100% of the document.
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<value>
<![CDATA[
<value>
<![CDATA[
//node()[contains(substring-after(@select,'concat'),'concat')]
]]>
</value>
</property>
</properties>
<example>
<![CDATA[
<xsl:variable name="var" select="concat("Welcome",concat("to you ",$name))"/>
<xsl:variable name="var" select="concat("Welcome","to you ",$name))">
]]>
</example>
</rule>
<rule name="AvoidAxisNavigation"
language="xsl"
since="5.0"
message="Axis navigation has the largest impact when writing an XPath query."
class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_xsl_xpath.html#avoidaxisnavigation">
<description>
Avoid using the 'following' or 'preceeding' axes whenever possible, as these can cut
through 100% of the document in the worst case. Also, try to avoid using 'descendant'
or 'descendant-self' axes, as if you're at the top of the Document, it necessarily means
cutting through 100% of the document.
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<!-- the use of node() allow to target any node with an select attribute
but also workaround the ambiguity of having the xsl namespace in the
node name.-->
<value>
<![CDATA[
//node()[
contains(@select,'preceeding::')
or
@ -66,17 +74,15 @@ Avoid using the 'following' or 'preceeding' axes whenever possible, as these can
)
]
]]>
<!-- the use of node() allow to target any node with an select attribute
but also workaround the ambiguity of having the xsl namespace in the
node name.-->
</value>
</property>
<property name="checkSelfDescendantAbreviation" type="Boolean" description="descendant::self abreviation, '//', will also trigger this rule." value="false"/>
</properties>
<example>
<![CDATA[
<xsl:variable name="var" select="//item/descendant::child"/>
]]>
</example>
</rule>
</value>
</property>
<property name="checkSelfDescendantAbreviation" type="Boolean" description="descendant::self abreviation, '//', will also trigger this rule." value="false"/>
</properties>
<example>
<![CDATA[
<xsl:variable name="var" select="//item/descendant::child"/>
]]>
</example>
</rule>
</ruleset>