Preparing report...

Report for github.com/bububa/jiagu

A+    Excellent!    Found 28 issues across 66 files

Tweet

gofmt95%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo98%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.


golint59%

Golint is a linter for Go source code.

    • jiagu/utils/set.go
    • Line 11: warning: exported function InitStringSet should have comment or be unexported (golint)
    • Line 69: warning: should omit 2nd value from range; this loop is equivalent to `for str := range ...` (golint)
    • jiagu/perceptron/perceptron.go
    • Line 20: warning: exported var DefaultStarts should have comment or be unexported (golint)
    • Line 66: warning: comment on exported method Perceptron.Predict should be of the form "Predict ..." (golint)
    • jiagu/cluster/kmeans.go
    • Line 19: warning: comment on exported function NewKmeans should be of the form "NewKmeans ..." (golint)
    • Line 27: warning: exported method Kmeans.SetK should have comment or be unexported (golint)
    • Line 31: warning: exported method Kmeans.SetMaxIter should have comment or be unexported (golint)
    • Line 35: warning: exported method Kmeans.SetDeltaThreshold should have comment or be unexported (golint)
    • jiagu/cluster/obversation.go
    • Line 21: warning: exported type Observation should have comment or be unexported (golint)
    • Line 27: warning: exported type Observations should have comment or be unexported (golint)
    • jiagu/classify/bayes/probe.go
    • Line 54: warning: exported method Probe.AddWords should have comment or be unexported (golint)
    • Line 67: warning: exported method Probe.Add should have comment or be unexported (golint)
    • jiagu/init.go
    • Line 24: warning: comment on exported const STOPWORDS_DICT should be of the form "STOPWORDS_DICT ..." (golint)
    • Line 48: warning: exported function Init should have comment or be unexported (golint)
    • jiagu/textrank/score.go
    • Line 3: warning: exported type Score should have comment or be unexported (golint)
    • Line 8: warning: exported type ScoreSlice should have comment or be unexported (golint)
    • Line 10: warning: exported function NewScoreSlice should have comment or be unexported (golint)
    • jiagu/segment/segment.go
    • Line 20: warning: exported type SegMode should have comment or be unexported (golint)
    • Line 23: warning: don't use underscores in Go names; const Default_SegMode should be DefaultSegMode (golint)
    • Line 23: warning: exported const Default_SegMode should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: don't use underscores in Go names; const Probe_SegMode should be ProbeSegMode (golint)
    • jiagu/perceptron/model/kv.go
    • Line 3: warning: exported type KV should have comment or be unexported (golint)
    • Line 8: warning: exported method KV.IsZero should have comment or be unexported (golint)
    • Line 12: warning: exported type KVSlice should have comment or be unexported (golint)
    • Line 14: warning: exported function NewKVSlice should have comment or be unexported (golint)
    • jiagu/findword/findword.go
    • Line 20: warning: comment on exported const DEFAULT_MIN_ENTRO should be of the form "DEFAULT_MIN_ENTRO ..." (golint)
    • Line 49: warning: comment on exported method Findword.SetMinMtro should be of the form "SetMinMtro ..." (golint)
    • jiagu/perceptron/model/weights.go
    • Line 7: warning: comment on exported type Weights should be of the form "Weights ..." (with optional leading article) (golint)
    • Line 25: warning: exported function NewWeightsFromMap should have comment or be unexported (golint)
    • Line 68: warning: exported method Weights.GetFeatureLength should have comment or be unexported (golint)
    • Line 111: warning: comment on exported method Weights.Features should be of the form "Features ..." (golint)
    • Line 115: warning: should omit 2nd value from range; this loop is equivalent to `for feat := range ...` (golint)
    • Line 123: warning: exported function FeatureClassKey should have comment or be unexported (golint)
    • jiagu/textrank/summarize.go
    • Line 12: warning: exported type Summarize should have comment or be unexported (golint)
    • Line 19: warning: comment on exported function NewSummarize should be of the form "NewSummarize ..." (golint)
    • jiagu/segment/route.go
    • Line 3: warning: exported type Route should have comment or be unexported (golint)
    • Line 8: warning: exported var DefaultRoute should have comment or be unexported (golint)
    • Line 10: warning: exported function NewRoute should have comment or be unexported (golint)
    • Line 17: warning: exported type RouteSlice should have comment or be unexported (golint)
    • Line 19: warning: exported function NewRouteSlice should have comment or be unexported (golint)
    • jiagu/textrank/keywords.go
    • Line 17: warning: comment on exported const DEFAULT_WINDOW should be of the form "DEFAULT_WINDOW ..." (golint)
    • Line 30: warning: comment on exported function NewKeywords should be of the form "NewKeywords ..." (golint)
    • Line 79: warning: comment on exported method Keywords.LoadStopwrdsFile should be of the form "LoadStopwrdsFile ..." (golint)
    • jiagu/cluster/features.go
    • Line 20: warning: exported method Feature.GetID should have comment or be unexported (golint)
    • Line 24: warning: exported method Feature.Distance should have comment or be unexported (golint)
    • Line 28: warning: exported method Feature.Coordinates should have comment or be unexported (golint)
    • Line 42: warning: exported function NewCounterFeaturesGetter should have comment or be unexported (golint)
    • Line 89: warning: exported function NewTfIdfFeaturesGetter should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


misspell95%

Misspell Finds commonly misspelled English words

    • jiagu/perceptron/averaged_perceptron.go
    • Line 17: warning: "clas" is a misspelling of "class" (misspell)
    • Line 18: warning: "clas" is a misspelling of "class" (misspell)
    • Line 112: warning: "clas" is a misspelling of "class" (misspell)
    • Line 113: warning: "clas" is a misspelling of "class" (misspell)
    • Line 116: warning: "clas" is a misspelling of "class" (misspell)
    • Line 136: warning: "clas" is a misspelling of "class" (misspell)
    • Line 137: warning: "clas" is a misspelling of "class" (misspell)
    • jiagu/perceptron/model/weights.go
    • Line 29: warning: "clas" is a misspelling of "class" (misspell)
    • Line 30: warning: "clas" is a misspelling of "class" (misspell)
    • Line 37: warning: "clas" is a misspelling of "class" (misspell)
    • Line 38: warning: "clas" is a misspelling of "class" (misspell)
    • Line 47: warning: "clas" is a misspelling of "class" (misspell)
    • Line 48: warning: "clas" is a misspelling of "class" (misspell)
    • Line 49: warning: "clas" is a misspelling of "class" (misspell)
    • Line 56: warning: "clas" is a misspelling of "class" (misspell)
    • Line 63: warning: "clas" is a misspelling of "class" (misspell)
    • Line 87: warning: "clas" is a misspelling of "class" (misspell)
    • Line 89: warning: "clas" is a misspelling of "class" (misspell)
    • Line 104: warning: "clas" is a misspelling of "class" (misspell)
    • Line 105: warning: "clas" is a misspelling of "class" (misspell)
    • Line 123: warning: "clas" is a misspelling of "class" (misspell)
    • Line 127: warning: "clas" is a misspelling of "class" (misspell)