Preparing report...

Report for github.com/chenpengfei/scuttlebutt-golang

A+    Excellent!    Found 22 issues across 35 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo100%

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.

No problems detected. Good job!


golint37%

Golint is a linter for Go source code.

    • scuttlebutt-golang/pkg/pull-stringify/option.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 3: warning: exported type Option should have comment or be unexported (golint)
    • Line 5: warning: exported function WithOpen should have comment or be unexported (golint)
    • Line 11: warning: exported function WithPrefix should have comment or be unexported (golint)
    • Line 17: warning: exported function WithSuffix should have comment or be unexported (golint)
    • Line 23: warning: exported function WithClose should have comment or be unexported (golint)
    • Line 29: warning: exported function WithIndent should have comment or be unexported (golint)
    • scuttlebutt-golang/pkg/pull-stringify/pull-stringify.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 10: warning: exported type PullStringify should have comment or be unexported (golint)
    • Line 22: warning: exported function NewPullStringify should have comment or be unexported (golint)
    • Line 42: warning: exported method PullStringify.Serialize should have comment or be unexported (golint)
    • scuttlebutt-golang/pkg/model/sync_model.go
    • Line 9: warning: exported type ValueModel should have comment or be unexported (golint)
    • Line 14: warning: exported type ValueModelFrom should have comment or be unexported (golint)
    • Line 19: warning: comment on exported type SyncModel should be of the form "SyncModel ..." (with optional leading article) (golint)
    • Line 27: warning: exported function NewSyncModel should have comment or be unexported (golint)
    • Line 33: warning: exported method SyncModel.IsAccepted should have comment or be unexported (golint)
    • Line 55: warning: exported method SyncModel.ApplyUpdates should have comment or be unexported (golint)
    • Line 84: warning: exported method SyncModel.History should have comment or be unexported (golint)
    • Line 98: warning: exported method SyncModel.Set should have comment or be unexported (golint)
    • Line 105: warning: exported method SyncModel.Get should have comment or be unexported (golint)
    • Line 109: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 116: warning: exported method SyncModel.Keys should have comment or be unexported (golint)
    • Line 126: warning: exported method SyncModel.CreateStream should have comment or be unexported (golint)
    • Line 130: warning: exported method SyncModel.CreateWriteStream should have comment or be unexported (golint)
    • Line 137: warning: exported method SyncModel.CreateSinkStream should have comment or be unexported (golint)
    • Line 144: warning: exported method SyncModel.CreateReadStream should have comment or be unexported (golint)
    • Line 151: warning: exported method SyncModel.CreateSourceStream should have comment or be unexported (golint)
    • scuttlebutt-golang/pkg/scuttlebutt/util.go
    • Line 10: warning: exported type CreateIdFn should have comment or be unexported (golint)
    • Line 12: warning: exported function CreateId should have comment or be unexported (golint)
    • Line 22: warning: exported function Filter should have comment or be unexported (golint)
    • Line 37: warning: exported function Sort should have comment or be unexported (golint)
    • scuttlebutt-golang/pkg/duplex/buffer.go
    • Line 3: warning: comment on exported type Buffer should be of the form "Buffer ..." (with optional leading article) (golint)
    • Line 8: warning: exported function NewBuffer should have comment or be unexported (golint)
    • Line 12: warning: exported method Buffer.Length should have comment or be unexported (golint)
    • Line 16: warning: comment on exported method Buffer.Shift should be of the form "Shift ..." (golint)
    • Line 27: warning: comment on exported method Buffer.Unshift should be of the form "Unshift ..." (golint)
    • Line 32: warning: comment on exported method Buffer.Push should be of the form "Push ..." (golint)
    • scuttlebutt-golang/pkg/pull-split/option.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 3: warning: exported type Option should have comment or be unexported (golint)
    • Line 5: warning: exported function WithMatcher should have comment or be unexported (golint)
    • Line 11: warning: exported function WithMapper should have comment or be unexported (golint)
    • Line 17: warning: exported function WithReverse should have comment or be unexported (golint)
    • Line 23: warning: exported function WithLast should have comment or be unexported (golint)
    • scuttlebutt-golang/pkg/pull-split/split.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 9: warning: exported type Split should have comment or be unexported (golint)
    • Line 19: warning: exported function NewSplit should have comment or be unexported (golint)
    • Line 92: warning: exported method Split.Through should have comment or be unexported (golint)
    • scuttlebutt-golang/pkg/pull-through/through.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 9: warning: exported type Event should have comment or be unexported (golint)
    • Line 11: warning: exported type Through should have comment or be unexported (golint)
    • Line 20: warning: exported function NewThrough should have comment or be unexported (golint)
    • Line 47: warning: exported const DataEvent should have comment (or a comment on this block) or be unexported (golint)
    • Line 52: warning: exported method Through.Emit should have comment or be unexported (golint)
    • Line 69: warning: exported method Through.Through should have comment or be unexported (golint)
    • Line 136: warning: exported method Through.EnQueue should have comment or be unexported (golint)
    • scuttlebutt-golang/pkg/duplex/option.go
    • Line 3: warning: exported type Option should have comment or be unexported (golint)
    • Line 5: warning: exported function WithName should have comment or be unexported (golint)
    • Line 11: warning: exported function WithReadable should have comment or be unexported (golint)
    • Line 17: warning: exported function WithWritable should have comment or be unexported (golint)
    • scuttlebutt-golang/pkg/socket/to-pull.go
    • Line 122: warning: exported method Duplex.Source should have comment or be unexported (golint)
    • Line 126: warning: exported method Duplex.Sink should have comment or be unexported (golint)
    • Line 130: warning: exported type Duplex should have comment or be unexported (golint)
    • Line 135: warning: exported function NewDuplex should have comment or be unexported (golint)
    • scuttlebutt-golang/pkg/duplex/duplex.go
    • Line 25: warning: exported type OnClose should have comment or be unexported (golint)
    • Line 30: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 35: warning: exported type Outgoing should have comment or be unexported (golint)
    • Line 42: warning: exported type Stream should have comment or be unexported (golint)
    • Line 47: warning: exported type Duplex should have comment or be unexported (golint)
    • Line 73: warning: comment on exported function NewDuplex should be of the form "NewDuplex ..." (golint)
    • Line 307: warning: exported method Duplex.Source should have comment or be unexported (golint)
    • Line 320: warning: exported method Duplex.Sink should have comment or be unexported (golint)
    • Line 354: warning: exported method Duplex.End should have comment or be unexported (golint)
    • scuttlebutt-golang/pkg/logger/logger.go
    • Line 18: warning: exported const LayoutRelease should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: comment on exported function InitLogWriterEarly should be of the form "InitLogWriterEarly ..." (golint)
    • Line 48: warning: exported function WithNamespace should have comment or be unexported (golint)
    • Line 54: warning: exported function StandardLogger should have comment or be unexported (golint)
    • scuttlebutt-golang/pkg/pull-pushable/option.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 3: warning: exported type Option should have comment or be unexported (golint)
    • Line 5: warning: exported function WithName should have comment or be unexported (golint)
    • Line 11: warning: exported function WithOnClose should have comment or be unexported (golint)
    • scuttlebutt-golang/pkg/scuttlebutt/scuttlebutt.go
    • Line 11: warning: comment on exported type SourceId should be of the form "SourceId ..." (with optional leading article) (golint)
    • Line 14: warning: exported type Timestamp should have comment or be unexported (golint)
    • Line 16: warning: comment on exported type Sources should be of the form "Sources ..." (with optional leading article) (golint)
    • Line 20: warning: comment on exported type Update should be of the form "Update ..." (with optional leading article) (golint)
    • Line 29: warning: exported type Sign should have comment or be unexported (golint)
    • Line 30: warning: exported type Verify should have comment or be unexported (golint)
    • Line 31: warning: exported type IsAccepted should have comment or be unexported (golint)
    • Line 33: warning: exported type ModelValueItems should have comment or be unexported (golint)
    • Line 36: warning: exported const ModelValueItemsKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 40: warning: exported type ModelAccept should have comment or be unexported (golint)
    • Line 45: warning: exported type Model should have comment or be unexported (golint)
    • Line 54: warning: exported type Scuttlebutt should have comment or be unexported (golint)
    • Line 70: warning: exported function NewScuttlebutt should have comment or be unexported (golint)
    • Line 97: warning: exported method Scuttlebutt.IsAccepted should have comment or be unexported (golint)
    • Line 101: warning: exported method Scuttlebutt.ApplyUpdates should have comment or be unexported (golint)
    • Line 105: warning: exported method Scuttlebutt.History should have comment or be unexported (golint)
    • Line 109: warning: exported method Scuttlebutt.Id should have comment or be unexported (golint)
    • Line 113: warning: exported method Scuttlebutt.Update should have comment or be unexported (golint)
    • Line 132: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 168: warning: exported method Scuttlebutt.LocalUpdate should have comment or be unexported (golint)
    • Line 176: warning: comment on exported method Scuttlebutt.Dispose should be of the form "Dispose ..." (golint)
    • scuttlebutt-golang/pkg/pull-pushable/pushable.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 10: warning: exported type OnClose should have comment or be unexported (golint)
    • Line 11: warning: exported type Ender should have comment or be unexported (golint)
    • Line 12: warning: exported type Push should have comment or be unexported (golint)
    • Line 22: warning: exported type Pushable should have comment or be unexported (golint)
    • Line 31: warning: exported function NewPushable should have comment or be unexported (golint)
    • scuttlebutt-golang/pkg/pull-through/option.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 3: warning: exported type Option should have comment or be unexported (golint)
    • Line 5: warning: exported function WithWriter should have comment or be unexported (golint)
    • Line 11: warning: exported function WithEnder should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell97%

Misspell Finds commonly misspelled English words