Interface IQueryExecutionSuccessResult
Represents a code query successful execution result. Such an object is obtained from a IQueryExecutionResult with Status equals to true.
public interface IQueryExecutionSuccessResult
- Extension Methods
Properties (17)
CodeBaseOnWhichQueryHasBeenExecuted
Gets the code base on which the code query has been executed.
ICodeBase CodeBaseOnWhichQueryHasBeenExecuted { get; }
Property Value
Remarks
If the query has been executed in a comparison context, the returned code base is CompareContextOnWhichQueryHasBeenExecuted.NewerCodeBase.
ColumnsNames
Returns columns' names of the result records.
IReadOnlyList<string> ColumnsNames { get; }
Property Value
Remarks
If IsSingleScalarResult is true, the returned array contains one string "Value".
- See Also
CompareContextOnWhichQueryHasBeenExecuted
Gets the ICompareContext object on which the code query has been executed, or null if the query hasen't been executed agains a compare context but only agains a code base.
ICompareContext CompareContextOnWhichQueryHasBeenExecuted { get; }
Property Value
Remarks
Returns the same object than IQueryCompiledSuccess.CompareContextOnWhichToExecute, or null if this property returns null.
Description
Returns a brief description of the result, such as "12 methods matched" or "Single scalar result : 2 match".
string Description { get; }
Property Value
IsARuleViolated
Gets a value indicating whether the code query is a rule and is violated.
bool IsARuleViolated { get; }
Property Value
Remarks
this.KindOfCodeQueryExpression returns KindOfCodeQueryExpression.Rule if this code query is a code rule. Notice that a IQueryExecutionSuccessResult object can be modified when calling a ExtensionMethodsQuery.GetIssues(IRule, IQueryExecutionSuccessResult) overload that takes a suppressedMessage set. In such condition if all issues are suppressed this property can return false although it was returning true before calling GetIssues().
IsSingleScalarResult
Gets a value indicating whether the code query returned a single scalar result.
bool IsSingleScalarResult { get; }
Property Value
Remarks
Only CQLinq queries can return a scalar result through aggregation operators like Count() or Sum().
In such case Records is an empty collection.
KindOfCodeQueryExpression
Gets the kind of code query expression.
KindOfCodeQueryExpression KindOfCodeQueryExpression { get; }
Property Value
KindOfMatch
Gets a RecordCellType that indicates which kind of code element is matched.
RecordCellType KindOfMatch { get; }
Property Value
Remarks
If IsSingleScalarResult is true, the value RecordCellType.NullableDouble is returned. Else the value return is in the range: RecordCellType.AssemblyRecordCellType.NamespaceRecordCellType.TypeRecordCellType.MethodRecordCellType.FieldRecordCellType.PropertyRecordCellType.EventRecordCellType.MemberRecordCellType.CodeElementRecordCellType.CodeElementParentRecordCellType.CodeContainer
MatchedCodeElements
Gets a collection of code elements matched by the code query. If IsSingleScalarResult is true or if the query is matching issues or rules, gets an empty collection.
IReadOnlyList<ICodeElement> MatchedCodeElements { get; }
Property Value
Remarks
This method is a facility to avoid extracting matched code elements from this.Records first column.
This extension method has a O(this.Records.Count) time complexity.
Notice that a IQueryExecutionSuccessResult object can be modified when calling
a ExtensionMethodsQuery.GetIssues(IRule, IQueryExecutionSuccessResult) overload
that takes a suppressedMessage set. In such condition the list of code-elements returned
can be different than the one returned before calling GetIssues().
- See Also
MatchedIssues
Gets a collection of IIssue matched by the code query. If IsSingleScalarResult is true or if the query is matching code elements or rules or quality gates, gets an empty collection.
IReadOnlyList<IIssue> MatchedIssues { get; }
Property Value
Remarks
This method is a facility to avoid extracting matched issues from this.Records first column.
This extension method has a O(this.Records.Count) time complexity.
- See Also
MatchedQualityGates
Gets a collection of IQualityGate matched by the code query. If IsSingleScalarResult is true or if the query is matching code elements or issues or rules, gets an empty collection.
IReadOnlyList<IQualityGate> MatchedQualityGates { get; }
Property Value
Remarks
This method is a facility to avoid extracting matched quality gates from this.Records first column.
This extension method has a O(this.Records.Count) time complexity.
- See Also
MatchedRules
Gets a collection of IRule matched by the code query. If IsSingleScalarResult is true or if the query is matching code elements or issues or quality gates, gets an empty collection.
IReadOnlyList<IRule> MatchedRules { get; }
Property Value
Remarks
This method is a facility to avoid extracting matched rules from this.Records first column.
This extension method has a O(this.Records.Count) time complexity.
- See Also
OriginalQueryString
Gets the original code query string.
string OriginalQueryString { get; }
Property Value
QualityGateStatus
If this code query is a Quality Gate gets the status, else returns QualityGateStatus.Pass.
QualityGateStatus QualityGateStatus { get; }
Property Value
Remarks
this.KindOfCodeQueryExpression returns KindOfCodeQueryExpression.QualityGate if this code query is a quality gate.
Records
Gets records result.
IReadOnlyList<RecordBase> Records { get; }
Property Value
Remarks
If IsSingleScalarResult is true, the collection returned is empty.
Notice that a IQueryExecutionSuccessResult object can be modified when calling
a ExtensionMethodsQuery.GetIssues(IRule, IQueryExecutionSuccessResult) overload
that takes a suppressedMessage set. In such condition the list of records returned
can be different than the one returned before calling GetIssues().
- See Also
SingleScalarValue
Gets the single scalar result returned by the query.
double? SingleScalarValue { get; }
Property Value
Remarks
Only CQLinq queries can return a scalar result through aggregation operators like Count() or Sum().
If IsSingleScalarResult is false, this property returns null.
If IsSingleScalarResult is true, this property might returns null if the CQLinq aggregation operation returned null.
- See Also
TargetCodeElements
Gets code elements referenced in the query itself, like the code element named "XYZ" in "from t in Types where t.IsUsing("XYZ") select t".
IReadOnlyList<ICodeElement> TargetCodeElements { get; }
Property Value
Remarks
If a wildcard match expression is used, like "X*YZ" instead of "XYZ", the returned collection contains all matched code elements.
Targets code elements can be matched by following extension methods declared in NDepend.Reserved.CQLinq.ExtensionMethodsCQLinqDependency:
IsUsedBy(IUsed, string), IsUsedByAssembly(IUsed, string), IsUsedByNamespace(IUsed, string), IsUsedByType(IUsed, string), IsUsedByMethod(IUsed, string), DepthOfIsUsedBy(IUsed, string), IsIndirectlyUsedBy(IUsed, string),
IsUsing(IUser, string), IsUsingAssembly(IUser, string), IsUsingNamespace(IUser, string), IsUsingType(IUser, string), IsUsingMethod(IUser, string), IsUsingField(IUser, string), DepthOfIsUsing(IUser, string), IsIndirectlyUsing(IUser, string),
ReturnTypeIs(IMethod, string), FieldTypeIs(IField, string), AssignField(IMethod, string), DepthOfAssignField(IMethod, string), CreateA(IMethod, string), DepthOfCreateA(IMethod, string), HasAttribute(IAttributeTarget, string),
DeriveFrom(IType, string), DepthOfDeriveFrom(IType, string), Implement(IType, string)