Peter Morlion logo


Deleting an NDepend Analysis From Trend

If you’ve ever had to remove an NDepend analysis from a longer trend, you know it can’t be done from the UI. I had this situation when I accidentally modified some stuff that made an incorrect outlier in my trend charts:

I wanted to remove that outlier. Doing so, require diving into the outputs of NDepend.

First, in your NDependOut folder, there are folders for each analysis you made, by date:

Go into those folders and remove the date you want to remove.

Next, there are NDependReport.html files that contain the report for each analysis. These HTML files contain the graphs which are rendered by JavaScript. Open the NDependOut folder in VS Code (for example) and do a replace using regular expressions. I used this regular expression to remove everything for the given date and time:

{date: new Date(2023,2,22,13,53,8),(.|\n)*?},

Just replace it with an empty string. This removes all the entries for that date.

Finally, to remove the entry in the graphs that the NDepend application shows, go into the TrendMetrics folder (under NDependOut) and open the NDependTrendData xml file. You may see an entry for the date you want to remove:

Remove that entry and load the project in NDepend again. The date is now gone in the charts:

Leave a Reply

Your email address will not be published. Required fields are marked *