CRAP for C++ ?

View: New views
8 Messages — Rating Filter:   Alert me  

CRAP for C++ ?

by Srdjan Todorovic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I noticed an interesting Java project called CRAP4J (www.crap4j.org),
to detect code that smells. While this seems really neat, there's no
C++ support currently.

The first 3 pages of Google results seem to only be talking/ranting
about C++ *being* crap - and this is obviously not what I'm looking
for.

Does anyone know of any CRAP frameworks for C++?

Apologies for cross-posting - I am not sure which of the two lists is
more concerned with this topic, however this shouldn't be off-topic to
either.

Specifically, my problem is that I'm adding unit tests and refactoring
legacy code, but have no automated way to tell me how much of the
project has test coverage and what the quality of the test coverage is
like.

Thank you,
Srdjan

Re: CRAP for C++ ?

by Daan de Wit-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Srdjan,

Have a look at this stackoverflow topic:
http://stackoverflow.com/questions/1433632/is-there-a-findbugs-and-or-pmd-equivalent-for-c-c

Kind regards,
Daan

2009/11/2 Srdjan Todorovic <todorovic.s@...>

>
>
> Hello,
>
> I noticed an interesting Java project called CRAP4J (www.crap4j.org),
> to detect code that smells. While this seems really neat, there's no
> C++ support currently.
>
> The first 3 pages of Google results seem to only be talking/ranting
> about C++ *being* crap - and this is obviously not what I'm looking
> for.
>
> Does anyone know of any CRAP frameworks for C++?
>
> Apologies for cross-posting - I am not sure which of the two lists is
> more concerned with this topic, however this shouldn't be off-topic to
> either.
>
> Specifically, my problem is that I'm adding unit tests and refactoring
> legacy code, but have no automated way to tell me how much of the
> project has test coverage and what the quality of the test coverage is
> like.
>
> Thank you,
> Srdjan
>  
>


[Non-text portions of this message have been removed]


Re: CRAP for C++ ?

by Morgan Persson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If its managed C++ crap4n will work for you.

Kind regards,
Morgan

On Mon, Nov 2, 2009 at 4:35 PM, Srdjan Todorovic <todorovic.s@...
> wrote:

>
>
> Hello,
>
> I noticed an interesting Java project called CRAP4J (www.crap4j.org),
> to detect code that smells. While this seems really neat, there's no
> C++ support currently.
>
> The first 3 pages of Google results seem to only be talking/ranting
> about C++ *being* crap - and this is obviously not what I'm looking
> for.
>
> Does anyone know of any CRAP frameworks for C++?
>
> Apologies for cross-posting - I am not sure which of the two lists is
> more concerned with this topic, however this shouldn't be off-topic to
> either.
>
> Specifically, my problem is that I'm adding unit tests and refactoring
> legacy code, but have no automated way to tell me how much of the
> project has test coverage and what the quality of the test coverage is
> like.
>
> Thank you,
> Srdjan
>  
>


[Non-text portions of this message have been removed]


Re: CRAP for C++ ?

by liam mail :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/11/2 Srdjan Todorovic <todorovic.s@...>

>
> Specifically, my problem is that I'm adding unit tests and refactoring
> legacy code, but have no automated way to tell me how much of the
> project has test coverage and what the quality of the test coverage is
> like.
>
> Thank you,
> Srdjan
>  __._,_.__
>
>
>
Code coverage and static analysis are two different beasts.
For static analysis there are a number of paid options including Pclint,
Parashift plus:
/analyze flag using VS9 team system
http://msdn.microsoft.com/en-us/library/d3bbz7tz.aspx
-Weffc++ flag using g++
http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#C_002b_002b-Dialect-Options
CppCheck
http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Main_Page

For Code coverage again there are a number of paying options plus
g++ http://gcc.gnu.org/onlinedocs/gcc/Gcov.html#Gcov
VS 9 Team http://msdn.microsoft.com/en-us/library/ms182496%28VS.80%29.aspx

Liam


[Non-text portions of this message have been removed]


Re: CRAP for C++ ?

by Srdjan Todorovic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The code's C++/Linux, so not managed and not part of the .Net framework.
I think that's what you meant with regards to managed C++.

Thanks
Srdjan

On 02/11/2009, Morgan Persson <lazydev@...> wrote:

