Options

Source Code Highlighting on No Hit Count

As my title suggests, is there a way to highlight source code that has had a hit count of 0?

If there is a way, then I will be able to easily see which lines of code have not been hit, and thus, use the profiler as a code coverage utility also.

:D

Thank you for any advice you can provide.

Comments

  • Options
    I'm afraid it isn't directly possible to find out such information from ANTS, but if you're feeling adventurous, you might be able to do something like the following...

    If you profile performance in ANTS, you can then export the data in XML format - this contains all the method names along with their hit counts and timings etc. If you can then obtain a list of all method names in your project, you could then intersect these two sets of data to get those methods that don't appear in the ANTS results.

    The hard bit, of course, is getting hold of the list of all the methods in your project. If you're working with Visual Studio, you could make use of their automation model to do this - there are various tutorials online regarding creating Visual Studio Add-Ins, and it's fairly straightforward. The first one that appeared on Google for me was:
    http://www.c-sharpcorner.com/Code/2002/Oct/AddIns.asp

    Sorry this isn't an "out of the box" solution - it is on our list of possible features for a future version though.

    Thanks,
    Rob
    Robert Chipperfield
    Red Gate
Sign In or Register to comment.