SonarQube JavaScript
  1. SonarQube JavaScript
  2. SONARJS-59

Rule: Generic JavaScript rule to define some homemade checks with an XPath expression

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Issue Links

        Activity

        Hide
        Freddy Mallet added a comment - - edited

        Works well evgeny could you just update the description as follows :

        <p>
        This rule allows to define some homemade Javascript 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 list of AST nodes, then a line violation with the given message is created on each the line of each node
        a boolean, then a 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</p>
        
        Show
        Freddy Mallet added a comment - - edited Works well evgeny could you just update the description as follows : <p> This rule allows to define some homemade Javascript 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 list of AST nodes, then a line violation with the given message is created on each the line of each node a boolean, then a 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</p>
        Hide
        Evgeny Mandrikov added a comment -

        Done.

        Show
        Evgeny Mandrikov added a comment - Done.
        Hide
        Freddy Mallet added a comment -

        Manually tested !

        Show
        Freddy Mallet added a comment - Manually tested !

          People

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

            Dates

            • Created:
              Updated:
              Resolved: