PMDReporter
Extends:
Constructor Summary
Public Constructor | ||
public |
constructor(inspector: Inspector, opts: object) A PMD CPD XML reporter, which tries to fit jsinspect's output to something CI tools might expect from PMD. |
Method Summary
Private Methods | ||
private |
Returns an escaped string for use within XML. |
|
private |
Returns an XML string containing the path to the file in which the instance is located, as well as its starting line. |
|
private |
_getOutput(match: Match): string Returns an XML string containing a <duplication> element, with <file> children indicating the instance locations, and <codefragment> to hold the lines. |
|
private |
_getTotalLines(match: Match): int Returns the total number of lines spanned by a match. |
Inherited Summary
From class BaseReporter | ||
private |
_getAbsolutePath(filePath: string): string Returns the absolute path for a file. |
|
private |
_getFormattedLocation(instance: Object): string Returns a string containing the path to the file in which the nodes are located, as well as the lines on which the nodes exist. |
|
private |
Returns the lines associated with an instance. |
|
private |
_getRelativePath(filePath: string): string Returns the relative path for a file. |
|
private |
Registers a listener to the "match" event exposed by the Inspector instance. |
|
private |
Registers a listener that prints a final summary outlining the number of matches detected, as well as the number of files analyzed. |
Public Constructors
public constructor(inspector: Inspector, opts: object) source
A PMD CPD XML reporter, which tries to fit jsinspect's output to something CI tools might expect from PMD.
Override:
BaseReporter#constructorPrivate Methods
private _escape(string: string): string source
Returns an escaped string for use within XML.
Params:
Name | Type | Attribute | Description |
string | string | The string to escape |
private _getFile(instance: object): string source
Returns an XML string containing the path to the file in which the instance is located, as well as its starting line. Absolute paths are required for Jenkins.
Params:
Name | Type | Attribute | Description |
instance | object |