Hello there, I am a user of Sonarqube 9.6.1 (latest version as of today) together with the latest scanner (4.7).
We recently had an incident involving a method name defined on a category that was clashing with a private method declaration which was part of the iOS SDK (see Technical Q&A QA1908: Finding and Fixing Category Method Name Clashes for extra information about the potential issue, the resulting unpredictable behaviour and the mitigation/best practice that Apple suggests).
This non-compliance to Apple’s best practices was unfortunately not flagged by Sonarqube, is there any existing rule or any plan to add one that can flag this potential risk/non-compliance? In alternative, does anyone have a custom rule implemented that could achieve the same?
Colin have you had a chance to review the examples? Basically Sonar would have to detect conflicting declarations of methods on categories, like the following:
@interface UIView (MyCategory)
// CORRECT: The method name is prefixed.
- (BOOL)wxyz_isOccludedByView:(UIView*)otherView;
// INCORRECT: The method name is not prefixed. This method may clash with an existing method in UIView.
- (BOOL)isOccludedByView:(UIView*)otherView;
@end