Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-3560

Rule S6002: Regex lookahead assertions should not be contradictory

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.10
    • Component/s: Rules
    • Labels:

      Description

      Using an AST-vistor find all lookahead assertions and for each one report an issue if the sub-automaton spanned by lookahead.element and lookahead.endOfLookaheadState does not intersect the prefix of the continuation automaton and the continuation automaton does not intersect the prefix of the sub-automaton (the latter should not be considered if we know that the regex is only used as a full match).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alban.auzeill Alban Auzeill
                Reporter:
                sebastian.hungerecker Sebastian Hungerecker
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: