longyiqi/oclint — Issue #11: #define should not be treated in the target file being inspected
Author: lqi
Created: 2011-11-04 16:52:28+00:00
State: open
Labels: false positive, rule improvement

We found #define will be treated in the target file being inspected when inspect [libspotiy10 branch of Repeatify](https://github.com/lqi/repeatify/tree/bec3a5e166bcdf4296ef114101d9f82eacf65fad), and cause false positives. Like parameters in

#define CM_IUNKNOWN_C_GUTS \
void *_reserved; \
SInt32 (*QueryInterface)(void *thisPointer, CFUUIDBytes iid, void ** ppv); \
UInt32 (*AddRef)(void *thisPointer); \
UInt32 (*Release)(void *thisPointer)

from line 5903 of _/.../Carbon.framework/Frameworks/HIToolbox.framework/Headers/Menus.h_ will be reported as unused method parameter.

The report for inspection mentioned above is attached:

OCLint Report:

/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/CarbonEventsCore.h:615:28: oclint: long parameter list
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Menus.h:5903:33: oclint: unused method parameter
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Menus.h:5903:58: oclint: unused method parameter
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Menus.h:5903:71: oclint: unused method parameter
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Menus.h:5904:27: oclint: unused method parameter
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Menus.h:5905:26: oclint: unused method parameter
repeatify/repeatifyAppDelegate.m:111:1: oclint: long method
repeatify/repeatifyAppDelegate.m:172:1: oclint: high cyclomatic complexity
repeatify/repeatifyAppDelegate.m:172:1: oclint: long method
repeatify/repeatifyAppDelegate.m:368:46: oclint: unused method parameter
repeatify/repeatifyAppDelegate.m:388:35: oclint: unused method parameter
repeatify/repeatifyAppDelegate.m:469:38: oclint: unused method parameter
repeatify/repeatifyAppDelegate.m:476:28: oclint: unused method parameter
repeatify/repeatifyAppDelegate.m:481:32: oclint: unused method parameter
repeatify/repeatifyAppDelegate.m:521:34: oclint: unused method parameter
repeatify/repeatifyAppDelegate.m:525:34: oclint: unused method parameter
repeatify/repeatifyAppDelegate.m:540:1: oclint: long method
repeatify/repeatifyAppDelegate.m:609:1: oclint: high cyclomatic complexity
qrepeatify/RPPlaybackManager.m:52:55: oclint: unused method parameter

[OCLint (http://oclint.org) v0.4.0]