[Mono-bugs] [Bug 665137] New: FxCopCompatibility attribute not placed on DoNotForgetNotImplementedMethodsRule / doesn't match FxCop rule DoNotRaiseExceptionsInUnexpectedLocations

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Jan 18 08:59:47 EST 2011


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

https://bugzilla.novell.com/show_bug.cgi?id=665137#c0


           Summary: FxCopCompatibility attribute not placed on
                    DoNotForgetNotImplementedMethodsRule / doesn't match
                    FxCop rule DoNotRaiseExceptionsInUnexpectedLocations
    Classification: Mono
           Product: Mono: Tools
           Version: 2.10.x
          Platform: 64bit
        OS/Version: Windows 7
            Status: NEW
          Severity: Enhancement
          Priority: P5 - None
         Component: Gendarme
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: ethan_j_brown at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=408829)
 --> (http://bugzilla.novell.com/attachment.cgi?id=408829)
Demonstrates DoNotForgetNotImplementedMethodsRule

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.634.0 Safari/534.16

Take the following sample property implementation:

public DataContext Context
{
   [SuppressMessage("Microsoft.Design",
"CA1065:DoNotRaiseExceptionsInUnexpectedLocations", Justification = "ITable
defines a DataContext member, but we're mocking with IDataContext, so we cant
implement this in any acceptable way, though it's likely not needed anyhow for
a mock")]
   get 
   {                
      throw new NotImplementedException();
   }
}

In this case, I would like DoNotForgetNotImplementedMethodsRule to be ignored. 
However, it's not because the FxCopCompatibility only applies to
DoNotThrowInUnexpectedLocationRule.

I know this is 'by design' because Gendarme has 2 rules for the 1 FxCop rule --
but it's inconvenient to have to add an additional Suppression for
DoNotForgetNotImplementedMethodsRule in this scenario.

Reproducible: Always

Steps to Reproduce:
1.Run Gendarme 2.10.x on code like the above
2.
3.
Actual Results:  
1. DoNotForgetNotImplementedMethodsRule

Problem: This method looks like it is not implemented or is incomplete.
* Severity: High, Confidence: Normal
* Target:   System.Data.Linq.DataContext
EPS.Data.Linq.Mocks.MockTableWithListStorage`1::get_Context()
* Source:  
C:\Source\Common\source\EPS.Data\Linq\Mocks\MockTableWithListStorage.cs(≈226)

Solution: Implement the method and/or make sure it's limitations are well
documented.
More info available at:
https://github.com/spouliot/gendarme/wiki/Gendarme.Rules.BadPractice.DoNotForgetNotImplementedMethodsRule(2.10)


Expected Results:  
No defect because of FxCop suppression.

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


More information about the mono-bugs mailing list