NDepend.API Documentation
ComputeIssuesDiffAndTrendMetrics Method
NDepend.Analysis Namespace > ExtensionMethodsProjectAnalysis Class : ComputeIssuesDiffAndTrendMetrics Method
The analysis result on which to compute the issues.
Issues are computed for both this NDepend.CodeModel.ICompareContext object NewerCodeBase and OlderCodeBase, and are the compared in the return NDepend.Issue.IIssuesSetDiff object.
The code query execution time-out duration.
A value that indicates if each issue in the returned NDepend.Issue.IIssuesSet object references the corresponding query execution NDepend.CodeQuery.RecordBase object.
The trend metrics values extracted from the project analysisResult.IAnalysisResult.AnalysisResultRef.IAnalysisResultRef.Project.
The just-my-code NDepend.CodeModel.ICodeBaseView object computed for compareContext.NewerCodeBase, against which rules have been executed.
The just-my-code NDepend.CodeModel.ICodeBaseView object computed for compareContext.OlderCodeBase, against which rules have been executed.
A sequence of plain-english log that represents all problems found while compiling and executing rules, and that can explain some unexpected issues state in the returned NDepend.Issue.IIssuesSetDiff object.
This method compiles and runs all rules and trend metrics against both code base snapshots of compareContext (NewerCodeBase and OlderCodeBase) and returns all baseline and newer issues compared in an NDepend.Issue.IIssuesSetDiff object and returns also all trendMetricsValues.
Syntax

Parameters

analysisResult
The analysis result on which to compute the issues.
compareContext
Issues are computed for both this NDepend.CodeModel.ICompareContext object NewerCodeBase and OlderCodeBase, and are the compared in the return NDepend.Issue.IIssuesSetDiff object.
cqlinqQueryExecTimeOut
The code query execution time-out duration.
issueReferenceRecord
A value that indicates if each issue in the returned NDepend.Issue.IIssuesSet object references the corresponding query execution NDepend.CodeQuery.RecordBase object.
trendMetricsValues
The trend metrics values extracted from the project analysisResult.IAnalysisResult.AnalysisResultRef.IAnalysisResultRef.Project.
justMyCodeNew
The just-my-code NDepend.CodeModel.ICodeBaseView object computed for compareContext.NewerCodeBase, against which rules have been executed.
justMyCodeOld
The just-my-code NDepend.CodeModel.ICodeBaseView object computed for compareContext.OlderCodeBase, against which rules have been executed.
logs
A sequence of plain-english log that represents all problems found while compiling and executing rules, and that can explain some unexpected issues state in the returned NDepend.Issue.IIssuesSetDiff object.
Remarks
This method is optimized and takes account of the returned NDepend.Issue.IIssuesSetDiff object to compute trend metrics. Hence this method is almost twice faster than calling first ComputeIssuesDiff(IAnalysisResult,ICompareContext) and then LogTrendMetrics(IAnalysisResult,DateTime).
If you wish to log the obtained trendMetricsValues first call TryComputeLogLabel and then call LogTrendMetrics(IAnalysisResult,DateTime).
The rules are the active rules found in the project analysisResult.IAnalysisResult.AnalysisResultRef.IAnalysisResultRef.Project, the active rules in active rule file(s) referenced by this project, and the active rules found in analysisResult.IAnalysisResult.RulesExtractedFromCode.

The issues debt is computed and formatted against this project NDepend.Project.IProjectDebtSettings.

Before running the rules, this method also computes both just-my-code NDepend.CodeModel.ICodeBaseView from active code queries prefixed with notmycode, found in the same locations than the rules, and returns them through justMyCodeOld and justMyCodeNew.

Returned sequence of logs contains plain-english logs that represent all problems found while compiling and executing rules. This includes rules compilation / execution errors, rules that rely on code coverage not available, rules that relies on diff not available.

Rules are executed twice against compareContext NewerCodeBase and OlderCodeBase, except rule that relies on diff, like the rule API breaking change for example. Such rule is only executed once and its issues are only present in the NewerIssuesSet of the returned NDepend.Issue.IIssuesSetDiff object.

If a rule has compilation or execution error on one code base snapshot but not on the other one, a log is emitted and issues obtained from execution against the other snapshot are not taken account in the returned NDepend.Issue.IIssuesSetDiff object.
Requirements

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

See Also

Reference

ExtensionMethodsProjectAnalysis Class
ExtensionMethodsProjectAnalysis Members