ElkArte Community

Elk Development => Feature Discussion => Topic started by: emanuele on January 09, 2014, 12:12:35 pm

Title: Code comments
Post by: emanuele on January 09, 2014, 12:12:35 pm
Looking at the Ohloh (https://www.ohloh.net/p/ElkArte) 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:-)
Title: Re: Code comments
Post by: TE on January 09, 2014, 12:53:40 pm
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..
Title: Re: Code comments
Post by: Spuds on January 09, 2014, 05:05:22 pm
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
Title: Re: Code comments
Post by: emanuele on January 09, 2014, 06:55:52 pm
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.)
Title: Re: Code comments
Post by: Spuds on January 09, 2014, 10:29:55 pm
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

/me is really liking the split quote function !
Title: Re: Code comments
Post by: IchBin on January 09, 2014, 11:11:42 pm
I'll just PR a file that is nothing but 30K of comments. :D
Title: Re: Code comments
Post by: emanuele on February 01, 2014, 09:09:24 am
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
Title: Re: Code comments
Post by: emanuele on February 01, 2014, 09:17:09 am
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...
Title: Re: Code comments
Post by: Spuds on February 01, 2014, 10:27:39 am
Maybe when you updated the site branch?  I seem to recall you saying that was being counted in all of this?
Title: Re: Code comments
Post by: TE on February 01, 2014, 11:10:47 am
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.
Title: Re: Code comments
Post by: emanuele on February 04, 2014, 04:55:18 pm
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