PDA

View Full Version : Writing Static Analysis Tool



user_mail07
21st December 2011, 00:38
Hi Everyone,

I am planning to write static analysis tool specifically for Qt . I know cppcheck catches many common errors. But there are few cases specific to Qt when analyzing the code written based on Qt. It would be nice if I can get some feedback what kinds of items can be added to set of rules.

For example I have list of rules to cover following items.

1. Analysis of Signal- Slot Connection Mechanism

Added rule to static analysis of SIGNAL-SLOT connections in source code. When using Visual Studio to run an app in debug mode, Qt will report when connect() is called with non-existent SIGNAL or SLOT methods. In genera these message are output only when the QObject::Connect() code is executed, so unless you exercise all parts of the UI, you may not see all of the incomplete connections in the code.

2. QBoxLayout: If the layouts are not aligned in certain order some messages are output only on Visual Studio console debugger when that code is executed. User will never find out unless all parts of the UI are exercised.

Thanks.