Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-12559

Raise "Invalid character found" as a UI warning

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Scanner
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      When SonarQube reads source code to count lines, it might encounter some invalid characters. In such case, it ignores the file, logs a warning in the logs and moves on with the next files to read. See the related code.

      The problem is that these warnings are visible only in the logs and users might not notice this. Let's leverage the UI Warning feature to bring this to the users' attention inside SonarQube UI:

      • When SonarQube encounters an invalid character during the scan, it will raise a warning telling the user to go through the logs to find all the files which need to be fixed.
      • This means that SonarQube will raise 1 warning (and only 1) even if there are several files which cannot be read.

       

      Note: we know that SonarQube can raise this warning during the process of counting lines. If there are other places (during the scan) where such a warning can be logged, we should make sure that they are also taken into account (and yet raise 1 and only 1 warning for the whole scan process).

       

      More details can be found on the following Community thread: https://community.sonarsource.com/t/why-is-there-no-rule-for-error-invalid-character-encountered/13854

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              fabrice.bellingard Fabrice Bellingard
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: