How to count lines of code in a . NET Solution?

Asked

Viewed 3,377 times

8

What are all solutions (free or not) to count lines of code in a solution. NET?

Use two Visual Studios: 2012 and 2013.

2 answers

12


Right click on the solution then click on Calculate Code Metrics.

inserir a descrição da imagem aqui

This window will appear:

inserir a descrição da imagem aqui

Another way is to use the screen to search all documents Ctrl+shift+F

with the following regex: ^(?([^\r\n])\s)*[^\s+?/]+[^\n]*$

don’t forget to check the regex box

1

Just go to the Analyze menu -> Calculate Code Metrics

An alternative would be to use Powershell, where you can count all the lines that are not blank from a Solution. To do this, simply specify the directory and the extension of the files in which the count will be performed (.Cs, . xaml, etc):

PS> Set-Location CaminhoDaSolution
PS CaminhoDaSolution> (dir -include *.extensao1, *.extensao2, *.extensao3 -recurse | select-string .).Count

Browser other questions tagged

You are not signed in. Login or sign up in order to post.