By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,381 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,381 IT Pros & Developers. It's quick & easy.

C code stats tool?

P: n/a
Are there any free C code analysis tools available?

/Why Tea

Nov 16 '06 #1
Share this Question
Share on Google+
24 Replies


P: n/a
Why Tea wrote:
Are there any free C code analysis tools available?

/Why Tea
Well, there's Splint:
http://lclint.cs.virginia.edu/
Nov 16 '06 #2

P: n/a

james of tucson wrote:
Why Tea wrote:
Are there any free C code analysis tools available?

/Why Tea
I didn't mean lint type of tool, sorry. What I meant was a tool that
provided statistics of a code base (might not even compile) so that the
quality of the code could be judged. I used to see a simple tool that
gave total LOC, number of goto's used, number of comments, etc...

/Why Tea

Nov 17 '06 #3

P: n/a
Why Tea a écrit :
james of tucson wrote:
>>Why Tea wrote:
>>>Are there any free C code analysis tools available?

/Why Tea


I didn't mean lint type of tool, sorry. What I meant was a tool that
provided statistics of a code base (might not even compile) so that the
quality of the code could be judged. I used to see a simple tool that
gave total LOC, number of goto's used, number of comments, etc...

/Why Tea
The IDE of lcc-win32 gives you Halstead statistics (software metrics)
lines of code, etc.

http://www.cs.virginia.edu/~lcc-win32
Nov 17 '06 #4

P: n/a
>
The IDE of lcc-win32 gives you Halstead statistics (software metrics)
lines of code, etc.
That looks like a terrific software, will try it out. However, I was
after more of a command line type of software metrics tool to get the
stats and a feel of the quality of the tens of thousands of lines of C
code inherited.

Nov 17 '06 #5

