Home Manual Reference Source Test Repository
public class | source

ClassReport

Extends:

AbstractReport → ClassReport

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

Returns the supported transform formats.

public static

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

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

getErrors(options: object): Array<AnalyzeError | {error: AnalyzeError, source: *}>

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 AggregateMethodReport or this.

public

Stores any associated AggregateMethodReport.

public

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

Increments the associated aggregate report Halstead metric type.

public

Increments the associated aggregate report parameter count.

public

Returns true if a given HalsteadData metric / identifier is not found in the associated aggregate report.

public

toFormat(name: string, options: object): string

Formats this report given the type.

Static Public Methods

public static getFormats(): Object[] source

Returns the supported transform formats.

Return:

Object[]

public static parse(object: object): ClassReport source

Deserializes a JSON object representing a ClassReport.

Params:

NameTypeAttributeDescription
object object

A JSON object of a ClassReport that was previously serialized.

Return:

ClassReport

Public Constructors

public constructor(name: string, lineStart: number, lineEnd: number) source

Initializes class report.

Override:

AbstractReport#constructor

Params:

NameTypeAttributeDescription
name string

Name of the class.

lineStart number

Start line of class.

lineEnd number

End line of class.

Public Members

public errors: Array source

Stores any analysis errors.

public lineEnd: number source

Stores the end line for the class.

public lineStart: number source

Stores the start line for the class.

public methodAverage: HalsteadAverage source

Stores the average method metric data.

public methods: Array<ClassMethodReport> source

Stores all method data.

public name: string source

The name of the class.

public get type: ReportType: * source

Returns the enum for the report type.

Return:

ReportType

Public Methods

public clearErrors(clearChildren: boolean) source

Clears all errors stored in the class report and by default any class methods.

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
options object

Optional parameters.

Return:

Array<AnalyzeError | {error: AnalyzeError, source: *}>

Return Properties:

NameTypeAttributeDescription
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 source (the source report object of the error) and error (an AnalyzeError instance) keys; default (false).

public getName(): string source

Returns the name / id associated with this report.

Return:

string