[Mono-bugs] [Bug 689490] IgnoreList is not being appropriately handled when a rule is run against a type, when the rule enumerates the types members (for instance, AvoidSpeculativeGenerality)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Apr 26 10:52:25 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=689490

https://bugzilla.novell.com/show_bug.cgi?id=689490#c3


--- Comment #3 from Ethan Brown <ethan_j_brown at hotmail.com> 2011-04-26 14:52:24 UTC ---
I entirely understand your rationale.  However, this rule does use individual
methods as a basis for making its determination as you know -- 

i.e. MostlyMethodsDelegatesCall 

https://github.com/mono/mono-tools/blob/master/gendarme/rules/Gendarme.Rules.Smells/AvoidSpeculativeGeneralityRule.cs


Imagine a class with a whole bunch of methods, something like this pseudo-code:

class MyClass
{

[SuppressMessage()]
public void IntentionallySpeculative() {}

public void Foo() {}

public void UnintentionallySpeculative() {}

}

So let's say the original author is OK with method IntentionallySpeculative...
that's by design.  Assume UnintentionallySpeculative is something accidental. 
Maybe it's a code change made by a different author.


If the original author applied the [SuppressMessage] on the class, any
additional speculative methods would be hidden in future code changes --
they're masked.  

So I feel like applying at a class level for my scenario is the inappropriate
level of abstraction.


Perhaps there are 2 rules here.  If AvoidSpeculativeGenerality could be split
into a method level rule to handle my scenario vs a type level rule to handle
the 'abstract class without responsiblity' type issues, that would solve the
problem.

Does that make sense?

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list