Abdu
Abdu

Reputation: 16575

Tool to calculate # of lines of code in code behind and aspx files?

Looking for a tool to calculate the # of lines of code in an asp.net (vb.net) application.

The tricky part is that it needs to figure out the inline code in aspx files also.

So it will be lines of code in vb files (minus comments) plus the inline code in aspx files (not all the lines of aspx files, just the code between <% %> tags.

Upvotes: 6

Views: 4933

Answers (4)

Brandon
Brandon

Reputation: 6872

From a previous post, Source Monitor appears to be the answer and NDepend for .NET.

Upvotes: 2

MetroidFan2002
MetroidFan2002

Reputation: 29878

I've had great experience with CLOC. It has a wide variety of command line options. One counter-intutive thing with it, though, the first command line argument is the directory to begin counting in, usually you can just place cloc into the parent directory of your source and use "." (it goes through subdirectories of the specified directory).

Upvotes: 2

Gulzar Nazim
Gulzar Nazim

Reputation: 52178

SlickEdit has some feature for that. I am not sure if it counts inline code. Worth giving it a try. If it does not work, let me know so that I can update my post.

The SLOC Report The SLOC Report tool provides an easy way to count the lines of code. The line count is divided into three categories: code, comments, and whitespace. Once the lines of code have been counted, the results are drawn as a pie graph. SLOC reports may be generated for solutions, projects or individual files.

Upvotes: 7

Mark McDonald
Mark McDonald

Reputation: 8180

I've not tried it myself but LineCounterAddin is visual studio plugin that includes the step-by-step guide to it's creation. It supports the formats you're asking about (VB and ASPX) as well as heaps more (e.g. XML, XSD, TXT, JS, SQL...).

Upvotes: 2

Related Questions