import MethodReport from 'typhonjs-escomplex-commons/src/module/report/MethodReport.js'
MethodReport
Extends:
Direct Subclass:
Provides the method report object which stores data pertaining to a single method / function.
Static Method Summary
Static Protected Methods | ||
protected static |
_parse(targetObject: ClassMethodReport | ModuleMethodReport, jsonObject: object): ClassMethodReport | ModuleMethodReport Deserializes a JSON object representing a ClassMethodReport. |
Constructor Summary
Public Constructor | ||
public |
constructor(name: string, lineStart: number, lineEnd: number, params: number) Initializes method report. |
Member Summary
Public Members | ||
public |
Stores any analysis errors. |
|
public |
Stores the end line for the method. |
|
public |
Stores the start line for the method. |
|
public |
The name of the method. |
|
public |
The number of parameters for the method or report. |
Method Summary
Public Methods | ||
public |
Clears all errors stored in the method report. |
|
public |
Gets all errors stored in the method report. |
|
public |
Returns the name / id associated with this report. |
Inherited Summary
From class AbstractReport | ||
public get |
Returns the associated |
|
public |
Stores any associated |
|
public |
incrementDistinctHalsteadItems(metric: string, identifier: string) 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 |
incrementHalsteadMetric(metric: string, type: string) Increments the associated aggregate report Halstead metric type. |
|
public |
incrementParams(count: number) Increments the associated aggregate report parameter count. |
|
public |
isHalsteadMetricDistinct(metric: string, identifier: string): boolean Returns true if a given HalsteadData metric / identifier is not found in the associated aggregate report. |
|
public |
Formats this report given the type. |
From class AggregateMethodReport | ||
public |
The cyclomatic complexity of the method. |
|
public |
The cyclomatic density of the method. |
|
public |
Stores the Halstead data instance. |
|
public |
The number of parameters for the method or aggregate report. |
|
public |
The source lines of code for the method. |
Static Protected Methods
protected static _parse(targetObject: ClassMethodReport | ModuleMethodReport, jsonObject: object): ClassMethodReport | ModuleMethodReport source
Deserializes a JSON object representing a ClassMethodReport.
Params:
Name | Type | Attribute | Description |
targetObject | ClassMethodReport | ModuleMethodReport | A target object to hydrate. |
|
jsonObject | object | A JSON object of a class or module method report that was previously serialized. |
Public Constructors
Public Members
public params: number source
The number of parameters for the method or report.
Override:
AggregateMethodReport#paramsPublic Methods
public getErrors(options: object): Array<AnalyzeError | {error: AnalyzeError, source: *}> source
Gets all errors stored in the method report.
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 results will be an array of object hashes containing |