I’m looking to be able to integrate into our build process the ability to compare after each build against the prior build any code changes made on any dependencies for a list of specific methods.
So, if I have two methods that access the database, I want to be able to tell if any method that called either of these two methods, all the way up the dependency tree have had any code changes.
Such code query should answer your need:
// <Name>Methods that call Parse(String) or get_TestName() and that was added or where cpde was changed</Name>
from m in Methods
let depth0 = m.DepthOfIsUsing("NUnit.Core.RuntimeFramework.Parse(String)")
let depth1 = m.DepthOfIsUsing("NUnit.Core.Test.get_TestName()")
where (depth0 >= 0 || depth1 >= 0)
&& (m.CodeWasChanged() || m.WasAdded())
orderby (depth0 != null ? depth0 : depth1)
select new { m, depth0, depth1 }
Of course with the prefix warnif count > 0
you can transform it into a rule if you wish.
Here is this code query in action, underline methods are the ones where code was changed since baseline, methods in bold are the ones added since baseline.
You can right click an underlined methods to ask to see diff in source code with your preferred diff tool.
You can also export the result to a graph (button Export to Graph) but then you might get disjoint graphs, since methods unchanged will be missing:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With