Table of Contents

Interface ISourceFile

Namespace
NDepend.CodeModel
Assembly
NDepend.API.dll

Represents a source file of the analyzed application.

public interface ISourceFile
Extension Methods

Properties (18)

CodeElements

Get a sequence of code elements contained in this source file.

IEnumerable<ICodeElement> CodeElements { get; }

Property Value

IEnumerable<ICodeElement>

CoverageDataAvailable

Gets a boolean value that indicates if coverage data is available for at least one type declared this source file.

bool CoverageDataAvailable { get; }

Property Value

bool
See Also

DirectoryPath

Gets a string that contains this absolute source file's parent directory path, like "C:\Dir" for the source file "C:\Dir\FileName.cs".

string DirectoryPath { get; }

Property Value

string

FileName

Gets a string that contains this source file name, like "FileName.cs" for the source file "C:\Dir\FileName.cs".

string FileName { get; }

Property Value

string

FileNameExtension

Gets a string that contains this source file name extension, like ".cs" for the source file "C:\Dir\FileName.cs".

string FileNameExtension { get; }

Property Value

string

FileNameWithoutExtension

Gets a string that contains this source file name without extension, like "FileName" for the source file "C:\Dir\FileName.cs".

string FileNameWithoutExtension { get; }

Property Value

string

FilePath

Gets this absolute source file path object.

IAbsoluteFilePath FilePath { get; }

Property Value

IAbsoluteFilePath

Remarks

This property cannot be used in CQLinq context because IAbsoluteFilePath is not supported by CQLinq.

FilePathString

Gets a string that contains this absolute source file path, like "C:\Dir\FileName.cs".

string FilePathString { get; }

Property Value

string

Id

Get the id of the source file.

uint Id { get; }

Property Value

uint

Language

Gets this source file language, inferred from the source file extension.

SourceFileLanguage Language { get; }

Property Value

SourceFileLanguage

NbCharacters

Get the number of characters in this source file.

uint NbCharacters { get; }

Property Value

uint

Remarks

Notice that this is not the size in bytes of the source file. If the source file has an encoding like UTF8, each ASCII character is coded on a byte and other characters can be coded on several bytes.

NbILInstructions

Gets a numeric nullable value counting the number of IL instructions of type(s) declared in this source file.

uint? NbILInstructions { get; }

Property Value

uint?

Remarks

If this source file contains a partial type declaration, only methods declared in this source file are taken account.

See Also

NbLines

Get the number of physical lines in this source file.

uint NbLines { get; }

Property Value

uint

NbLinesOfCode

Gets a numeric nullable value counting the number of logical lines of code of type(s) declared in this source file.

uint? NbLinesOfCode { get; }

Property Value

uint?

Remarks

If this source file contains a partial type declaration, only methods declared in this source file are taken account.

See Also

NbLinesOfCodeCovered

Gets a numeric nullable value in the range [0,this.NbLinesOfCode] counting the number of lines of code of types declared this source file, covered by tests.

uint? NbLinesOfCodeCovered { get; }

Property Value

uint?

Remarks

If this source file contains a partial type declaration, only methods declared in this source file are taken account.

See Also

NbLinesOfCodeNotCovered

Gets a numeric nullable value in the range [0,this.NbLinesOfCode] counting the number of lines of code of types declared this source file, not covered by tests.

uint? NbLinesOfCodeNotCovered { get; }

Property Value

uint?

Remarks

If this source file contains a partial type declaration, only methods declared in this source file are taken account.

See Also

NbLinesOfComment

Get the number of lines containing comment in this source file.

uint NbLinesOfComment { get; }

Property Value

uint

PercentageCoverage

Gets a numeric float nullable value in the range [0f,100f] assessing the coverage percentage of types declared this source file.

float? PercentageCoverage { get; }

Property Value

float?

Remarks

If this source file contains a partial type declaration, only methods declared in this source file are taken account. The percentage is NbLinesOfCodeCovered over NbLinesOfCodeCovered + NbLinesOfCodeNotCovered: the lines of the methods that carry coverage data, as for PercentageCoverage.

See Also