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

S5996 should not raise an issue if `$` is followed by a line break character

    XMLWordPrintable

    Details

    • Type: False-Positive
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Rules
    • Labels:

      Description

      On a pattern like ^foo$\r?\n? S5996 will complain that the part after the $ cannot match because $ is the end of the line. But, since $ matches before line break characters, it can still be followed by them. So this is a false positive.

      In cases where the MULTILINE flag is set, we should also accept patterns like ^foo$\r?\n?bar or, if the DOTALL flag is also set, even ^foo$.*.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              sebastian.hungerecker Sebastian Hungerecker
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: