All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.csharp.rules.csharpsquid.XPath.html Maven / Gradle / Ivy

There is a newer version: 4.0
Show newest version

This rule allows to define some homemade C# rules with help of an XPath expression.

Violations 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 violation with the given message is created for each node
  • a boolean, then a file violation with the given message is created only if the boolean is true
  • anything else, no violation is created

Here is an example of an XPath expression to log a violation on each if statement : //ifStatement





© 2015 - 2025 Weber Informatics LLC | Privacy Policy