jcromanu
jcromanu

Reputation: 1461

Team Foundation Server total lines of code in collection?

Is there anyway to know the current lines of code that are stored in a TFS Collection.

Upvotes: 1

Views: 1482

Answers (2)

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51073

For more detail info of how to use Code Churn, please go through the official tutorial: Analyze and report on code churn and coverage using the code churn and run coverage perspectives

You could find them in TFS’s database (warehouse) that how many lines added ,lines deleted ,lines modified, total lines and so on. Highly suggest you to use this method, not to hard to enable reporting.

enter image description here

If you do not have the reporting enabled, there are no end of tools to count lines in source files in TFS so far. One workaround should be: get the entire collection locally, you can then count the number of lines in every file that is of a type that has code in it (*.cs, vb, aspx, etc.) Many tools can count lines,even though cumbersome but effective method.

For git, a simple way is pushing your code to a github private repo, and then use Google Chrome browser - GLOC extension here. If you do not want to use github as a bridge, you could try to use some script in this question Can you get the number of lines of code from a Github repository?

Upvotes: 0

Daniel Mann
Daniel Mann

Reputation: 58980

For TFVC, assuming you have reporting enabled, you can look at the analysis cube -- under "Code Churn", there's a "total lines of code" metric.

I don't think there's anything equivalent for Git.

This ultimately leads back to the questions:

  • "What are you trying to do with this information?"
  • "What do you consider a 'line of code'?" Is a comment a line of code? How about a line that only contains a curly brace? Does whitespace count?

For what it's worth, there's typically not much value in knowing this number.

Upvotes: 1

Related Questions