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

Support character classes as operand to reluctant quantifier in rule S5857

    Details

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

      Description

      Currently S5857 only raises an issue when a reluctant quantifier is applied to a match-all pattern (i.e. .*?). However, it could be made to also work with reluctantly quantified escaped character classes without too much trouble.

      Example:

      • \S+?@ should be replaced with [^\s@]+@ or [^\s@]@

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                margarita.nedzelska Margarita Nedzelska
                Reporter:
                sebastian.hungerecker Sebastian Hungerecker
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: