On Tue, Feb 17, 2009 at 10:26 AM, Rolf Bjarne Kvinge
Actually a stfld to 'this' is not necessarily safe, it depends on how
the method was called - callvirt does a nullcheck when calling, while
call doesn't (VB and C# compilers will always insert a callvirt when
an instance method is called, so this isn't necessarily true. This
Hi Sebastien
My time to say sorry for the delay now ;-)
The wiki has history, so this wasn't a problem.
At the time I was fooled by the fact that nothing was written to the
console, now that I've found the html report I have fixed
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.
Hello Steve,
Thanks :)
Right. The current code only deals with a "method-by-method" basis.
A common set would be nice. However I'm putting my (personal ;-) faith
in code contracts.
I'm not a Resharper user, actually
Hi,
I've got this rule:
Target: System.Boolean Foo.MessageStatus::CanTransiti onTo
(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'.
Hi,
Love Gendarme, great work!
I've found that it's giving me false positives, epecially for the rule
'CheckParametersNullityInVisib leMethodsRule'.
To be fair, Gendarme is correct in what it's reporting as I wrap 'if
(arg==null) throw .... in a wrapper. e.g.
public XmlWrapper(XNode xml)
At some point we'll support the [SuppressMessage] attribute that MS use
to ignore defects with FxCop. About 50% of the code is already there.
In the mean time the solution (which, personally, I much prefer to using
attributes) is to
Hi,
If I would like a rule to execute, but I know that it incorrectly
makes a finding for a given method.
Is there a way for me to decorate the method with some attribute
(example follows)?
[IgnoreGendarmeRule(EnsureLoca lDisposableRule] // foo is Disposed
elsewhere in method Bar ()
void DoStuff ()
The solution is a bit more complex than that and the rule documentation
is updated for 2.6 (but not yet on the wiki). I don't recall the rule
source enough to see why it fails... I'll check that up later (likely
next weekend).
Not
a) Gendarme version ?
b) under Mono (version ?) or MS.NET ?
c) can you give me a compilable sample (to be sure I'm testing the exact
same thing as you are) ?
Right now I suspect an (old) metadata/generic bug on Mono. That makes