1

I'm calculating SLOC (Source Lines of Code) count of some of the packages for my research purposes. I'm downloading source of packages for different years from Debian snapshots. For most of the packages SLOC count increase with year, like for Wireshark in 2010 SLOC is less then 2011 it is more and keep on increasing till 2018.

But for OpenJDK 6, 7, and 8, it's different. openjdk-7 has a smaller SLOC count than openjdk-6. openjdk-8 has a smaller SLOC count than openjdk-7. Why is it so?

Is there some problem in Debian snapshots? Perhaps the complete source is not available, or is it like this in general for this package?

3

If you look at the contents of the OpenJDK source packages, you’ll see that most of their source code is shipped inside tarballs inside the packages. If you run David A. Wheeler’s SLOCCount on the extracted package source only, it won’t count the code in those tarballs, so you’ll get a very partial count.

To properly compare the source code sizes, you’ll need to extract the tarballs before running sloccount. Doing this gives the following stats (on the versions I analysed):

            openjdk-6           openjdk-7           openjdk-8
java:       2860304 (68.33%)    3232714 (72.32%)    3601973 (67.00%)
cpp:         648574 (15.49%)     671628 (15.03%)     892040 (16.59%)
ansic:       584813 (13.97%)     466742 (10.44%)     374378 (6.96%)
sh:           49935 (1.19%)       45608 (1.02%)       32891 (0.61%)
xml:          23937 (0.57%)       25927 (0.58%)      456037 (8.48%)
objc:                             13062 (0.29%)       13557 (0.25%)
asm:          14125 (0.34%)       11555 (0.26%)        3508 (0.07%)
perl:          2258 (0.05%)        1220 (0.03%)         198 (0.00%)
pascal:        1089 (0.03%)
awk:            631 (0.02%)         687 (0.02%)         367 (0.01%)
python:         310 (0.01%)         310 (0.01%)         800 (0.01%)
haskell:                            195 (0.00%)         195 (0.00%)
sed:                                                    172 (0.00%)
cs:              72 (0.00%)          72 (0.00%)          72 (0.00%)
ruby:                                44 (0.00%)          44 (0.00%)
jsp:             24 (0.00%)          24 (0.00%)          24 (0.00%)
csh:              3 (0.00%)           3 (0.00%)           3 (0.00%)

showing an increase in size (note however that the scope of the packages has changed with time too).

  • yes, you are right. I extracted all the tar's..now its calculating correct. Thanks you so much. – Hazel Sep 3 '18 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.