Home Manual Reference Source Test Repository
public class | source

ESComplexProject

Provides a runtime to invoke ESComplexProject plugins for processing / metrics calculations of projects.

Constructor Summary

Public Constructor
public

constructor(pathModule: object, options: object)

Initializes ESComplexProject.

Member Summary

Private Members
private

_escomplexModule: ESComplexModule

Stores the ESComplexModule instance used for generating module reports.

private

Stores a module which matches the NodeJS path module API.

private

Provides dispatch methods to all module plugins.

Method Summary

Public Methods
public

analyze(modules: Array<object>, options: object): ProjectReport

Processes the given modules and calculates project metrics via plugins.

public

analyzeAsync(modules: Array<object>, options: object): Promise<ProjectReport>

Wraps in a Promise processing the given modules and calculates metrics via plugins.

public

process(projectReport: ProjectReport, options: object): ProjectReport

Processes an existing ProjectReport instance and calculates metrics via plugins.

public

processAsync(projectReport: ProjectReport, options: object): Promise<ProjectReport>

Wraps in a Promise processing of existing ProjectReport instance and calculates metrics via plugins.

Public Constructors

public constructor(pathModule: object, options: object) source

Initializes ESComplexProject.

Params:

NameTypeAttributeDescription
pathModule object

Provides an object which matches the Node path module. In particular the following entries must be provided:

(string)    sep - Provides the platform-specific path segment separator: / on POSIX & \ on Windows.

(function)  dirname - Returns the directory name of a path, similar to the Unix dirname command.

(function)  extname - Returns the extension of the path, from the last occurance of the . (period) character to
                      end of string in the last portion of the path.

(function)  relative - Returns the relative path from from to to.

(function)  resolve - Resolves a sequence of paths or path segments into an absolute path.

options object

module and project options including user plugins to load including:

(object)             module - Provides an object hash of the following options for the module runtime:
   (boolean)         loadDefaultPlugins - When false ESComplexModule will not load any default plugins.
   (Array<Object>)   plugins - A list of ESComplexModule plugins that have already been instantiated.

(object)             project - Provides an object hash of the following options for the project runtime:
   (boolean)         loadDefaultPlugins - When false ESComplexProject will not load any default plugins.
   (Array<Object>)   plugins - A list of ESComplexProject plugins that have already been instantiated.

See:

Private Members

private _escomplexModule: ESComplexModule source

Stores the ESComplexModule instance used for generating module reports.

private _pathModule: Object source

Stores a module which matches the NodeJS path module API.

private _plugins: Plugins source

Provides dispatch methods to all module plugins.

Public Methods

public analyze(modules: Array<object>, options: object): ProjectReport source

Processes the given modules and calculates project metrics via plugins.

Params:

NameTypeAttributeDescription
modules Array<object>

Array of object hashes containing ast and srcPath entries. Optionally srcPathAlias and filePath entries may also be provided.

options object

(Optional) project processing options.

Return:

ProjectReport

public analyzeAsync(modules: Array<object>, options: object): Promise<ProjectReport> source

Wraps in a Promise processing the given modules and calculates metrics via plugins.

Params:

NameTypeAttributeDescription
modules Array<object>

Array of object hashes containing ast and srcPath entries. Optionally srcPathAlias and filePath entries may also be provided.

options object

project processing options

Return:

Promise<ProjectReport>

public process(projectReport: ProjectReport, options: object): ProjectReport source

Processes an existing ProjectReport instance and calculates metrics via plugins.

Params:

NameTypeAttributeDescription
projectReport ProjectReport

An instance of ProjectReport with a modules entry that is an Array of ModuleReports.

options object

(Optional) project processing options.

Return:

ProjectReport

public processAsync(projectReport: ProjectReport, options: object): Promise<ProjectReport> source

Wraps in a Promise processing of existing ProjectReport instance and calculates metrics via plugins.

Params:

NameTypeAttributeDescription
projectReport ProjectReport

An instance of ProjectReport.

options object

(Optional) project processing options.

Return:

Promise<ProjectReport>