Types indirectly using one or several types changed
Runs only in diff mode (baseline defined). Lists unchanged types using directly or indirectly types whose code changed since the baseline: their code didn't change but their behavior might have. The result includes the changed types directly used and the depth of usage, as defined for the DepthOfIsUsingAny() NDepend API method: https://www.ndepend.com/api/NDepend.CodeModel.ExtensionMethodsSequenceUsage.html#NDepend_CodeModel_ExtensionMethodsSequenceUsage_DepthOfIsUsingAny__2_System_Collections_Generic_IEnumerable___0__System_Collections_Generic_IEnumerable___1__
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>Types indirectly using one or several types changed</Name>
let typesChanged = Application.Types.Where(t => t.CodeWasChanged()).ToHashSetEx()
// 'depth' represents a code metric defined on types using
// directly or indirectly any type where code was changed.
let depth = JustMyCode.Types.DepthOfIsUsingAny(typesChanged)
from t in depth.DefinitionDomain where
!t.CodeWasChanged() &&
!t.WasAdded()
let typesChangedDirectlyUsed = t.TypesUsed.Intersect(typesChanged)
let depthOfUsingTypesChanged = depth[t]
orderby depthOfUsingTypesChanged
select new {
t,
depthOfUsingTypesChanged,
typesChangedDirectlyUsed
}
//<Desc>
// Runs only in *diff mode* (baseline defined). Lists *unchanged* types
// **using directly or indirectly** *types* whose code changed since the
// *baseline*: their code didn't change but their behavior might have. The
// result includes the changed types directly used and the **depth of
// usage**, as defined for the *DepthOfIsUsingAny()* NDepend API method:
// https://www.ndepend.com/api/NDepend.CodeModel.ExtensionMethodsSequenceUsage.html#NDepend_CodeModel_ExtensionMethodsSequenceUsage_DepthOfIsUsingAny__2_System_Collections_Generic_IEnumerable___0__System_Collections_Generic_IEnumerable___1__
//</Desc>
Open in the interactive Rules Explorer · All default rules
Code Diff Summary: all 25 items
- New assemblies
- Assemblies removed
- Assemblies where code was changed
- New namespaces
- Namespaces removed
- Namespaces where code was changed
- New types
- Types removed
- Types where code was changed
- Heuristic to find types moved from one namespace or assembly to another
- Types directly using one or several types changed
- Types indirectly using one or several types changed
- New methods
- Methods removed
- Methods where code was changed
- Methods directly calling one or several methods changed
- Methods indirectly calling one or several methods changed
- New fields
- Fields removed
- Third party types that were not used and that are now used
- Third party types that were used and that are not used anymore
- Third party methods that were not used and that are now used
- Third party methods that were used and that are not used anymore
- Third party fields that were not used and that are now used
- Third party fields that were used and that are not used anymore