UsePreferredTermsRule - Cant Can't Cannot

0 views
Skip to first unread message

Steve Dunn

unread,
Nov 12, 2009, 6:29:59 AM11/12/09
to Gendarme
Hi,
I've got this rule:
Target: System.Boolean Foo.MessageStatus::CanTransitionTo
(Foo.MessageStatus)
Assembly: Foo, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null

Severity: Medium Confidence: High
Source: C:\Foo\MessageStatus.cs(≈63)
Details: Term 'Cant' should be replaced with 'Cannot'.

This method actually reads:
public bool CanTransitionTo( MessageStatus to )...

The rule should shold look for the string in a case sensitive manner,
so Cant & cant are positives, but canT and CanT are negatives.

Cheers,

Steve

Sebastien Pouliot

unread,
Nov 15, 2009, 11:42:12 AM11/15/09
to Gendarme
Yep this is a problem - sadly solving it introduce new ones, e.g.
CANT. The rule checks for 'terms' not the "correct" casing (i.e. it
does not know about other, standard or custom, rule that check for
casing). I added a note to review this [1] - we should at least be
able to reduce the confidence level in most cases.

Thanks
Sebastien

[1] see "Rules TODO/Comments/Enhancements" in the group files
Reply all
Reply to author
Forward
0 new messages