We help IT Professionals succeed at work.

Visual Studio 2013 - source code line counts for functions and subs

203 Views
Last Modified: 2019-06-03
Hi Experts,

I'm using Visual Studio 2013 (yes, am roaming with the dinosaurs!) for VB development.

I would like to know the line count for each function and sub, broken down by module.
It would also be nice to be able to sort the results by line count.

Is there a free or inexpensive tool that will do this?

Regards,
Leigh
Comment
Watch Question

Chinmay PatelChief Technology Ninja
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Hi Leigh,

In Visual Studio, Right Click On Project -> Analyze -> Calculate Code Metrics.

Regards,
Chinmay.

Author

Commented:
Hi Chimnay,

I have VS 2013 Professional.

My Project menu does not have Analyze on it?

Regards,
Leigh

Author

Commented:
Hi Chimnay,

I found this:

Code Metrics Viewer 2013 by Matthias Friedrich

Code Metrics Viewer 12.0 integrates the Code Metrics Power Tool 12.0 into Visual Studio 2013 and displays code metrics calculation results in a tool window.

I will try it and let you know...

Regards,
Leigh

Author

Commented:
Hi Chimnay,

I tried installing Code Metrics Viewer 2013 by Matthias Friedrich

Bad news - installation failed.

The log says:

Install Error : Microsoft.VisualStudio.ExtensionManager.MissingTargetFrameworkException: The extension 'Code Metrics Viewer 2013' requires a version of the .NET Framework that is not installed.

I give up!

Regards,
Leigh

Regards,
Leigh
Chinmay PatelChief Technology Ninja
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Hi Leigh,

Don't give up that easily. I am sorry I thought the code metrics was there even before the VS2015 came out. Can you right click on your project, take a screenshot and send it over? I just want to check if it is hidden under some other menu item.

1. Install Code Metrics Powertool for Visual Studio 2013 : https://www.microsoft.com/en-in/download/details.aspx?id=41647
2. You can get any .Net Framework you want from here: https://dotnet.microsoft.com/download. Install .Net Framework 4.5.1 from there, you can go with runtime, no need to get the Dev pack.

Regards,
Chinmay.

Author

Commented:
Hi Chinmay,

Here is my Project menu:

VS2013 Project Menu
PS How do I determine what .Net Framework is required?

Regards,
Leigh
Chief Technology Ninja
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks Chinmay,

You get full marks for persistence!

I also found the top level Menu ANALYSIS also has Calculate Code Metrics on it.

Regards,
Leigh
Chinmay PatelChief Technology Ninja
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Thank you very much Leigh for making my day :)
You get full marks for persistence!
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.