API: New publicly visible fields

Code Query API Breaking Changes

Runs only in diff mode (baseline defined). Lists fields new in the public surface of the analyzed assemblies.

CQLinq source

This code query is written in CQLinq, C# LINQ over the NDepend code model. It ships with every new NDepend project: you can read it, adapt it, or use it as a starting point for your own custom rules.

// <Name>API: New publicly visible fields</Name>
from f in Application.Fields
where f.IsPubliclyVisible && 

     // The field has been removed and its parent assembly hasn't been removed …
     ( (f.WasAdded() && !f.ParentType.WasAdded()) ||

     // … or the t existed but was not publicly visible
       !f.WasAdded() && !f.OlderVersion().IsPubliclyVisible)

select new { 
   f,
   OldVisibility = 
      (f.WasAdded() ? " " : 
       f.OlderVersion().Visibility.ToString())
}

//<Desc>
// Runs only in *diff mode* (baseline defined). Lists fields new in the
// public surface of the analyzed assemblies.
//</Desc>

API Breaking Changes: all 9 items