On Wed, 2011-01-26 at 12:19 -0800, Andrew Hanson wrote:
> Before I go too far down this road, let me just make sure I'm not
> screwing up something stupid.  I'm using VS2005, could that be an
> issue?  

No. Gendarme should be able to analyze code down to FX 1.0 (VS2002).

However you do need FX3.5 to be installed. If not then Gendarme won't
start (actually it should not even install). Since you're getting
results it means you meet the basic requirements.

Just to be clear: the only time VS2008 (or above) is required is when
you wish to compile Gendarme, from source code, yourself.

> I honestly didn't check the levels of support on it, but just wanted
> to bring that up.
> 
> It's definitely possible for the VB compiler to be getting screwy. 

Well each .NET compiler is a bit different. That's not an issue for most
rules but, in some cases, the generated IL can be quite weird (like CSC
is when compiled without optimization) - but it's still "legal" IL.

xMSC (mono C# compilers family) and CSC are likely the most commonly
used compilers - or at least the one I'm the most familiar with.

Maybe other people on the list can comment on other compilers ?

>  I've actually had it flag a single line before as duplicate code.
> Sounds impossible, but I commented out the line and it didn't flag it,
> then un-commented it and it came back. 

The rule works with "patterns" which generally correspond to a few lines
of code. Of course moving a single line can "break" the pattern and
avoid two methods to match.

>  Logically it made sense to move the line to another point in the
> method and that ended up fixing it.  Doubt I'll be able to recreate
> that little bug, but it might be indicative of something weird with
> the VB compiler.
> 
> I hacked together a small sample that is still generating the issue
> for me.  I have the two versions (one compiled with optimizations and
> one without optimizations)  so I'll get to uploading them in a little
> bit.  This isn't like a deal breaker for me I was just wondering if
> other people saw what I was seeing.  

Thanks - this is much appreciated :-) It will allow me to investigate
the issue. 

Most, except the "weirdest" cases, IL generation difference can often be
accommodated with relatively small fixes to the rule (as long as we know
about it ;-) 

> I actually see a good amount of strange behavior when it comes to
> using this utility with VB.NET, and so far I've just been ignoring it
> and skipping over it.  Perhaps I should post a little more of those
> things over here.

If you have time please do fill bug reports on them :-) If it helps
(saving time) it's possible to make attachments, or even the bug itself,
private to novell's employees.

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.

Reply via email to