Uploaded image for project: 'Product Roadmaps'
  1. Product Roadmaps
  2. MMF-283

Simpler Issue Exclusions

    XMLWordPrintable

    Details

      Description

      Context

      It is possible in SonarQube to tailor the scope of an analysis:

      • files to include or exclude
      • files for which coverage should not be computed
      • files for which duplication should not be computed
      • files for which issues should not be saved

      The customisation for issue inclusion/exclusion is quite complex and currently suffers from limitations:

      • it is done only on scanner side - which means that it does not apply to common rules that are processed only on CE side (see SONAR-7009)
      • it can be CPU consuming so it is not applied in SonarLint to not slow down analysis - which means that users can have a difference with the server in connected mode

      Suggested simplification

      "Ignore Issues on Files"

      This feature allows to ignore issues when a particular regular expression is found in a file. This mainly answers the following need: automatically ignore generated files - wherever they are and w/o having to specify a path for them.

      This feature should be removed from the "Issues" context and added to the "Files" context. Indeed, there's no interest to parse and generated metrics for generated files, so let's just simply ignore them and not pass them to the analysers.

      "Ignore Issues in Blocks"

      This feature targets 2 main use cases:

      1. extension of the //NOSONAR feature to allow exclusion of blocks (see SONAR-5122)
      2. ignore some parts of files generated by tools that allow to edit only between some well-defined tags (in order to regenerate later)

      This feature should be simply removed altogether. Reasons are:

      • Use case #2 should be pretty rare
      • Use case #1:
        • is highly controversial
        • would be better covered (in any case) by letting language plugins (that already perfectly parse the code) manage which mechanism they allow to ignore issues (like the @SuppresWarning in Java)
      • This feature is the most CPU consuming during the analysis
        • not a good idea in SonarLint
        • and we would have to backport this inefficient feature on CE side to fully fix SONAR-7009

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: