Home Manual Reference Source Test Repository
public class | source

AbstractReport

Provides several helper methods to work with method oriented data stored as this.methodAggregate in ClassReport / ModuleReport and directly in ClassMethodReport / ModuleMethodReport.

Constructor Summary

Public Constructor
public

constructor(aggregateMethodReport: AggregateMethodReport)

If given assigns the method report to an internal variable.

Member Summary

Public Members
public get

Returns the associated AggregateMethodReport or this.

public

Stores any associated AggregateMethodReport.

Method Summary

Public Methods
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.

Public Constructors

public constructor(aggregateMethodReport: AggregateMethodReport) source

If given assigns the method report to an internal variable. This is used by ClassReport and ModuleReport which stores a AggregateMethodReport respectively in this.methodAggregate.

Params:

NameTypeAttributeDescription
aggregateMethodReport AggregateMethodReport

An AggregateMethodReport to associate with this report.

Public Members

public get aggregateMethodReport: AggregateMethodReport: * source

Returns the associated AggregateMethodReport or this. Both ClassReport and ModuleReport have an methodAggregate AggregateMethodReport.

public methodAggregate: AggregateMethodReport source

Stores any associated AggregateMethodReport.

Public Methods

public incrementDistinctHalsteadItems(metric: string, identifier: string) source

Increments the associated aggregate report HalsteadData for distinct identifiers.

Params:

NameTypeAttributeDescription
metric string

A Halstead metric name.

identifier string

A Halstead identifier name.

public incrementHalsteadItems(metric: string, identifier: string) source

Increments the associated aggregate report Halstead items including distinct and total counts.

Params:

NameTypeAttributeDescription
metric string

A Halstead metric name.

identifier string

A Halstead identifier name.

public incrementHalsteadMetric(metric: string, type: string) source

Increments the associated aggregate report Halstead metric type.

Params:

NameTypeAttributeDescription
metric string

A Halstead metric name.

type string

A Halstead metric type.

public incrementParams(count: number) source

Increments the associated aggregate report parameter count.

Params:

NameTypeAttributeDescription
count number

Value to increase params by.

public isHalsteadMetricDistinct(metric: string, identifier: string): boolean source

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

Params:

NameTypeAttributeDescription
metric string

A Halstead metric name.

identifier string

A Halstead identifier name.

Return:

boolean

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

Formats this report given the type.

Params:

NameTypeAttributeDescription
name string

The name of formatter to use.

options object

(Optional) One or more optional parameters to pass to the formatter.

Return:

string