Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Get the statistic info about the source code.

You must be registered to post a reply.
Click here to register.

Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji

Forum code is on.
Html is off.

Check to subscribe to this topic.

T O P I C    R E V I E W
alanchen Posted - Sep 12 2014 : 8:38:48 PM
Does Visual Assist support to display the statistic info about my visual studio 2008 project, for example:

1. Number of source codelines
2. Number of comment llines.
3. Number of functions.
4. Number of classes.


4   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Sep 19 2014 : 12:05:20 AM
Sadly we still don't have any plans to offer any form of API. Put it this way, Microsoft removed the macros from the IDE since in general people did not use them. I did use IDE macros, so I didn't like this decision, but I do understand it. Suggesting on the forum you can use an IDE macro to solve a problem met with total silence nearly all of the time.

VA does not need to count the number of lines in files, or the number of comment lines, this has no baring on what we are interested in, so you could not even ask us, currently, for this information. Since these numbers won't really change very quickly a tool just to report these numbers would only need to be run every week or so.

If you want the number of files in your solution, or the number of members in a class, you can get specific numbers by using the Open File or Find Symbol dialogs, and looking at the numbers in the title bar as you filter the dialogs, to see how many items match your filter.
foxmuldr Posted - Sep 18 2014 : 11:07:31 AM
Originally posted by alanchen

Do you offer an API so that I can access the parsed info by Visual Assist?

VAX does not offer an API. I have asked for this before on more than one occasion, but they have had no plans to add one since at least 2007 when I first asked, and in 2012 when I asked again. I did get further the second time. I told them perhaps in five more years I would finally get it. We'll see.

You can use this RegEx to find out how many lines there are. This will exclude comments and blank lines in C/C++ code:


Do a "Find all in solution" and it will show you every line, and the number of matches will be your SLOC. It does not provide other statistics though. I found that RegEx from a Stack Overflow question where someone asked the same thing you asked here ... an easy way to get some stats.

Perhaps the VAX folk could add a function to execute this search internally to a private find area, and then dump the results after obtaining the count to give you at least one metric. Finding other RegEx to find other things shouldn't be too hard, and they could use those for the other statistics.

There are other plugins for Visual Studio which probably offer this information.

Best regards,
Rick C. Hodgin
alanchen Posted - Sep 18 2014 : 09:17:34 AM
Do you offer an API so that I can access the parsed info by Visual Assist?
feline Posted - Sep 12 2014 : 8:44:03 PM
Unfortunately not really, no. We are interested in working out what a symbol "means", rather than counting them. You can get some information, on a symbol by symbol basis by using some of our features, but they are not designed to give you the sort of overview you are talking about here.

© 2021 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000