Is it possible to find the number of lines of code in an entire solution? I've heard of MZ-Tools, but is there an open source equivalent?
Visual-studio – How to count the lines of code in a Visual Studio solution
code metricsline-countlines-of-codevisual studio
Related Topic
- Python – How to get line count of a large file cheaply in Python
- Visual-studio – Proper way to rename solution (and directories) in Visual Studio
- C# – How to remedy “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning
- Visual-studio – Difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio
- Visual-studio – How to auto format code in Visual Studio
- Visual-studio – Can you force Visual Studio to always run as an Administrator in Windows 8
- Git – Can you get the number of lines of code from a GitHub repository
Best Answer
I've found powershell useful for this. I consider LoC to be a pretty bogus metric anyway, so I don't believe anything more formal should be required.
From a smallish solution's directory:
That will count the non-blank lines in all the solution's .cs and .xaml files. For a larger project, I just used a different extension list:
Why use an entire app when a single command-line will do it? :)