Table of Contents

Interface IQuery

Namespace
NDepend.CodeQuery
Assembly
NDepend.API.dll

Represents a code query. A IQuery object can be created with the method IController.CreateQuery(bool, string, bool, bool, bool, bool).

public interface IQuery : IControllerChild
Inherited Members
Extension Methods

Properties (10)

DisplayListInReport

Gets a value that indicates whether if the code rule is violated, the code rule matched code elements are listed into the report.

bool DisplayListInReport { get; }

Property Value

bool

Remarks

The default value is true.

DisplaySelectionViewInReport

Gets a value that indicates whether if the code rule is violated, the code rule matched code elements are shown in a treemap picture embedded into the report.

bool DisplaySelectionViewInReport { get; }

Property Value

bool

Remarks

The default value is false.

DisplayStatInReport

Gets a value that indicates whether if the code rule is violated, the code rule matched code elements statistics are shown into the report.

bool DisplayStatInReport { get; }

Property Value

bool

Remarks

The default value is true.

IsActive

Gets a value that indicates whether the query is active.

bool IsActive { get; }

Property Value

bool

Remarks

The default value is true.

IsCriticalRule

Gets a value that indicates whether the code rule is critical or not.

bool IsCriticalRule { get; }

Property Value

bool

Remarks

The default value is false.
A critical code rule is useful to break the build process once the rule is violated.
More information at: Critical Rules and Build Failure

IsExtractedFromCode

Gets a value that indicates whether the query has been extracted from code.

bool IsExtractedFromCode { get; }

Property Value

bool

Remarks

A code query can be extracted from code thanks to CodeRuleAttribute.

See Also

IsImportedRule

Gets a value that indicates whether the query is an imported rule.

bool IsImportedRule { get; }

Property Value

bool

Parent

Gets the parent group. Returns null if the query has no parent group.

IGroup Parent { get; }

Property Value

IGroup

QueryString

Gets the CQLinq or CQL code rule string or query string.

string QueryString { get; }

Property Value

string

RootParent

Gets the root parent. Returns null if the query has no root parent.

IGroupOfGroups RootParent { get; }

Property Value

IGroupOfGroups

Methods (3)

Clone(IController)

Returns a new query where values for QueryString, IsActive, DisplayListInReport, DisplaySelectionViewInReport, DisplayStatInReport, IsCriticalRule have been cloned, through controller.

IQuery Clone(IController controller)

Parameters

controller IController

The queries controller used for cloning.

Returns

IQuery

Remarks

The state IsExtractedFromCode or IsImportedRule is not cloned.

EqualsTo(IQuery)

Returns true if this query and queryToCompareWith have same value for QueryString, IsActive, DisplayListInReport, DisplaySelectionViewInReport, DisplayStatInReport, IsCriticalRule.

bool EqualsTo(IQuery queryToCompareWith)

Parameters

queryToCompareWith IQuery

The query to compare with.

Returns

bool

Remarks

IsExtractedFromCode and IsImportedRule is not taken account for this equality operation.

SetIsActive(bool)

Returns a new IQuery object cloned from this object, where IsActive value is set to isActive, if this value for IsActive is different than isActive. Otherwise returns this IQuery.

IQuery SetIsActive(bool isActive)

Parameters

isActive bool

The new value for IsActive.

Returns

IQuery

The new query object representing this query.

Remarks

The default value is true.
Since the queries hierarchy is an immutable hierarchical structure, this methods changes the hierarchy of objects if this value for IsActive is different than isActive.