Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1019787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:04:03+00:00 2026-05-16T11:04:03+00:00

I have been using SourceMonitor on my project for a couple of years to

  • 0

I have been using SourceMonitor on my project for a couple of years to keep records of source-code complexity and basic SLOC (including comments) for C# and C++ components. These are used for external reporting to our customer, so I’m not in a position to argue their merits or lack of.

I’ve been working on a repository analysis tool which is able to give me a snap-shot view of the project at any date/time. The next stage I want to add is caching of the metrics for a specified file and revision.

I know SourceMonitor can be scripted to allow me to supply the files to be tested and grab the metrics out of the result file CSV or XML.

Is there a native library in .NET that I could use to do the same thing — e.g. avoid spawning an external process and parsing the results.

I only really need the following metrics:

  • SLOC
  • Number of comment lines
  • Complexity of most complex method
  • Name of most complex method

I need to run this on C# code and normal C++ code.

Edit: since I already have tool which provides the GUI and reports I want, the metrics need to be scripted or generated using a library/API without manual steps. Ideally I want to get metrics for a specified file/revision (rather than a whole project) which my utility will drag from version-control automatically.

NOTE: I created a bounty for this and was on holiday when it expired… the NDepends answer does NOT satisfy me as it doesn’t look at source-code but the assembly itself!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:04:03+00:00Added an answer on May 16, 2026 at 11:04 am

    Whilst I never did find a .NET product that can equally parse C# and C++, I did manage to find an easy-to-use product, CODECOUNT that supports those languages and many more.

    It has a simple command line, unlike SourceMonitor that was being used on my project up until CODECOUNT replaced it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using the CSLA framework for couple of years now for windows
I have been using return by reference to try to speed up my code
I have been using WPF for a new project which is far from done.
I have been using git to push my local code to a server. I
I have been using SQL Server Management Studio for years. Yesterday, when I started
I have been using the following code for loading JQuery in all of my
I have been using doctrine with zend in a project without modules. It is
I have been using Castle MonoRail for the last two years, but in a
I have been using ASP.NET for years, but I can never remember when using
I have been using git on my windows box to track a project I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.