Forums : Technical Issue Help

Dear Open Hub Users,

We’re excited to announce that we will be moving the Open Hub Forum to https://community.synopsys.com/s/black-duck-open-hub. Beginning immediately, users can head over, register, get technical help and discuss issue pertinent to the Open Hub. Registered users can also subscribe to Open Hub announcements here.


On May 1, 2020, we will be freezing https://www.openhub.net/forums and users will not be able to create new discussions. If you have any questions and concerns, please email us at [email protected]

Syx comments

Hello,
the analisys says comments are only the 3% of the code. A script I've created to extract comments says there'are about 10k lines of comments (both Smalltalk and C comments, excluding documentation).
All the source code is about 90k lines of code, including plugin wrappers.

Luca Bruno almost 16 years ago
 

hi lethalman,

The tool that we use to count lines of code and comments is called ohcount. It's an open source command-line tool that can give you detailed stats on any file or directory.

Any chance I could bug you to run it against your code and identify what it's getting wrong?

Jason Allen almost 16 years ago
 

This is the report, just like my own tool, while ohloh says there are few comments.

Examining 240 file(s)..
Ohloh Line Count Summary

Language Files Code Comment Comment % Blank Total


c 52 52480 5034 8.8% 16238 73752
smalltalk 95 21654 5221 19.4% 5662 32537
cpp 3 567 164 22.4% 204 935
ruby 3 262 15 5.4% 43 320
autoconf 1 252 36 12.5% 55 343
automake 18 196 0 0.0% 75 271
shell 6 112 6 5.1% 26 144
python 1 37 3 7.5% 11 51
xml 1 11 0 0.0% 1 12
html 1 6 0 0.0% 0 6


Total 181 75577 10479 12.2% 22315 108371

Luca Bruno almost 16 years ago
 

hmm. weird.

I'll ask Robin to take a look tomorrow morning.

Jason Allen almost 16 years ago
 

Hi lethalman,

I did some digging and turned up a bug in our analysis code. It turns out that one of the team members has a net negative total lines of code -- and that this person contributed most of the comments. There's no reason this should have been a problem, but we made a mistake in our code.

I fixed the mistake and re-analyzed the project. We now correctly show that the C portion is 8.8% comments and the overall project is 12.1% comments.

When we create the factoid, we only consider the main language, so in this case we use the C number of 8.8%.

Unfortunately, comparing this project's C comment ratio to other C projects, this still lands in the low category (bottom third), which is still better than the very low label we mistakenly applied to the project previously.

Let me know if you have more questions,

Robin

Robin Luckey almost 16 years ago
 

Why do you consider only the main language? It's a programming language and the comments in the kernel of the language is very important. Though the percentage of the rest of the code is heavy.

However thanks for the job done. Thanks.

Luca Bruno almost 16 years ago
 

We only consider the main language because we are trying to make a relative comparison between projects, and we have to isolate this by language.

For instance, it would be unfair to compare C projects, which have pretty low comments in general, to Java projects, which have pretty high comments in general.

Moreover, projects have a variety of compositions: some have a lot of HTML docs, some don't, some have a lot of build scripts, some don't.

We felt that the best way to get a reasonable comparison was to limit the analysis to the main body of the code, and compare it to other code written in that same language.

Robin Luckey almost 16 years ago
 

Is the 8% only for the syx directory?
If not, could you get the percentage only for the syx directory at least then? Wrappers and Smalltalk contain a huge code that shouldn't be counted as well.

Luca Bruno almost 16 years ago
 

The 8.8% is for all C code in the entire repository. Ohloh doesn't yet have the ability to restrict the count to particular subdirectories.

If you're just curious, you can use the Ohcount tool on your local code tree.

Robin Luckey almost 16 years ago
 

Yes I've just seen the code. Thanks very much for your help. At all in the future wrappers will be removed from syx.

Thanks again.

Luca Bruno almost 16 years ago