Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How many lines of code?
Message
From
28/03/2019 10:21:24
 
 
To
28/03/2019 08:06:37
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01667626
Message ID:
01667633
Views:
47
>If it's in Visual Studio 2012 or later, there's an RegEx you can use. Copy-and-paste this into your Ctrl+Shift+F (Find Solution) and it will search all source code:
>
^(?!(\s*\*))(?!(\s*\-\-\>))(?!(\s*\<\!\-\-))(?!(\s*\n))(?!(\s*\*\/))(?!(\s*\/\*))(?!(\s*\/\/\/))(?!(\s*\/\/))(?!(\s*\}))(?!(\s*\{))(?!(\s(using))).*$
>
>Here's one that counts all except blank lines and { and }:
>
(^(?!(\s*//.+)))+(^(?!(#.+)))+(^(?!(\s*\{.+)))+(^(?!(\s*\}.+)))+(^(?!(\s*\r?$)))+
>
>In Visual Studio 2010 or earlier, use this one:
>
^~(:Wh@//.+)~(:Wh@\{:Wh@)~(:Wh@\}:Wh@)~(:Wh@/#).+
>
>Also, modern Visual Studio versions have a built-in "Code Metrics" which will tell you things about your code:
>https://docs.microsoft.com/en-us/visualstudio/code-quality/code-metrics-values?view=vs-2017

Thanks

This works.

It is very interesting.

For the line of codes, this is in Analyze\Calculate Code Metrics. It provides additional useful information.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform