Spurious AvoidMethodWithUnusedGenericTypeRule reported

25 views
Skip to first unread message

skolima

unread,
Nov 19, 2010, 2:25:28 AM11/19/10
to Gendarme
Hi,

I am using Gendarme 2.8.0.0 and I believe it's generating a spurious
rule violation for the rule AvoidMethodWithUnusedGenericTypeRule . The
method signature is :
public static Func<T, TResult> GetField<T, TResult>(ref Func<T,
TResult> cachedInvoker, string fieldName) where T : class
and the reported warning:

Target: System.Func`2<T,TResult>
Cognifide.FastReflection.InternalInvoker::GetField(System.Func`2<T,TResult>&,System.String)
Assembly: Cognifide.FastReflection, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null

Severity: Medium Confidence: High
Source: C:\Projects\Cognifide.Com\Code\Cognifide.FastReflection
\InternalInvoker.cs(≈61)
Details: Generic parameter 'T' is not used by the method parameters.

Severity: Medium Confidence: High
Source: C:\Projects\Cognifide.Com\Code\Cognifide.FastReflection
\InternalInvoker.cs(≈61)
Details: Generic parameter 'TResult' is not used by the method
parameters.

I will file a bug report, but first I'd like someone to confirm that
I'm not mistaken and this is indeed a false positive.

Regards,

Leszek 'skolima' Ciesielski
Reply all
Reply to author
Forward
0 new messages