Guys,
I believe the rule provides value in every cases (1), albeit less in
the internal case and again a bit less for the private case (2). It's
also likely that some people won't be interested in the non-visible
ones (3).
But in any case I'm pretty sure people want to fix, in order: public,
protected, internal and private methods. Right now it's not an easy
task because the rule currently compute the defect severity based on
the distance between the type used and the type required:
Severity sev = (delta < 3) ? Severity.Medium : Severity.High;
and, while useful, I think it would be better to use visibility (and a
more elaborate, well tested, well tuned, future algorithm combining
the two).
So let's say we do something like:
public / protected = High
internal = Medium
private = Low
This will make, by default (since 2.2), the reports skip the private/
Low case (the less "worthy" case), resulting in shorter defect lists
(fulfilling #2). A single change in rules.xml can also block all non-
visible defects for this rule (fulfilling #3). Finally a --
severity=all (or =low+) will report every case (fulfilling #1).
note: I don't think Critical should be used by this rule, examples of
such are welcome ;-)
This is IMO how we should strive to tweak rules because this lets the
runner (not the rule) make the decision about the defects. This will
become more and more important as more sophisticated runners starts to
appear.
> And for what it is worth, FxCop has exactly this rule but under design:
> <http://msdn.microsoft.com/en-us/library/3hk32yyz(VS.80).aspx>.
Then it means we need an [FxCopCompatibility] attribute in the
rule :-)
Seriously FxCop has historically been only about visible stuff in
libraries - that goes with its prefix FX (framework). However that's
something that will likely change since it's a common request (see PDC
videos) and that it limits VS Code Analysis usefulness.
Thanks,
Sebastien
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Gendarme" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/gendarme?hl=en
-~----------~----~----~----~------~----~------~--~---