SonarQube C#
  1. SonarQube C#
  2. SONARCS-195

'sonar.gallio.coverage.excludes' does not work for NCover

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1
    • Component/s: None
    • Labels:
    • Environment:
      N/A
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      'sonar.gallio.coverage.excludes' does not work for NCover when specifying assemblies that should be excluded from coverage calculation.

      My opinion of the way it should work would be at the assembly level only. This would allow the plug-in to take advantage of the existing //ias command-line argument being used currently, and simply remove from that list any assembly specified in the 'sonar.gallio.coverage.excludes' (maybe just a comma-delimited list?). I tried doing this (it didn't work completely) as it made the most sense to me, and I've attached a diff if you'd like to look at it. Try not to laugh, I'm currently not a software developer and my history is with C# and .NET =)

      I suppose it might be a good idea to share my understanding of what the outcome would be if this indeed did work correctly. I would expect that anything specified in the coverage excludes would be fully excluded from the overall coverage calculation. Example:

      A solution has 3 projects A, B and C all with 100 lines of code
      Project A has 100% coverage.
      Project B has 60% coverage.
      Project C has 10% coverage.

      Nothing excluded........ total coverage would be 56.67% or (A+B+C)/3
      A excluded.............. total coverage would be 35% or (B+C)/2
      C excluded.............. total coverage would be 80% or (A+B)/2
      B and C excluded........ total coverage would be 100% or A/1

      I hope that communicates the idea enough. Please let me know if either you'd like more explanation or if my understanding is off at all.

      Thanks for all the work you guys do!

        Activity

        Hide
        Alexandre Victoor added a comment -

        Patch applied

        Show
        Alexandre Victoor added a comment - Patch applied
        Hide
        Fabrice Bellingard added a comment -

        Tested, and documentation updated both on the Plugin class and on the Wiki.

        However, this should ne noted that the agregation does not work as Josh expected (<= not including the coverage of an assembly in the overall coverage), and this is normal for the moment: this computation is done in Sonar Core, so this modification should be done there (-> on the Java side, we're "suffering" from the same problem). This is a feature that we have in mind for Sonar.

        Show
        Fabrice Bellingard added a comment - Tested, and documentation updated both on the Plugin class and on the Wiki. However, this should ne noted that the agregation does not work as Josh expected (<= not including the coverage of an assembly in the overall coverage), and this is normal for the moment: this computation is done in Sonar Core, so this modification should be done there (-> on the Java side, we're "suffering" from the same problem). This is a feature that we have in mind for Sonar.
        Hide
        Fabrice Bellingard added a comment -

        Just FYI, here's the ticket that deals with exclusions of modules for agregation of coverage metrics: http://jira.codehaus.org/browse/SONAR-766

        Show
        Fabrice Bellingard added a comment - Just FYI, here's the ticket that deals with exclusions of modules for agregation of coverage metrics: http://jira.codehaus.org/browse/SONAR-766
        Hide
        Fabio Gavilondo added a comment -

        See related issue SONARPLUGINS-1534.

        Show
        Fabio Gavilondo added a comment - See related issue SONARPLUGINS-1534 .

          People

          • Assignee:
            Alexandre Victoor
            Reporter:
            Anonymous
          • Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: