This rule allows the definition of custom rules using XPath expressions.


Issues are created depending on the return value of the XPath expression. If the XPath expression returns:

* a single or list of AST nodes, then a line issue with the given message is created for each node
* a boolean, then a file issue with the given message is created only if the boolean is true
* anything else, no issue is created

On the following code, the XPath expression ``++//IDENTIFIER[string-length(@tokenValue) >= 10]++`` generates a violation on the identifier ``++"aaaaaaaaaa"++``:


----
#include <stdio.h>

int main(int argc, char* argv[])
{
  int aaaaaaaaaa = 10; /* Noncompliant - this identifier is 10 characters long */
  int aaaaaaaaa = 9; /* Compliant - this one is only 9 */
  printf("Hello world!\n");
  return 0;
}
----
