ModuleReport
Hierarchy
- default
- ModuleReport
Index
Constructors
constructor
Initializes the report.
Parameters
lineStart: number = 0
Start line of file / module.
lineEnd: number = 0
End line of file / module.
optionalsettings: any
An object hash of the settings used in generating this report via ESComplexModule.
Returns default
Properties
optionalaggregate
Stores any associated AggregateReport
.
aggregateAverage
Stores the average module / class aggregate & method metric data.
classes
Stores all ClassReport data for the module.
dependencies
Stores all parsed dependencies.
errors
Stores any analysis errors.
filePath
Stores the file path of the module / file. The file path is only defined as supplied when processing projects.
lineEnd
Stores the end line for the module / file.
lineStart
Stores the start line for the module / file.
maintainability
Measures the average maintainability index for the module / file.
methodAverage
Stores just the average method metric data.
methods
Stores all module ModuleMethodReport data found outside of any ES6 classes.
settings
Stores the settings used to generate the module report.
srcPath
Stores the active source path of the module / file. This path is respective of how the file is referenced in
the source code itself. srcPath
is only defined as supplied when processing projects.
srcPathAlias
Stores the active source path alias of the module / file. This path is respective of how the file is
referenced in the source code itself when aliased including NPM and JSPM modules which provide a main
entry.
srcPathAlias
is only defined as supplied when processing projects.
Accessors
aggregateReport
Returns the associated
AggregateReport
orthis
. Both ClassReport and ModuleReport have anaggregate
AggregateReport.Returns default
type
Returns the enum for the report type.
Returns default
Methods
clearErrors
Clears all errors stored in the module report and by default any class reports and module methods.
Parameters
clearChildren: boolean = true
(Optional) If false then class and module method errors are not cleared; default (true).
Returns void
finalize
Cleans up any house keeping member variables.
Returns default
getErrors
Gets all errors stored in the module report and by default any module methods and class reports.
Parameters
options: { includeChildren: boolean; includeReports: boolean; query?: any } = ...
Optional parameters.
Returns (default | { error: default; source: string })[]
getName
Returns the name / id associated with this report.
Returns string
getSetting
Returns the setting indexed by the given key.
Parameters
key: string
A key used to store the setting parameter.
defaultValue: any = undefined
A default value to return if no setting for the given key is currently stored.
Returns any
setSetting
Sets the setting indexed by the given key and returns true if successful.
Parameters
key: string
A key used to store the setting parameter.
value: any
A value to set to
this.settings[key]
.
Returns boolean
toFormat
Formats this report given the type.
Parameters
name: string
The name of formatter to use.
options: any = ...
(Optional) One or more optional parameters to pass to the formatter.
Returns string
staticgetFormats
Returns the supported transform formats.
Returns string[]
staticparse
Deserializes a JSON object representing a ModuleReport.
Parameters
object: any
A JSON object of a ModuleReport that was previously serialized.
Returns default
Provides the module report object which stores data pertaining to a single file / module being processed.
All ES Module classes are stored in the
classes
member variable as ClassReports. Methods that are not part of a class are stored as ModuleMethodReport instances in themethods
member variable.Various helper methods found in ModuleReport and AbstractReport help increment associated data during collection.