NDepend.API Documentation
RebaseSourcePathsInReport Method
NDepend.Project Namespace > IProjectReport Interface : RebaseSourcePathsInReport Method
A sub-string of the source path that defines which portion to replace.
The portion replacement in the new path.
A string to append at the end of the path with the tag $LineNumber$ that is replaced with the line number. Empty string is accepted if the updated path shouldn't be suffixed with the line number.
This method can be called before analyzing with report creation, to update the paths in the report.
Syntax
void RebaseSourcePathsInReport( 
   string fromPath,
   string toPath,
   string lineSuffix
)

Parameters

fromPath
A sub-string of the source path that defines which portion to replace.
toPath
The portion replacement in the new path.
lineSuffix
A string to append at the end of the path with the tag $LineNumber$ that is replaced with the line number. Empty string is accepted if the updated path shouldn't be suffixed with the line number.
Exceptions
ExceptionDescription
Such exception can be thrown if provided arguments are not valid.
Remarks
For example to transform this path:
C:\a\root\ClassLibrary\test.cs Line 76
to
https://github.com/myproject/testcore/blob/main/ClassLibrary/test.cs#L76
this method can be called with these arguments:
"root", "https://github.com/myproject/testcore/blob/main", "#L$LineNumber$"
Notice that the provided information are not stored in the project file.
They are just used on next calls to NDepend.Analysis.ExtensionMethodsProjectAnalysis.RunAnalysisAndBuildReport on this IProject object.
Requirements

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

See Also

Reference

IProjectReport Interface
IProjectReport Members