Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LoC (lines of code) metrics for .NET 2.0 c# projects [closed]

Please suggest some free tools which will help me to get Lines-of-Code metrics for C# projects using the command line.

like image 444
sundar venugopal Avatar asked Nov 17 '08 22:11

sundar venugopal


People also ask

What is LOC in C#?

Function Kata „LOC“Implement a function that counts the Lines of Code (LOC) in a C# source text. The source text is given as a string. The function returns the number of executable lines of code. Lines containing only comments or whitespace should be filtered [1].

How do I see total lines of code in Visual Studio?

We can check all of the lines of code in a file or directory by the command cloc --by-file.

What are code metrics lines?

Lines of Code or LOC (also known as Source Lines of Code - SLOC) is a quantitative measurement in computer programming for files that contains code from a computer programming language, in text form. The number of lines indicates the size of a given file and gives some indication of the work involved.

How do you find code metrics?

You can generate code metrics results for an entire solution in any of the following ways: From the menu bar, select Analyze > Calculate Code Metrics > For Solution. In Solution Explorer, right-click the solution and then select Calculate Code Metrics.


2 Answers

I was searching for a similar tool. Found Microsoft Line of Code (LOC) Counter Its pretty good. Feature list from code.msdn page

Features:

  • Get Latest LOC Count and Code Churn by connecting to source repository such as VSTF, VSS , and File System
  • 16 types of count (latest, Code churn with dates, labels, changesets, etc.,)
  • Customize counting standard to suit your own environment - Add, remove programming languages, set inclusion/exclusion rules
  • Report results by File, Folder, Language, Excluded LOC, and more
  • Predict System Defect Density by applying Microsoft Research on the Code churn data
  • Support for Personal Software Process(SM) / Team Software Process(SM) object level code churn
  • Install either as Windows (XP/Vista, 32bit/64bit) Application or as an add-in to Visual Studio 2005 IDE
  • Save source code selections of a task and run them repeatedly
  • Export results to Excel or PDF
like image 117
rao Avatar answered Sep 27 '22 23:09

rao


i got the LoC using Ndepend

like image 29
sundar venugopal Avatar answered Sep 27 '22 22:09

sundar venugopal