import ProjectReport from 'typhonjs-escomplex-commons/src/project/report/ProjectReport.js'
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 |
getFormats(): Object[] 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 |
|
public |
Stores the settings used to generate the project report. |
|
public get |
type: ReportType: * 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 |
finalize(options: object): ProjectReport Finalizes the ProjectReport. |
|
public |
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 |
Formats this ProjectReport given the type. |
Static Public Methods
public static parse(object: object, options: object): ProjectReport source
Deserializes a JSON object representing a ProjectReport.
Return:
ProjectReport |
Return Properties:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
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 firstOrderDensity: number source
Measures the percentage of all possible internal dependencies that are actually realized in the project. Lower is better.
public modules: Array<ModuleReport> source
Stores all ModuleReport data for the project sorted by the module / files srcPath
.
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:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
options | object | (Optional) Allows overriding of ModuleReport serialization. |
Return:
ProjectReport |
Return Properties:
Name | Type | Attribute | Description |
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:
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 the result will be an array of object hashes containing
|
public getSetting(key: string, defaultValue: *): * source
Returns the setting indexed by the given key.
Params:
Name | Type | Attribute | Description |
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:
* |