Question

I think I’ve run into a bit of a tricky problem to solve. I need to get a count of our projects that are using code analysis. This is what I've done so far:

  1. First, I installed AstroGrep. That’s a lightweight grep utility for Windows.
  2. Then I ran AstroGrep and pointed to my local C:\DevTfs2010\Apps. It appears that 272 out of 354 .csproj files have this text: <RunCodeAnalysis>true</RunCodeAnalysis> The problem with this approach is that I’m only running this against what I have on my laptop. There is much more in TFS.
  3. So I remoted into the build server because I thought I could just run AstroGrep there. The problem with this approach is that I would be counting the same projects many times; one for the Main branch and another for each version that has been released.

How can I get a count of projects using code analysis without including all of the released versions?

No correct solution

OTHER TIPS

I'll share how I was able to make this work. If anyone has a better way, please share.

On our build server, run AstroGrep to search the .csproj files for code analysis being set to true.

enter image description here

Copy to Excel and use a formula to display a 1 if the path contains “main.”

Note: The reason I used "main" is because all of our main trunks have the word "main" in the folder structure. This eliminates counting all the release versions.

Formula: =IF(ISNUMBER(SEARCH("main",A1)), 1, 0)

enter image description here

Count the total for Core and for Apps (our two main team projects), and there’s your number.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top