[SATLUG] The difference between Linux and OpenSSL

Bruce Dubbs bruce.dubbs at gmail.com
Mon Apr 21 14:07:12 CDT 2014


James McGuire wrote:
>> Looking at the openssl tarball, there are 349,834 lines of .c code and 97,247 lines of headers in 1191 files.  Subtract about 50 lines from each file for the copyright header and you get about 370K SLOC.
>
> A really nifty tool for determining SLOC is cloc. I ran it at the root
> of openssl and got these results:
>
>      2354 text files.
>      2135 unique files.
>       762 files ignored.
>
> http://cloc.sourceforge.net v 1.60  T=8.10 s (183.0 files/s, 65198.2 lines/s)
> -------------------------------------------------------------------------------
> Language                     files          blank        comment           code
> -------------------------------------------------------------------------------
> C                              915          32949          68512         234936
> Perl                           169           8713           7982          69248
> C/C++ Header                   187           6542          14756          39729
> make                            76           1709            427          13610
> Assembly                        13           1307           1405          10898
> C++                             26           1860            760           4041
> Bourne Shell                    61            787            693           3403
> m4                               1            514              0           1585
> DOS Batch                       33            417            133           1254
> Lisp                             1              2             19             24
> HTML                             1              2              2              3
> -------------------------------------------------------------------------------
> SUM:                          1483          54802          94689         378731
> -------------------------------------------------------------------------------

This is interesting to me.  One conundrum is how the lines of code are 
measured.  Take for instance the simple command:

if ( x < 1 ) x--;

We can generally agree that this is one line of code.  However, what if 
it's written:

if ( x < 1 )
   x--;

or

if ( x < 1 ) {
   x--;
}

or

if ( x < 1 )
{
   x--;
}

The same thing could be counted as 1, 2, 3, or 4 lines of code.  My own 
preference for counting is to ignore a brace on a line by itself. 
However, there is no standard.  These types of measurements are 
important if we also have development time to go along with the line 
counts so we can get an idea of productivity.  If we just want a rough 
idea of size, then wc works fine as a quick and dirty ruler.

   -- Bruce





More information about the SATLUG mailing list