Code-Copter SDK
Summary
Classes to help in the development of plugins for code-copter.
Reference
Classes
- Analysis
What analyzers found for a source data target.
- Analyzer
Provides analysis of source data.
- FileSourceData
Data, from a file source, to be passed through an analyzer for analysis.
- FileSourceDataSampleIterator
Iterator which produces data samples from a file source.
- Report
A report of analyses.
- Reporter
Disseminates a Report.
Typedefs
- AnalysisError :
Object
An error encountered during analysis.
- DefaultAnalyzerConfigure :
function
Default configure implementation for a new Analyzer which allows disabling the analyzer by passing a boolean false as its entire configuration.
- FileSourceDataSampleIteration :
Object
An iteration of file source data.
Analysis
What analyzers found for a source data target.
Kind: global class
Properties
Name | Type | Description |
---|---|---|
errors | Array.<AnalysisError> |
The errors found. |
target | String |
The source that was analyzed. |
new Analysis(parameters)
Create an analysis.
Param | Type | Description |
---|---|---|
parameters | Object |
Named parameter values to use in construction. |
parameters.target | String |
The target of this analysis (e.g. the file analyzed). |
Boolean
analysis.pass ⇒ Gets whether the target passed the analysis (i.e. there are no errors).
Kind: instance property of Analysis
Returns: Boolean
- - Whether the target passed analysis.
analysis.addError(error)
Adds an error to the analysis.
Kind: instance method of Analysis
Param | Type | Description |
---|---|---|
error | AnalysisError |
An error in the target. |
Analyzer
Provides analysis of source data.
Kind: global class
Properties
Name | Type | Description |
---|---|---|
analyze | function |
Accepts source data and returns an Analysis object. |
configure | function |
Allows configuration of the analyzer. |
name | String |
The name of the analyzer. |
new Analyzer(parameters)
Create an analyzer.
Param | Type | Default | Description |
---|---|---|---|
parameters | Object |
Named parameter values to use in construction. | |
parameters.analyze | function |
A function which returns an Analysis object for given source data. | |
[parameters.configure] | function |
DefaultAnalyzerConfigure |
A function which accepts user-provided configuration to influence the analyzer. |
parameters.name | String |
The name of the analyzer |
FileSourceData
Data, from a file source, to be passed through an analyzer for analysis.
Kind: global class
Properties
Name | Type | Default | Description |
---|---|---|---|
Symbol.iterator | FileSourceDataSampleIterator |
Iterator to traverse samples of text for analysis. | |
lineStart | Number |
1 |
The line on which this source data starts within the containing file. |
text | String |
The text contents of the file to analyze. |
new FileSourceData(parameters)
Create file source data.
Param | Type | Description |
---|---|---|
parameters | Object |
Named parameter values to use in construction. |
parameters.lineStart | Number |
The line on which this source data starts within its file. |
parameters.text | String |
The text contents of the file to analyze. |
FileSourceDataSampleIterator
Iterator which produces data samples from a file source.
FileSourceDataSampleIteration
fileSourceDataSampleIterator.next() ⇒ Returns the next sample from the file source data.
Kind: instance method of FileSourceDataSampleIterator
Returns: FileSourceDataSampleIteration
- - The next sample from the file source data.
Report
A report of analyses.
Kind: global class
Properties
Name | Type | Description |
---|---|---|
analyses | Array.<Analysis> |
The analyses of all processed source data. |
pass | Boolean |
Whether all analyses passed. |
new Report()
Create a Report.
report.addAnalysis(analysis)
Add an analysis to the report.
Kind: instance method of Report
Param | Type | Description |
---|---|---|
analysis | Analysis |
An analysis to add to the report. |
Reporter
Disseminates a Report.
Kind: global class
Properties
Name | Type | Description |
---|---|---|
report | function |
Accepts a Report and disseminates it in an implementation-specific way. |
new Reporter(parameters)
Create a Reporter.
Param | Type | Description |
---|---|---|
parameters | Object |
Named parameter values to use in construction. |
parameters.report | function |
Accepts a Report and disseminates it in an implementation-specific way. |
Object
AnalysisError : An error encountered during analysis.
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
line | Number |
The line number on which the error was found. |
message | String |
A description of the error found. |
function
DefaultAnalyzerConfigure : Default configure implementation for a new Analyzer which allows disabling the analyzer by passing a boolean false as its entire configuration.
Kind: global typedef
Param | Type | Description |
---|---|---|
enabled | Boolean |
False to disable the analyzer; otherwise it is enabled. |
Object
FileSourceDataSampleIteration : An iteration of file source data.
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
done | Boolean |
False if there are more samples; otherwise true. |
value | Object |
File source data sample. |
value.line | Number |
The line of the current sample. |
value.text | String |
The text of the current sample. |