Documentation ¶
Overview ¶
Package anlzr provides the necessary API for making source code analyzis.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer interface { // Analyze performs an source code analysis on a project and adds the // resulting metrics into r. Analyze(p *src.Project, r *Result) error }
An Analyzer represents a source code analyzer which extracts one or more metrics from the structure defined by the src package.
type CommentRatios ¶
type CommentRatios struct { TypeComRatio float32 `json:"type_comment_ratio"` StructComRatio float32 `json:"structure_comment_ratio"` ConstComRatio float32 `json:"constant_comment_ratio"` VarsComRatio float32 `json:"variable_comment_ratio"` FuncComRatio float32 `json:"function_comment_ratio"` InterComRatio float32 `json:"interface_comment_ratio"` ClassComRatio float32 `json:"class_comment_ratio"` MethComRatio float32 `json:"method_comment"` AttrComRatio float32 `json:"attribute_comment_ratio"` EnumComRatio float32 `json:"enumeration_comment_ratio"` }
CommentRatios contains various ratios about documentation coverage.
type Complexity ¶
type Complexity struct{}
type ComplexityMetrics ¶
type ComplexityMetrics struct { AveragePerFunc float32 `json:"average_per_func" xml:"average-per-func"` // Average complexity per function. AveragePerFile float32 `json:"average_per_file" xml:"average-per-file"` // Average complexity per file. }
CyclomaticComplexity metrics, also known as McCabe metric.
type LocPerLang ¶
type LocPerLang struct{}
type Result ¶
type Result struct { ProgLangs []Language `json:"programming_languages" xml:"programming-languages"` AverageFuncLen float32 `json:"average_function_length" xml:"average-function-length"` MaxFuncLen int64 `json:"max_function_length" xml:"max-function-length"` MinFuncLen int64 `json:"min_function_length" xml:"min-function-length"` MedianFuncLen int64 `json:"median_function_length" xml:"median-function-length"` TotalLoC int64 `json:"total_loc" xml:"total-loc"` Complexity ComplexityMetrics `json:"complexity" xml:"complexity"` DocCoverage CommentRatios `json:"documentation_coverage" xml:"documentation-coverage"` }
A Result holds all source code analysis metrics output by srcanlzr.
Click to show internal directories.
Click to hide internal directories.