top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Is there any other tool except "cloc" for calculating sloc for "C" lang based code ?

+6 votes
416 views

Can someone please share the tool(s) except "cloc" for sloc.

posted Sep 26, 2013 by Vimal Kumar Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Try SLOCCount and it is GPL. Once it's installed all you need to do is type this to measure all the code in a given directory (including its descendants):

  sloccount directoryname

SLOCCount can automatically identify and measure the following languages (common extensions for the language are listed in parentheses):

Ada (.ada, .ads, .adb)
Assembly (.s, .S, .asm)
awk (.awk)
Bourne shell and variants (.sh)
C (.c)
C++ (.C, .cpp, .cxx, .cc)
C shell (.csh)
COBOL (.cob, .cbl) as of version 2.10
C# (.cs) as of version 2.11
Expect (.exp)
Fortran (.f)
Haskell (.hs) as of version 2.11
Java (.java)
lex/flex (.l)
LISP/Scheme (.el, .scm, .lsp, .jl)
Makefile (makefile) - not normally shown.
Modula-3 (.m3, .i3) as of version 2.07
Objective-C (.m)
Pascal (.p, .pas)
Perl (.pl, .pm, .perl)
PHP (.php, .php[3456], .inc) as of version 2.05
Python (.py)
Ruby (.rb) as of version 2.09
sed (.sed)
SQL (.sql) - not normally shown.
TCL (.tcl, .tk, .itk)
Yacc/Bison (.y)

For more detail please look at the documentation.

answer Sep 27, 2013 by Meenal Mishra
Similar Questions
+3 votes

Please let me know any open source c/c++ static code analysis tool, I need to use that tool for stataic analysis

+1 vote

Tool, which is having good performance, high Scalability and should revirew document as well

+1 vote

There is a use case in which two machines are located in same network or different network but both are reachable to each other.
Can remotely captured packets in one machine be seen in wireshark running in another machine on real time basis ?

+3 votes

There are two well known tools that I know are valgrind and purify. which one would be good choice ?

...