[Mono-bugs] [Bug 665161] New: Spurious ConsiderAddingInterfaceRule / No Source Lines

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Jan 18 10:30:36 EST 2011


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

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


           Summary: Spurious ConsiderAddingInterfaceRule / No Source Lines
    Classification: Mono
           Product: Mono: Tools
           Version: 2.10.x
          Platform: 64bit
        OS/Version: Windows 7
            Status: NEW
          Severity: Normal
          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=408848)
 --> (http://bugzilla.novell.com/attachment.cgi?id=408848)
Demonstrates unnecessary ConsiderAddingInterfaceRule

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

There are two issues demonstrated in the attachment (though the line numbering
isn't really a problem since the issues should not be generated in the first
place).

In an interface hiearchy, Gendarme seems to get confused and generates
unnecessary 
ConsiderAddingInterfaceRule defects.


Reproducible: Always

Steps to Reproduce:
1.Run Gendarme 2.10.x against the attached assemblies
2.
3.
Actual Results:  
3. ConsiderAddingInterfaceRule

Problem: This type implements an interface's members, but does not implement
the interface.
* Severity: Medium, Confidence: High
* Target:  
EPS.Web.Authentication.Abstractions.IHttpContextInspectingAuthenticationFailureHandler`1
* Location:
EPS.Web.Authentication.Abstractions.IHttpContextInspectingAuthenticator`1
* Details:  Type implements
'EPS.Web.Authentication.Abstractions.IHttpContextInspectingAuthenticator`1'
interface but does not declare it.

Solution: If the semantics of the type's  members are compatible with the
interface then inherit from the interface. Otherwise ignore the defect.
More info available at:
https://github.com/spouliot/gendarme/wiki/Gendarme.Rules.Design.ConsiderAddingInterfaceRule(2.10)

4. ConsiderAddingInterfaceRule

Problem: This type implements an interface's members, but does not implement
the interface.
* Severity: Medium, Confidence: High
* Target:  
EPS.Web.Authentication.Abstractions.HttpContextInspectingAuthenticationFailureHandlerBase`1
* Location:
EPS.Web.Authentication.Abstractions.IHttpContextInspectingAuthenticator`1
* Details:  Type implements
'EPS.Web.Authentication.Abstractions.IHttpContextInspectingAuthenticator`1'
interface but does not declare it.

Solution: If the semantics of the type's  members are compatible with the
interface then inherit from the interface. Otherwise ignore the defect.
More info available at:
https://github.com/spouliot/gendarme/wiki/Gendarme.Rules.Design.ConsiderAddingInterfaceRule(2.10)


Expected Results:  
Defect 3 doesn't really make any sense.  Here are the relevant interface
definitions:

public interface IHttpContextInspectingAuthenticationFailureHandler<T>
    : IHttpContextInspectingAuthenticationFailureHandler
    where T : HttpContextInspectingAuthenticationFailureConfigurationSection
{
    new IPrincipal OnAuthenticationFailure(HttpContextBase context,
Dictionary<IHttpContextInspectingAuthenticator, InspectorAuthenticationResult>
inspectorResults);        
    new T Configuration { get; }
}

and IHttpContextInspectingAuthenticator<T> looks like this:

public interface IHttpContextInspectingAuthenticator<out T> :
IHttpContextInspectingAuthenticator
    where T : HttpContextInspectingAuthenticatorConfigurationElement
{
    new T Configuration { get; }
}

where its base interface is:

public interface IHttpContextInspectingAuthenticator
{
    string Name { get; }
    InspectorAuthenticationResult Authenticate(HttpContextBase context);        
    HttpContextInspectingAuthenticatorConfigurationElement Configuration { get;
}
}


Gednarme seems to be ignoring the base interface.  Defect 4 is a similar
scenario.

-- 
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