2011-02-02 16:16:27 +01:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<rule version="1">
|
2011-02-02 16:41:08 +01:00
|
|
|
<pattern>Token :: (?:findm|(?:simple|)M)atch \([^,]+,\s+"(?:\s+|[^"]+?\s+")</pattern>
|
2011-02-02 16:16:27 +01:00
|
|
|
<message>
|
|
|
|
<id>TokenMatchSpacing</id>
|
|
|
|
<severity>style</severity>
|
|
|
|
<summary>Useless extra spacing for Token::*Match.</summary>
|
|
|
|
</message>
|
|
|
|
</rule>
|
|
|
|
<rule version="1">
|
2011-02-02 17:21:36 +01:00
|
|
|
<pattern>(?U)Token :: Match \([^,]+,\s+"[^%|!\[\]]+"</pattern>
|
2011-02-02 16:16:27 +01:00
|
|
|
<message>
|
|
|
|
<id>UseTokensimpleMatch</id>
|
|
|
|
<severity>error</severity>
|
|
|
|
<summary>Token::simpleMatch should be used to match tokens
|
|
|
|
without special pattern requirements.</summary>
|
|
|
|
</message>
|
|
|
|
</rule>
|
2011-02-03 01:57:45 +01:00
|
|
|
<rule version="1">
|
|
|
|
<pattern>\b[\w_]+ \. tokAt \( 0 \)</pattern>
|
|
|
|
<message>
|
|
|
|
<id>TokentokAt0</id>
|
|
|
|
<severity>error</severity>
|
|
|
|
<summary>tok->tokAt(0) is a slow way to say tok.</summary>
|
|
|
|
</message>
|
|
|
|
</rule>
|
|
|
|
<rule version="1">
|
|
|
|
<pattern>\b[\w_]+ \. strAt \( 0 \)</pattern>
|
|
|
|
<message>
|
|
|
|
<id>TokenstrAt0</id>
|
|
|
|
<severity>error</severity>
|
|
|
|
<summary>tok->strAt(0) is a slow way to say tok->str()</summary>
|
|
|
|
</message>
|
|
|
|
</rule>
|