Search code examples
tfsbuildwarningsreportingfoundation

Compile Warnings Reports in TFS


I have the following environment:

  • We use Microsoft Team Foundation Server 2013 to daily build our system which consists of hundreds of C# projects.
  • Our code quality department has identified a set of 194 C# code analysis rules that we must keep to a minimum.
  • The compilation produces around 80,000 code analysis warnings that belong to the 194 code quality rules.
  • 10-20 developers update the system and checkin source files every day

I have the following business requirement:

  • Report the progress of the code rule warnings on daily basis in the form of charts and tables.

Objective is to monitor and control the amount of code warnings on daily basis.

According to this: https://learn.microsoft.com/en-us/vsts/report/sql-reports/table-reference-build-project compile errors are saved in a fact table called FactBuildProject

I am not sure about:

Are all my 80,000 warnings saved in the TFS warehouse database every day?


Solution

  • Generally the warnings will be saved with the builds.

    For XAML Builds the number of compiler warnings used be stored in TFS Warehouse (BuildProjectView).

    So, you can get the number of warnings from TFS Warehouse BuildProjectView.

    enter image description here


    UPDATE:

    Cannot find the specific warning messages or IDs from the TFS Warehouse.

    Just I mentioned above, the warnings will be saved with the builds. So, we can try checking the build logs with TFS API. Reference this thread : How to fetch Build Warning from TFS MS Build or TFS API

    You can get the build list first, then get the logs in a loop.