import ClassReport from 'typhonjs-escomplex-commons/src/module/report/ClassReport.js'
ClassReport
Extends:
Provides the class report object which stores data pertaining to a single ES6 class.
Methods that are stored as ClassMethodReport instances in the methods
member variable.
Static Method Summary
Static Public Methods | ||
public static |
getFormats(): Object[] Returns the supported transform formats. |
|
public static |
parse(object: object): ClassReport Deserializes a JSON object representing a ClassReport. |
Constructor Summary
Public Constructor | ||
public |
constructor(name: string, lineStart: number, lineEnd: number) Initializes class report. |
Member Summary
Public Members | ||
public |
Stores any analysis errors. |
|
public |
Stores the end line for the class. |
|
public |
Stores the start line for the class. |
|
public |
Stores the average method metric data. |
|
public |
Stores all method data. |
|
public |
The name of the class. |
|
public get |
type: ReportType: * Returns the enum for the report type. |
Method Summary
Public Methods | ||
public |
clearErrors(clearChildren: boolean) Clears all errors stored in the class report and by default any class methods. |
|
public |
Gets all errors stored in the class report and by default any class methods. |
|
public |
Returns the name / id associated with this report. |
Inherited Summary
From class AbstractReport | ||
public get |
Returns the associated |
|
public |
Stores any associated |
|
public |
incrementDistinctHalsteadItems(metric: string, identifier: string) Increments the associated aggregate report HalsteadData for distinct identifiers. |
|
public |
incrementHalsteadItems(metric: string, identifier: string) Increments the associated aggregate report Halstead items including distinct and total counts. |
|
public |
incrementHalsteadMetric(metric: string, type: string) Increments the associated aggregate report Halstead metric type. |
|
public |
incrementParams(count: number) Increments the associated aggregate report parameter count. |
|
public |
isHalsteadMetricDistinct(metric: string, identifier: string): boolean Returns true if a given HalsteadData metric / identifier is not found in the associated aggregate report. |
|
public |
Formats this report given the type. |
Static Public Methods
public static parse(object: object): ClassReport source
Deserializes a JSON object representing a ClassReport.
Params:
Name | Type | Attribute | Description |
object | object | A JSON object of a ClassReport that was previously serialized. |
Public Constructors
Public Members
Public Methods
public clearErrors(clearChildren: boolean) source
Clears all errors stored in the class report and by default any class methods.
Params:
Name | Type | Attribute | Description |
clearChildren | boolean | (Optional) If false then class method errors are not cleared; default (true). |
public getErrors(options: object): Array<AnalyzeError | {error: AnalyzeError, source: *}> source
Gets all errors stored in the class report and by default any class methods.
Params:
Name | Type | Attribute | Description |
options | object | Optional parameters. |
Return:
Array<AnalyzeError | {error: AnalyzeError, source: *}> |
Return Properties:
Name | Type | Attribute | Description |
includeChildren | boolean | If false then module errors are not included; default (true). |
|
includeReports | boolean | If true then results will be an array of object hashes containing |