P: n/a
Why Tea said:
However, I was
after more of a command line type of software metrics tool to get the
stats and a feel of the quality of the tens of thousands of lines of C
code inherited.
The quality will be appalling. It almost always is, you know. :-(

The best metrics software I've seen is McCabe's, but it costs a small
fortune. It's worth every penny, *if* you need high quality metrics badly
enough.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 17 '06 #6

P: n/a
Richard Heathfield a écrit :
Why Tea said:

>>However, I was
after more of a command line type of software metrics tool to get the
stats and a feel of the quality of the tens of thousands of lines of C
code inherited.


The quality will be appalling. It almost always is, you know. :-(
You are speaking without knowing what are you talking about.
You do not use my software, how can you say that
"the quality will be appalling"???

Because you like to spread your prejudices as if they were
worth something .

jacob
Nov 17 '06 #7

P: n/a
In article <45**********************@news.orange.fr>,
jacob navia <ja***@jacob.remcomp.frwrote:
>Richard Heathfield a écrit :
>Why Tea said:
>>>However, I was
after more of a command line type of software metrics tool to get the
stats and a feel of the quality of the tens of thousands of lines of C
code inherited.
>The quality will be appalling. It almost always is, you know. :-(
>You are speaking without knowing what are you talking about.
You do not use my software, how can you say that
"the quality will be appalling"???
Are we to infer that Tea inherited the tens of thousands of lines of C
from *you* ??

Richard's remark about the quality being appalling was a reference
to Tea's inherited code, not a reference to the tools provided by lcc.
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
Nov 17 '06 #8

P: n/a
Walter Roberson a écrit :
In article <45**********************@news.orange.fr>,
jacob navia <ja***@jacob.remcomp.frwrote:
>>Richard Heathfield a écrit :
>>>Why Tea said:

>>>>However, I was
after more of a command line type of software metrics tool to get the
stats and a feel of the quality of the tens of thousands of lines of C
code inherited.

>>>The quality will be appalling. It almost always is, you know. :-(

>>You are speaking without knowing what are you talking about.
You do not use my software, how can you say that
"the quality will be appalling"???


Are we to infer that Tea inherited the tens of thousands of lines of C
from *you* ??

Richard's remark about the quality being appalling was a reference
to Tea's inherited code, not a reference to the tools provided by lcc.
Yes it could be, but he answered the wrong thread then...

Tea was referring to the tools I proposed. He could have answered
to the right thread. But OK, he can't use Usenet after all this years.

Forget it
Nov 17 '06 #9

P: n/a

jacob navia wrote:
Richard Heathfield a écrit :
Why Tea said:
>However, I was
after more of a command line type of software metrics tool to get the
stats and a feel of the quality of the tens of thousands of lines of C
code inherited.
The quality will be appalling. It almost always is, you know. :-(

You are speaking without knowing what are you talking about.
He was making a joke; and in my experience, he's quite right.
You do not use my software, how can you say that
"the quality will be appalling"???
What does your software have to do with it? Are you saying you supplied
the code which Why Tea wishes to analyze?
Because you like to spread your prejudices as if they were
worth something .
What are you on about?

Nov 17 '06 #10

P: n/a
[No snippage this time, alas.]

jacob navia said:
Walter Roberson a écrit :
>In article <45**********************@news.orange.fr>,
jacob navia <ja***@jacob.remcomp.frwrote:
>>>Richard Heathfield a écrit :
Why Tea said:
>>>>>However, I was
>after more of a command line type of software metrics tool to get the
>stats and a feel of the quality of the tens of thousands of lines of C
>code inherited.
Here, it is clear that "Why Tea" is referring to the quality of his
inherited code base.
>>>>The quality will be appalling. It almost always is, you know. :-(
Here, it is clear that I was referring to "Why Tea"'s code base, too.
>>>You are speaking without knowing what are you talking about.
Here, it is clear that Mr Navia is talking to himself.
>>>You do not use my software, how can you say that
"the quality will be appalling"???
Well, I didn't. Whether I can or not is neither here nor there, although I
could make a shrewd guess, based on your contributions to comp.lang.c.
>Are we to infer that Tea inherited the tens of thousands of lines of C
from *you* ??

Richard's remark about the quality being appalling was a reference
to Tea's inherited code, not a reference to the tools provided by lcc.

Yes it could be,
Yes, it was.
but he answered the wrong thread then...
No, I didn't.
Tea was referring to the tools I proposed.
No, he wasn't.
He could have answered to the right thread.
I did.
But OK, he can't use Usenet after all this years.
Yes, I can.
Forget it
Gladly.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 17 '06 #11

P: n/a
In article <45**********************@news.orange.fr>,
jacob navia <ja***@jacob.remcomp.frwrote:
>Walter Roberson a écrit :
>In article <45**********************@news.orange.fr>,
jacob navia <ja***@jacob.remcomp.frwrote:
>>>Richard Heathfield a écrit :
>>>>Why Tea said:
>>>>>However, I was
>after more of a command line type of software metrics tool to get the
>stats and a feel of the quality of the tens of thousands of lines of C
>code inherited.
>>>>The quality will be appalling. It almost always is, you know. :-(
>Richard's remark about the quality being appalling was a reference
to Tea's inherited code, not a reference to the tools provided by lcc.
>Yes it could be, but he answered the wrong thread then...
>Tea was referring to the tools I proposed. He could have answered
to the right thread. But OK, he can't use Usenet after all this years.
Jacob, I know that your native language is not English; it appears
that you have accidently misread Richard's response.

In English, Richard's use of "the quality" without further
qualification of which quality, refers back to the closest
prior reference to "quality". The closest prior reference was in
the phrase "the quality of the tens of tousands of lines of C
code inherited". So in English, Richard's "appalling" adjective
modifies the inherited code, not the software metrics tools.

In English, in order for Richard to have been referring to the tools,
his sentance would have had to have been something like,
"The quality of the tools will be appalling."

So Richard's remark was not directed at your tools, but his
remark was in direct response to Tea's mention of quality, so
Richard's remark was -not- to the wrong part of the thread.
--
There are some ideas so wrong that only a very intelligent person
could believe in them. -- George Orwell
Nov 17 '06 #12

P: n/a
Walter Roberson a écrit :
In article <45**********************@news.orange.fr>,
jacob navia <ja***@jacob.remcomp.frwrote:
>>Walter Roberson a écrit :
>>>In article <45**********************@news.orange.fr>,
jacob navia <ja***@jacob.remcomp.frwrote:

>>>>Richard Heathfield a écrit :

>>>>>Why Tea said:

>>>>>>However, I was
>>after more of a command line type of software metrics tool to get the
>>stats and a feel of the quality of the tens of thousands of lines of C
>>code inherited.

>>>>>The quality will be appalling. It almost always is, you know. :-(

>>>Richard's remark about the quality being appalling was a reference
to Tea's inherited code, not a reference to the tools provided by lcc.

>>Yes it could be, but he answered the wrong thread then...

>>Tea was referring to the tools I proposed. He could have answered
to the right thread. But OK, he can't use Usenet after all this years.


Jacob, I know that your native language is not English; it appears
that you have accidently misread Richard's response.

In English, Richard's use of "the quality" without further
qualification of which quality, refers back to the closest
prior reference to "quality". The closest prior reference was in
the phrase "the quality of the tens of tousands of lines of C
code inherited". So in English, Richard's "appalling" adjective
modifies the inherited code, not the software metrics tools.

In English, in order for Richard to have been referring to the tools,
his sentance would have had to have been something like,
"The quality of the tools will be appalling."

So Richard's remark was not directed at your tools, but his
remark was in direct response to Tea's mention of quality, so
Richard's remark was -not- to the wrong part of the thread.
Yes, I think I am getting a bit paranoic.

Excuse me.

Sorry mr heathfield, I misunderstood.

Nov 17 '06 #13

P: n/a
jacob navia said:

<snip>
Sorry mr heathfield, I misunderstood.
No problem. Let's move on.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 17 '06 #14

P: n/a
The IDE of lcc-win32 gives you Halstead statistics (software metrics)
lines of code, etc.

http://www.cs.virginia.edu/~lcc-win32
I had problem downloading the advanced.pdf file. Any idea what is the
problem?

Nov 17 '06 #15

P: n/a
Why Tea a écrit :
>>The IDE of lcc-win32 gives you Halstead statistics (software metrics)
lines of code, etc.

http://www.cs.virginia.edu/~lcc-win32


I had problem downloading the advanced.pdf file. Any idea what is the
problem?
Nothing. Just scroll down in the link to
"Now let me to the downloads"

We were forced to put all those ads to somehow finance
the server costs and the bandwidth used by lcc-win32...

Nov 17 '06 #16

P: n/a
I had problem downloading the advanced.pdf file. Any idea what is the
problem?
Nothing. Just scroll down in the link to
"Now let me to the downloads"

We were forced to put all those ads to somehow finance
the server costs and the bandwidth used by lcc-win32...
I did that and managed to download all other files except the
advanced.pdf.

Nov 17 '06 #17

P: n/a
On 16 Nov 2006 22:28:31 -0800, "Why Tea" <yt****@gmail.comwrote:
>
james of tucson wrote:
>Why Tea wrote:
Are there any free C code analysis tools available?

/Why Tea

I didn't mean lint type of tool, sorry. What I meant was a tool that
provided statistics of a code base (might not even compile) so that the
quality of the code could be judged. I used to see a simple tool that
gave total LOC, number of goto's used, number of comments, etc...

/Why Tea
Sounds like you need grep and wc.

--
Al Balmer
Sun City, AZ
Nov 17 '06 #18

P: n/a
Why Tea" <yt****@gmail.comwrote:
... However, I was
after more of a command line type of software metrics tool to get the
stats and a feel of the quality of the tens of thousands of lines of C
code inherited.
These may help:

http://www.dwheeler.com/sloccount
http://csdl.ics.hawaii.edu/Tools/SCLC

Roberto Waltman
Nov 17 '06 #19

P: n/a

Roberto Waltman wrote:
Why Tea" <yt****@gmail.comwrote:
... However, I was
after more of a command line type of software metrics tool to get the
stats and a feel of the quality of the tens of thousands of lines of C
code inherited.

These may help:

http://www.dwheeler.com/sloccount
http://csdl.ics.hawaii.edu/Tools/SCLC
Thanks Roberto. That's exactly what I'm looking for.

/Why Tea

Nov 17 '06 #20

P: n/a
"Why Tea" wrote:
>Roberto Waltman wrote:
>Why Tea" wrote:
... a command line type of software metrics tool to get the
stats and a feel of the quality of the tens of thousands of lines of C
code ...
...
http://www.dwheeler.com/sloccount
http://csdl.ics.hawaii.edu/Tools/SCLC

Thanks Roberto. That's exactly what I'm looking for.
Welcome. Forgot this one: http://sourceforge.net/projects/cccc

Roberto Waltman
Nov 17 '06 #21

P: n/a
On Fri, 17 Nov 2006 10:25:41 +0100, in comp.lang.c , jacob navia
<ja***@jacob.remcomp.frwrote:
>Walter Roberson a écrit :
>In article <45**********************@news.orange.fr>,
jacob navia <ja***@jacob.remcomp.frwrote:
>>>Richard Heathfield a écrit :

Why Tea said:
>>>>>after more of a command line type of software metrics tool to get the
>stats and a feel of the quality of the tens of thousands of lines of C
>code inherited.
>>>>The quality will be appalling. It almost always is, you know. :-(
>>>You are speaking without knowing what are you talking about.
You do not use my software, how can you say that
"the quality will be appalling"???

Richard's remark about the quality being appalling was a reference
to Tea's inherited code, not a reference to the tools provided by lcc.

Yes it could be, but he answered the wrong thread then...
No he didn't, you just assumed he was insulting you and jumped down
his throat. The thread makesit totally clear that he was commenting on
the probable "quality of the tens of thousands of lines of C".
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Nov 17 '06 #22

P: n/a
"Why Tea" <yt****@gmail.comwrote:
james of tucson wrote:
Why Tea wrote:
Are there any free C code analysis tools available?

I didn't mean lint type of tool, sorry. What I meant was a tool that
provided statistics of a code base (might not even compile) so that the
quality of the code could be judged. I used to see a simple tool that
gave total LOC, number of goto's used, number of comments, etc...
Be careful. Such statistics are a very dubious measure of the real
quality of code, and they're easy to trick. LOC is very simple to pad or
unpad. Number of gotos used is relevant, but should be zero for by far
most files anyway. Number of comments _looks_ relevant, but I've seen
too many comments saying /* Declare global variables here */ or some
such informationless template work to care about their number: their
internal quality is what counts, and you can't get a statistic of that.
/Why Tea
Why? Why, because! Tea because tea because Assam and Chun Mee and
jasmine and... (Yeah, I'm addicted. I know.)

Richard
Nov 21 '06 #23

P: n/a
Be careful. Such statistics are a very dubious measure of the real
quality of code, and they're easy to trick. LOC is very simple to pad or
unpad. Number of gotos used is relevant, but should be zero for by far
most files anyway. Number of comments _looks_ relevant, but I've seen
too many comments saying /* Declare global variables here */ or some
such informationless template work to care about their number: their
internal quality is what counts, and you can't get a statistic of that.
Thanks Richard, I just like to have a feel of how big the code base is.
I just ran one of those tools through one of the subsystems, and there
were over 6 millions LOC's with about 40% of them commented. The info
doesn't tell me how good is the quality of the code, but it's big! My
original guess was about 1 million LOC's only.

In most cases, a good software company follows strict processes in
software design methodology, coding standard, peer reviews, etc. By
looking into the processes and if everyone follows them is probably a
good way to know if the company is making an effort in producing
quality software, hence writing good code.
>
/Why Tea

Why? Why, because! Tea because tea because Assam and Chun Mee and
jasmine and... (Yeah, I'm addicted. I know.)
That's a good one...

Nov 21 '06 #24

P: n/a
Why Tea wrote:
Be careful. Such statistics are a very dubious measure of the real
quality of code, and they're easy to trick. LOC is very simple to pad or
unpad. Number of gotos used is relevant, but should be zero for by far
most files anyway. Number of comments _looks_ relevant, but I've seen
too many comments saying /* Declare global variables here */ or some
such informationless template work to care about their number: their
internal quality is what counts, and you can't get a statistic of that.

Thanks Richard, I just like to have a feel of how big the code base is.
I just ran one of those tools through one of the subsystems, and there
were over 6 millions LOC's with about 40% of them commented. The info
doesn't tell me how good is the quality of the code, but it's big! My
original guess was about 1 million LOC's only.
<snip>

Care to explain the reluctance to provide attributions to quoted
material?

Nov 21 '06 #25

This discussion thread is closed

Replies have been disabled for this discussion.