Home Manual Reference Source Test Repository
public class | source

ProjectReport

Provides the default project report object which stores data pertaining to all modules / files contained.

All modules are stored in the modules member variable as ModuleReports.

Various helper methods found in ModuleReport and AbstractReport help increment associated data during collection.

Static Method Summary

Static Public Methods
public static

Returns the supported transform formats.

public static

parse(object: object, options: object): ProjectReport

Deserializes a JSON object representing a ProjectReport.

Constructor Summary

Public Constructor
public

constructor(moduleReports: Array<ModuleReport>, settings: object)

Initializes ProjectReport with default values.

Member Summary

Public Members
public

Stores a compacted form of the adjacency matrix.

public

Measures the average percentage of modules affected when one module / file in the project is changed.

public

Measures the percentage of modules that are widely depended on which also depend on other modules.

public

Stores any analysis errors.

public

Measures the percentage of all possible internal dependencies that are actually realized in the project.

public

Stores the average module metric data.

public

Stores all ModuleReport data for the project sorted by the module / files srcPath.

public

Stores the settings used to generate the project report.

public get

Returns the enum for the report type.

public

Stores a compacted form of the visibility matrix.

Method Summary

Public Methods
public

clearErrors(clearChildren: boolean)

Clears all errors stored in the project report and by default any module reports.

public

Finalizes the ProjectReport.

public

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

Gets all errors stored in the project report and by default any module reports.

public

Returns the name / id associated with this report.

public

getSetting(key: string, defaultValue: *): *

Returns the setting indexed by the given key.

public

setSetting(key: string, value: *): boolean

Sets the setting indexed by the given key and returns true if successful.

public

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

Formats this ProjectReport given the type.

Static Public Methods

public static getFormats(): Object[] source

Returns the supported transform formats.

Return:

Object[]

public static parse(object: object, options: object): ProjectReport source

Deserializes a JSON object representing a ProjectReport.

Params:

NameTypeAttributeDescription
object object

A JSON object of a ProjectReport that was previously serialized.

options object

Optional parameters.

Return:

ProjectReport

Return Properties:

NameTypeAttributeDescription
skipFinalize boolean

If true then automatic finalization is skipped where applicable.

Public Constructors

public constructor(moduleReports: Array<ModuleReport>, settings: object) source

Initializes ProjectReport with default values.

Params:

NameTypeAttributeDescription
moduleReports Array<ModuleReport>

An array of ModuleReports for each module / file processed.

settings object

An object hash of the settings used in generating this report via ESComplexProject.

Public Members

public adjacencyList: Array<Array<number>> source

Stores a compacted form of the adjacency matrix. Each row index corresponds to the same report index. Each row entry corresponds to a report index. These relationships dictate the dependencies between all report ModuleReports given the source paths.

public changeCost: number source

Measures the average percentage of modules affected when one module / file in the project is changed. Lower is better.

public coreSize: number source

Measures the percentage of modules that are widely depended on which also depend on other modules. Lower is better.

public errors: Array source

Stores any analysis errors.

public firstOrderDensity: number source

Measures the percentage of all possible internal dependencies that are actually realized in the project. Lower is better.

public moduleAverage: ModuleAverage source

Stores the average module metric data.

public modules: Array<ModuleReport> source

Stores all ModuleReport data for the project sorted by the module / files srcPath.

public settings: object source

Stores the settings used to generate the project report.

public get type: ReportType: * source

Returns the enum for the report type.

Return:

ReportType

public visibilityList: Array<Array<number>> source

Stores a compacted form of the visibility matrix. Each row index corresponds to the same report index. Each row entry corresponds to a report index. These relationships dictate the reverse visibility between all report ModuleReports which may indirectly impact the given module / file.

Public Methods

public clearErrors(clearChildren: boolean) source

Clears all errors stored in the project report and by default any module reports.

Params:

NameTypeAttributeDescription
clearChildren boolean

(Optional) If false then class and module method errors are not cleared; default (true).

public finalize(options: object): ProjectReport source

Finalizes the ProjectReport. If settings.serializeModules is false output just filePath, srcPath & srcPathAlias entries of modules.

Params:

NameTypeAttributeDescription
options object

(Optional) Allows overriding of ModuleReport serialization.

Return:

ProjectReport

Return Properties:

NameTypeAttributeDescription
serializeModules boolean

Allows overriding of ModuleReport serialization; default: true.

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

Gets all errors stored in the project report and by default any module reports.

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 the result will be an array of object hashes containing source (the source report object of the error) and error (an AnalyzeError instance) keys and related module, class entries as; default (false).

public getName(): string source

Returns the name / id associated with this report.

Return:

string

public getSetting(key: string, defaultValue: *): * source

Returns the setting indexed by the given key.

Params:

NameTypeAttributeDescription
key string

A key used to store the setting parameter.

defaultValue *

A default value to return if no setting for the given key is currently stored.

Return:

*

public setSetting(key: string, value: *): boolean source

Sets the setting indexed by the given key and returns true if successful.

Params:

NameTypeAttributeDescription
key string

A key used to store the setting parameter.

value *

A value to set to this.settings[key].

Return:

boolean

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

Formats this ProjectReport 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