Skip to main content
Topic: Code comments (Read 7239 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Code comments

Looking at the Ohloh page, there is this factoid:
Quotewith a low number of source code comments
following the link we discover that:
Quote from: https://www.ohloh.net/p/ElkArte/factoids#FactoidCommentsLow ElkArte is written mostly in PHP.

Across all PHP projects on Ohloh, 32% of all source code lines are comments. For ElkArte, this figure is only 20%.

This lack of comments puts ElkArte among the lowest one-third of all PHP projects on Ohloh.

A high number of comments might indicate that the code is well-documented and organized, and could be a sign of a helpful and disciplined development team.

So, I'd say that one of the goals for 1.1 should be to reach at least a 25% of code comments.
I think it is not impossible... at least if I stop committing uncommented code. O:-)
Bugs creator.
Features destroyer.
Template killer.

Re: Code comments

Reply #1

Quote from: emanuele – Looking at the
I think it is not impossible... at least if I stop committing uncommented code. O:-)
LOL, but yes, that's a goal we can reach..
Thorsten "TE" Eurich
------------------------

Re: Code comments

Reply #2

Yeah!  You know I love commented code :D ... it helps with my CRS syndrome.  To note at some point that was below 19% so we have made some progress.  Some areas just need general flow comments, others really need all the options listed (ie. createlist) and what they do.

LanguageCode LinesComment LinesComment RatioBlank LinesTotal Lines
PHP366,50392,98220.2%66,114525,599
 CSS50,4365,0849.2%2,45057,970
 JS38,07013,50826.2%8,35259,930

Re: Code comments

Reply #3

For that you can do what I do: search the code! ;D lol

Quote from: Spuds – To note at some point that was below 19% so we have made some progress.  Some areas just need general flow comments, others really need all the options listed (ie. createlist) and what they do.
That one would require a hundred or so lines of header alone! LOL

That means to reach 25% of comments we have to add ~30,000 lines of comments!! xD (Actually ~15k because Ohloh counts the site code as well that is basically a duplicate (slightly outdated, just updated) of the main repo, so probably even some less.)
Bugs creator.
Features destroyer.
Template killer.

Re: Code comments

Reply #4

Quote from: emanuele –
Quote from: Spuds – it helps with my CRS syndrome.
For that you can do what I do: search the code! ;D lol
Wait, what are we talking about again?
Quote from: emanuele –
Quote from: Spuds – To note at some point that was below 19% so we have made some progress.  Some areas just need general flow comments, others really need all the options listed (ie. createlist) and what they do.
That one would require a hundred or so lines of header alone! LOL
Yes, helps with the count in one easy function :P
Quote from: emanuele –
Quote from: Spuds – [...]
That means to reach 25% of comments we have to add ~30,000 lines of comments!! xD (Actually ~15k because Ohloh counts the site code as well that is basically a duplicate (slightly outdated, just updated) of the main repo, so probably even some less.)
Well we better get started then

 Spuds is really liking the split quote function !

Re: Code comments

Reply #5

I'll just PR a file that is nothing but 30K of comments. :D
Success is not the result of spontaneous combustion, you must set yourself on fire!

Re: Code comments

Reply #6

QuoteFor ElkArte, this figure is only 21%.
3 weeks, +1%! :D (Well, it may be that we were at 20.49 3 weeks ago and 20.51 today, but still it's a 1%! :P
Bugs creator.
Features destroyer.
Template killer.

Re: Code comments

Reply #7

Updating Spuds table:
LanguageCode LinesComment LinesComment RatioBlank LinesTotal Lines
PHP361,87595,69420.9%66,453524,022
CSS53,5125,8719.9%2,64462,027
JS36,59412,23825.1%7,74156,573
Less php lines probably because... dunno, something big has been removed? I don't remember... oh well, less lines == less bugz!
There are approx. 3000 lines of comments more than 3 weeks ago, good job!! :D
Apparently we lost 1300 lines of comments in javascript...that's slightly odd...
Bugs creator.
Features destroyer.
Template killer.

Re: Code comments

Reply #8

Maybe when you updated the site branch?  I seem to recall you saying that was being counted in all of this?

Re: Code comments

Reply #9

Quote from: Spuds – I seem to recall you saying that was being counted in all of this?
yep, the site repo is currently part of the repo collection on Ohloh.. I'd personally remove it since it's almost identical with the normal elkarte repo.
Thorsten "TE" Eurich
------------------------

Re: Code comments

Reply #10

I added yesterday (or it was Sunday? Don't remember) a kind of "ignore" to ohloh for this repo to ignore anything into /community/. Looks like it is working.
But now the percentage is back to 20% again... lol
Bugs creator.
Features destroyer.
Template killer.