> If its managed C++ crap4n will work for you.
>
> Kind regards,
> Morgan
>
> On Mon, Nov 2, 2009 at 4:35 PM, Srdjan Todorovic <todorovic.s@...
>> wrote:
>
>>
>>
>> Hello,
>>
>> I noticed an interesting Java project called CRAP4J (www.crap4j.org),
>> to detect code that smells. While this seems really neat, there's no
>> C++ support currently.
>>
>> The first 3 pages of Google results seem to only be talking/ranting
>> about C++ *being* crap - and this is obviously not what I'm looking
>> for.
>>
>> Does anyone know of any CRAP frameworks for C++?
>>
>> Apologies for cross-posting - I am not sure which of the two lists is
>> more concerned with this topic, however this shouldn't be off-topic to
>> either.
>>
>> Specifically, my problem is that I'm adding unit tests and refactoring
>> legacy code, but have no automated way to tell me how much of the
>> project has test coverage and what the quality of the test coverage is
>> like.
>>
>> Thank you,
>> Srdjan
>>
>>
>
>
> [Non-text portions of this message have been removed]
>
>

Re: CRAP for C++ ?

by Srdjan Todorovic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On 02/11/2009, liam mail <liam.list@...> wrote:

> 2009/11/2 Srdjan Todorovic <todorovic.s@...>
>> Specifically, my problem is that I'm adding unit tests and refactoring
>> legacy code, but have no automated way to tell me how much of the
>> project has test coverage and what the quality of the test coverage is
>> like.
> Code coverage and static analysis are two different beasts.
> For static analysis there are a number of paid options including Pclint,
> Parashift plus:
> /analyze flag using VS9 team system
> http://msdn.microsoft.com/en-us/library/d3bbz7tz.aspx
> -Weffc++ flag using g++
> http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#C_002b_002b-Dialect-Options


I have just looked at -Weffc++ and it does throw up a lot of warnings,
many of which are from the standard libs. The gcc documentation does
suggest filtering those out, so this could be very useful. However I
think this is more of a general tool to use and not for test
coverage/cyclomatic complexity.
Still, thank you very much for the pointer to this.

> CppCheck
> http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Main_Page


Not yet had a chance to look into this, but it also seems similar in
use to -Weffc++ in that it warns about possible abuse but not actual
code coverage nor the cyclomatic complexity of a method. I will take a
closer look at it in the next few days - thanks.

> For Code coverage again there are a number of paying options plus
> g++ http://gcc.gnu.org/onlinedocs/gcc/Gcov.html#Gcov

I just tried this, and although I do not fully understand the output,
it looks very promising.

Although what you have posted won't directly get me the CRAP value of
a method, it is nevertheless extremely useful. Thank you.

Regards,
Srdjan

Re: CRAP for C++ ?

by James Martin-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Take a look at http://cppdepend.com. They have a command line version if
you're not using VS. It includes most of the same metrics as crap4j and is
probably more comprehensive in some areas. The SQL-like querying is a pretty
nice feature. Also check out this blog, it has some useful case studies:
http://cppdepend.wordpress.com/


Thanks,
James.


On Tue, Nov 3, 2009 at 2:35 AM, Srdjan Todorovic <todorovic.s@...
> wrote:

> Hello,
>
> I noticed an interesting Java project called CRAP4J (www.crap4j.org),
> to detect code that smells. While this seems really neat, there's no
> C++ support currently.
>
> The first 3 pages of Google results seem to only be talking/ranting
> about C++ *being* crap - and this is obviously not what I'm looking
> for.
>
> Does anyone know of any CRAP frameworks for C++?
>
> Apologies for cross-posting - I am not sure which of the two lists is
> more concerned with this topic, however this shouldn't be off-topic to
> either.
>
> Specifically, my problem is that I'm adding unit tests and refactoring
> legacy code, but have no automated way to tell me how much of the
> project has test coverage and what the quality of the test coverage is
> like.
>
> Thank you,
> Srdjan
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>


[Non-text portions of this message have been removed]


Re: CRAP for C++ ?

by Sean Corfield :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 2, 2009 at 7:35 AM, Srdjan Todorovic
<todorovic.s@...> wrote:
> I noticed an interesting Java project called CRAP4J (www.crap4j.org),
> to detect code that smells. While this seems really neat, there's no
> C++ support currently.

You might want to look at QA C++ from Programming Research as a good
source code analysis tool for detecting a variety of problems:

http://programmingresearch.com/QACPP_MAIN.html

They do solutions for C and Java as well (and used to do a FORTRAN
tool). Programming Research do a lot of work on coding standards and
automated compliance.

Disclaimer: I worked there in the early 90's and the tools were pretty
good then but I haven't tracked their progress since I left - I would
assume they've continued to improve :)
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies US -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood