1.2.3 • Published 9 years ago

code-copter-sdk v1.2.3

Weekly downloads
-
License
ISC
Repository
github
Last release
9 years ago

Code-Copter SDK

Build Status

Summary

Classes to help in the development of plugins for code-copter.

Reference

Classes

Typedefs

Analysis

What analyzers found for a source data target.

Kind: global class
Properties

NameTypeDescription
errorsArray.<AnalysisError>The errors found.
targetStringThe source that was analyzed.

new Analysis(parameters)

Create an analysis.

ParamTypeDescription
parametersObjectNamed parameter values to use in construction.
parameters.targetStringThe target of this analysis (e.g. the file analyzed).

analysis.pass ⇒ Boolean

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

ParamTypeDescription
errorAnalysisErrorAn error in the target.

Analyzer

Provides analysis of source data.

Kind: global class
Properties

NameTypeDescription
analyzefunctionAccepts source data and returns an Analysis object.
configurefunctionAllows configuration of the analyzer.
nameStringThe name of the analyzer.

new Analyzer(parameters)

Create an analyzer.

ParamTypeDefaultDescription
parametersObjectNamed parameter values to use in construction.
parameters.analyzefunctionA function which returns an Analysis object for given source data.
parameters.configurefunctionDefaultAnalyzerConfigureA function which accepts user-provided configuration to influence the analyzer.
parameters.nameStringThe name of the analyzer

FileSourceData

Data, from a file source, to be passed through an analyzer for analysis.

Kind: global class
Properties

NameTypeDefaultDescription
Symbol.iteratorFileSourceDataSampleIteratorIterator to traverse samples of text for analysis.
lineStartNumber1The line on which this source data starts within the containing file.
textStringThe text contents of the file to analyze.

new FileSourceData(parameters)

Create file source data.

ParamTypeDescription
parametersObjectNamed parameter values to use in construction.
parameters.lineStartNumberThe line on which this source data starts within its file.
parameters.textStringThe text contents of the file to analyze.

FileSourceDataSampleIterator

Iterator which produces data samples from a file source.

Kind: global class

fileSourceDataSampleIterator.next() ⇒ FileSourceDataSampleIteration

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

NameTypeDescription
analysesArray.<Analysis>The analyses of all processed source data.
passBooleanWhether all analyses passed.

new Report()

Create a Report.

report.addAnalysis(analysis)

Add an analysis to the report.

Kind: instance method of Report

ParamTypeDescription
analysisAnalysisAn analysis to add to the report.

Reporter

Disseminates a Report.

Kind: global class
Properties

NameTypeDescription
reportfunctionAccepts a Report and disseminates it in an implementation-specific way.

new Reporter(parameters)

Create a Reporter.

ParamTypeDescription
parametersObjectNamed parameter values to use in construction.
parameters.reportfunctionAccepts a Report and disseminates it in an implementation-specific way.

AnalysisError : Object

An error encountered during analysis.

Kind: global typedef
Properties

NameTypeDescription
lineNumberThe line number on which the error was found.
messageStringA description of the error found.

DefaultAnalyzerConfigure : function

Default configure implementation for a new Analyzer which allows disabling the analyzer by passing a boolean false as its entire configuration.

Kind: global typedef

ParamTypeDescription
enabledBooleanFalse to disable the analyzer; otherwise it is enabled.

FileSourceDataSampleIteration : Object

An iteration of file source data.

Kind: global typedef
Properties

NameTypeDescription
doneBooleanFalse if there are more samples; otherwise true.
valueObjectFile source data sample.
value.lineNumberThe line of the current sample.
value.textStringThe text of the current sample.