NDepend.API Documentation
GetRulesInProjectFileAndInRuleFilesAndDeclaredInSourceCode Method
NDepend.Project Namespace > ExtensionMethodsProject Class : GetRulesInProjectFileAndInRuleFilesAndDeclaredInSourceCode Method
The NDepend project.
The rules and queries extracted from source code obtained through NDepend.Analysis.IAnalysisResult.NDepend.Analysis.IAnalysisResult.RulesExtractedFromCode.
Try get rules and queries declared in the project file, in rule files referenced by the project and in source code.
Syntax
[Extension()]
public static IController GetRulesInProjectFileAndInRuleFilesAndDeclaredInSourceCode( 
   IProject project,
   IGroup analysisResultRulesExtractedFromCode
)

Parameters

project
The NDepend project.
analysisResultRulesExtractedFromCode
The rules and queries extracted from source code obtained through NDepend.Analysis.IAnalysisResult.NDepend.Analysis.IAnalysisResult.RulesExtractedFromCode.

Return Value

A controller object that can be used to read and update the hierarchy of rules and queries.
Remarks
If some rules cannot be loaded, like rule in a rule file for example, a NDepend.CodeQuery.IGroup object will be present with a NDepend.CodeQuery.IGroup.Name that will contains Failed to load rule file: RuleFileName. To get more information you can call the method TryLoadRuleFile(IProject,IRuleFileRef,IGroup,String) and read the out parameter failureReason.
Requirements

Target Platforms: Windows 11, 10, 8, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

ExtensionMethodsProject Class
ExtensionMethodsProject Members
RulesExtractedFromCode Property