import FormatJSONCheckstyle from 'typhonjs-escomplex-commons/src/transform/formats/json/FormatJSONCheckstyle.js'
FormatJSONCheckstyle
Provides a format transform for ESComplex ModuleReport / ProjectReport instances converting them to JSON that corresponds to the XML checkstyle format.
The checkstyle XML format outputs error elements for each file / module. This format depends on the output of
FormatJSONCheckstyle
. The implementation below outputs a file
array that contains an error
array entries.
There is a corresponding FormatXMLCheckstyle
format loaded when escomplex-plugin-formats-xml
during plugin
loading which converts the JSON output of this format transform to the official XML checkstyle format.
Constructor Summary
Public Constructor | ||
public |
constructor(thresholds: *) |
Member Summary
Public Members | ||
public get |
Gets the file extension. |
|
public get |
Gets the format name. |
|
public get |
Gets the format type. |
Private Members | ||
private |
_thresholds: * |
Method Summary
Public Methods | ||
public |
formatReport(report: ModuleReport | ProjectReport, options: object): string Formats a module report as JSON / checkstyle. |
|
public |
isSupported(reportType: ReportType): boolean Returns whether a given ReportType is supported by this format transform. |
Private Methods | ||
private |
_formatModule(report: ModuleReport, reportsAvailable: boolean, options: object): object Formats a module report. |
|
private |
_parseErrors(sourceObject: *, options: *, errors: *) |
Public Constructors
public constructor(thresholds: *) source
Params:
Name | Type | Attribute | Description |
thresholds | * |
|
Public Methods
public formatReport(report: ModuleReport | ProjectReport, options: object): string source
Formats a module report as JSON / checkstyle.
Params:
Name | Type | Attribute | Description |
report | ModuleReport | ProjectReport | A module or project report to format. |
|
options | object | (Optional) One or more optional parameters passed to the formatter. |
public isSupported(reportType: ReportType): boolean source
Returns whether a given ReportType is supported by this format transform.
Params:
Name | Type | Attribute | Description |
reportType | ReportType | A given report type. |
Private Methods
private _formatModule(report: ModuleReport, reportsAvailable: boolean, options: object): object source
Formats a module report.
Params:
Name | Type | Attribute | Description |
report | ModuleReport | A module report. |
|
reportsAvailable | boolean | Indicates that the report metric data is available. |
|
options | object | (Optional) One or more optional entries defining threshold parameters. |
private _parseErrors(sourceObject: *, options: *, errors: *) source
Params:
Name | Type | Attribute | Description |
sourceObject | * | ||
options | * | ||
errors | * |