Details

    • Number of attachments :
      0

      Description

      Name: XPath rule
      Parameters:

      • xpathQuery=The XPath query
      • message=The violation message

      Description:

      <p>
      This rule allows to define some homemade Erlang rules with help of an XPath expression.
      </p>
      
      <p>
      Violations are created depending on the return value of the XPath expression. If the XPath expression returns:
      </p>
      <ul>
        <li>a single or list of AST nodes, then a line violation with the given message is created for each node</li>
        <li>a boolean, then a file violation with the given message is created only if the boolean is true</li>
        <li>anything else, no violation is created</li>
      </ul>
      
      <p>
      Here is an example of an XPath expression to log a violation on each if expression : //ifExpression
      </p>
      

      Should be disabled in default profile.

        Issue Links

          Activity

          Hide
          Tamas Kende added a comment -

          How can I disable a rule by default?

          Show
          Tamas Kende added a comment - How can I disable a rule by default?
          Show
          Evgeny Mandrikov added a comment - Just remove annotation "@BelongsToProfile" - https://github.com/SonarCommunity/sonar-erlang/blob/master/erlang-checks/src/main/java/org/sonar/erlang/checks/XPathCheck.java#L40
          Hide
          Evgeny Mandrikov added a comment -

          Tested manually.

          Show
          Evgeny Mandrikov added a comment - Tested manually.

            People

            • Assignee:
              Tamas Kende
              Reporter:
              Evgeny Mandrikov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: