📜 ⬆️ ⬇️

Counting Comments Open Source Projects

A few years ago I wrote a small utility to count the number of comments. It was very interesting to count and analyze comments in projects over which he worked, and subsequently in large Open Source projects. This article presents the results obtained for popular Open Source projects.



The results table is provided below and consists of the following columns:
')
1. Project name and version.
2. The number of characters code.
3.% of comments from the total amount of code.
4. The ratio of the number of lines of code to the number of comments.
5. The number of words todo + fixme. Indicator of how much is left to finalize the project.

Name and versionAmount of code% of commentslines of code /
comments
todo + fixme
Apache OpenOffice 3.4.1279 M16.3%3.36557
Mozilla Firefox 14.0.1163 M25.5%4.51338
Qt 4.6.457 M19.9%7.0395
Blender 2.6371 M10.9%6.01477
Gimp 2.8.233 M7.7%10.6227
OGRE 1.9.023 M23.5%3.5421
Inkscape 0.48.219 M18.7%5.01556
VLC media player 2.1.020 M14.7%6.31155
Php 5.4.645 M10.6%6.2277
Mediawiki 1.19.115 M14.8%5.0546
7-zip 9204.2 M5.9%25.60
Zlib 1.2.7694 K40.9%4.00

Analysis Note:
Zlib analyzed all files except the contrib directory.
Qt analyzed the qt-everywhere-opensource-src-4.6.4 \ src folder with the exception of the 3rdparty.
In wikimedia, all folders except languages ​​were analyzed (thanks for the advice).
Samples folder has been excluded from Ogre.

It is worth noting that the first comment of the file was not taken into account when calculating, because most likely it is a copyright. From the above results it can be seen that on average the number of comments is about 15%. Of course, OpenOffice stands out with 6557 fixme + todo. From these comments:

If you want to conduct this test yourself, link to the utility: unick-soft.ru/soft/commentCounter.zip

Thanks to VBart for the link to the www.ohloh.net service where you can find a large number of open source projects. Among other things, the service displays statistics on the number of comments in them.

Source: https://habr.com/ru/post/150485/


All Articles