Preparing report...

Report for github.com/dragonflyoss/Dragonfly

A+    Excellent!    Found 57 issues across 317 files

Tweet

gofmt97%

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.


golint84%

Golint is a linter for Go source code.

    • Dragonfly/supernode/config/constants.go
    • Line 140: warning: comment on exported type Pattern should be of the form "Pattern ..." (with optional leading article) (golint)
    • Line 144: warning: exported const P2pPattern should have comment (or a comment on this block) or be unexported (golint)
    • Dragonfly/supernode/daemon/mgr/preheat/preheat_service.go
    • Line 41: warning: exported type PreheatService should have comment or be unexported (golint)
    • Line 46: warning: exported function NewPreheatService should have comment or be unexported (golint)
    • Line 61: warning: comment on exported method PreheatService.GetAll should be of the form "GetAll ..." (golint)
    • Line 77: warning: comment on exported method PreheatService.Update should be of the form "Update ..." (golint)
    • Line 82: warning: comment on exported method PreheatService.Create should be of the form "Create ..." (golint)
    • Line 99: warning: comment on exported method PreheatService.ExecutePreheat should be of the form "ExecutePreheat ..." (golint)
    • Dragonfly/dfdaemon/downloader/p2p/dfclient.go
    • Line 27: warning: exported type Client should have comment or be unexported (golint)
    • Line 30: warning: exported method Client.DownloadContext should have comment or be unexported (golint)
    • Line 34: warning: exported method Client.DownloadStreamContext should have comment or be unexported (golint)
    • Line 38: warning: exported function NewClient should have comment or be unexported (golint)
    • Dragonfly/dfdaemon/transport/transport.go
    • Line 111: warning: exported function WithStreamDownloader should have comment or be unexported (golint)
    • Line 118: warning: exported function WithStreamMode should have comment or be unexported (golint)
    • Line 201: warning: comment on exported function NeedUseGetter should be of the form "NeedUseGetter ..." (golint)
    • Dragonfly/dfget/core/helper/test_helper.go
    • Line 121: warning: comment on exported type ReportMetricsFuncType should be of the form "ReportMetricsFuncType ..." (with optional leading article) (golint)
    • Line 180: warning: exported method MockSupernodeAPI.ReportMetrics should have comment or be unexported (golint)
    • Line 187: warning: exported method MockSupernodeAPI.HeartBeat should have comment or be unexported (golint)
    • Line 190: warning: exported method MockSupernodeAPI.FetchP2PNetworkInfo should have comment or be unexported (golint)
    • Line 193: warning: exported method MockSupernodeAPI.ReportResource should have comment or be unexported (golint)
    • Line 196: warning: exported method MockSupernodeAPI.ApplyForSeedNode should have comment or be unexported (golint)
    • Line 199: warning: exported method MockSupernodeAPI.ReportResourceDeleted should have comment or be unexported (golint)
    • Line 245: warning: exported function NewMockFileServer should have comment or be unexported (golint)
    • Line 328: warning: exported method MockFileServer.RegisterFile should have comment or be unexported (golint)
    • Line 361: warning: exported method MockFileServer.UnRegisterFile should have comment or be unexported (golint)
    • Line 368: warning: exported method MockFileServer.MockResp should have comment or be unexported (golint)
    • Dragonfly/supernode/daemon/mgr/pieceerror/manager.go
    • Line 37: warning: exported const ErrHandlerChanSize should have comment (or a comment on this block) or be unexported (golint)
    • Line 48: warning: exported function Register should have comment or be unexported (golint)
    • Line 52: warning: comment on exported type Handler should be of the form "Handler ..." (with optional leading article) (golint)
    • Line 57: warning: exported type Manager should have comment or be unexported (golint)
    • Line 70: warning: exported function NewManager should have comment or be unexported (golint)
    • Dragonfly/pkg/protocol/http/md.go
    • Line 37: warning: exported method Headers.Get should have comment or be unexported (golint)
    • Line 41: warning: exported method Headers.Set should have comment or be unexported (golint)
    • Line 45: warning: exported method Headers.Del should have comment or be unexported (golint)
    • Line 49: warning: exported method Headers.All should have comment or be unexported (golint)
    • Dragonfly/pkg/protocol/http/resource.go
    • Line 62: warning: exported method Resource.Length should have comment or be unexported (golint)
    • Line 90: warning: exported method Resource.Metadata should have comment or be unexported (golint)
    • Line 94: warning: exported method Resource.Expire should have comment or be unexported (golint)
    • Line 99: warning: exported method Resource.Call should have comment or be unexported (golint)
    • Line 103: warning: exported method Resource.Close should have comment or be unexported (golint)
    • Dragonfly/supernode/daemon/mgr/preheat/base_worker.go
    • Line 1: warning: package comment should be of the form "Package preheat ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 27: warning: exported const TIMEOUT should have comment or be unexported (golint)
    • Line 31: warning: exported type IWorker should have comment or be unexported (golint)
    • Line 40: warning: exported type BaseWorker should have comment or be unexported (golint)
    • Line 59: warning: exported method BaseWorker.Run should have comment or be unexported (golint)
    • Line 84: warning: exported method BaseWorker.Stop should have comment or be unexported (golint)
    • Dragonfly/supernode/daemon/mgr/preheat/manager.go
    • Line 37: warning: exported function NewManager should have comment or be unexported (golint)
    • Line 41: warning: exported method Manager.Create should have comment or be unexported (golint)
    • Line 53: warning: exported method Manager.Get should have comment or be unexported (golint)
    • Line 61: warning: exported method Manager.Delete should have comment or be unexported (golint)
    • Line 66: warning: exported method Manager.GetAll should have comment or be unexported (golint)
    • Dragonfly/supernode/daemon/mgr/preheat/preheat_task_repository.go
    • Line 1: warning: package comment should be of the form "Package preheat ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 26: warning: comment on exported const EXPIRED_TIME should be of the form "EXPIRED_TIME ..." (golint)
    • Line 30: warning: exported type PreheatTaskRepository should have comment or be unexported (golint)
    • Line 34: warning: exported function NewPreheatTaskRepository should have comment or be unexported (golint)
    • Line 41: warning: exported method PreheatTaskRepository.Get should have comment or be unexported (golint)
    • Line 49: warning: exported method PreheatTaskRepository.GetAll should have comment or be unexported (golint)
    • Line 58: warning: exported method PreheatTaskRepository.GetAllIds should have comment or be unexported (golint)
    • Line 67: warning: exported method PreheatTaskRepository.Add should have comment or be unexported (golint)
    • Line 72: warning: exported method PreheatTaskRepository.Update should have comment or be unexported (golint)
    • Line 96: warning: exported method PreheatTaskRepository.Delete should have comment or be unexported (golint)
    • Line 102: warning: exported method PreheatTaskRepository.IsExpired should have comment or be unexported (golint)
    • Dragonfly/supernode/daemon/mgr/preheat/file_preaheater.go
    • Line 1: warning: package comment should be of the form "Package preheat ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 31: warning: exported type FilePreheat should have comment or be unexported (golint)
    • Line 35: warning: exported method FilePreheat.Type should have comment or be unexported (golint)
    • Line 39: warning: comment on exported method FilePreheat.NewWorker should be of the form "NewWorker ..." (golint)
    • Line 49: warning: exported type FileWorker should have comment or be unexported (golint)
    • Line 94: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Dragonfly/supernode/daemon/mgr/cdn_mgr.go
    • Line 31: warning: exported type CDNBuilder should have comment or be unexported (golint)
    • Line 36: warning: exported function Register should have comment or be unexported (golint)
    • Line 40: warning: exported function GetCDNManager should have comment or be unexported (golint)
    • Dragonfly/pkg/protocol/http/http.go
    • Line 42: warning: comment on exported const ProtocolHTTPName should be of the form "ProtocolHTTPName ..." (golint)
    • Line 45: warning: comment on exported const ProtocolHTTPSName should be of the form "ProtocolHTTPSName ..." (golint)
    • Line 81: warning: exported method Client.GetResource should have comment or be unexported (golint)
    • Line 181: warning: exported method ClientBuilder.NewProtocolClient should have comment or be unexported (golint)
    • Dragonfly/supernode/daemon/mgr/preheat/base_preaheater.go
    • Line 1: warning: package comment should be of the form "Package preheat ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 26: warning: exported type BasePreheater should have comment or be unexported (golint)
    • Line 28: warning: comment on exported method BasePreheater.Type should be of the form "Type ..." (golint)
    • Line 35: warning: comment on exported method BasePreheater.NewWorker should be of the form "NewWorker ..." (golint)
    • Line 42: warning: comment on exported method BasePreheater.Cancel should be of the form "Cancel ..." (golint)
    • Line 53: warning: comment on exported method BasePreheater.Remove should be of the form "Remove ..." (golint)
    • Dragonfly/dfget/config/supernode_value.go
    • Line 33: warning: exported type SupernodesValue should have comment or be unexported (golint)
    • Line 37: warning: exported type NodeWeight should have comment or be unexported (golint)
    • Line 42: warning: exported function NewSupernodesValue should have comment or be unexported (golint)
    • Dragonfly/dfget/locator/hashcircler_locator.go
    • Line 39: warning: exported type SuperNodeEvent should have comment or be unexported (golint)
    • Line 44: warning: exported function NewEnableEvent should have comment or be unexported (golint)
    • Line 51: warning: exported function NewDisableEvent should have comment or be unexported (golint)
    • Line 70: warning: exported function NewHashCirclerLocator should have comment or be unexported (golint)
    • Dragonfly/pkg/protocol/url.go
    • Line 83: warning: exported var ErrNotImplementation should have comment or be unexported (golint)
    • Line 139: warning: exported type MapInterfaceOptFunc should have comment or be unexported (golint)
    • Dragonfly/supernode/daemon/mgr/preheat/preheater.go
    • Line 1: warning: package comment should be of the form "Package preheat ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 22: warning: exported type Preheater should have comment or be unexported (golint)
    • Line 44: warning: exported function GetPreheater should have comment or be unexported (golint)
    • Line 48: warning: exported function RegisterPreheater should have comment or be unexported (golint)
    • Dragonfly/supernode/daemon/mgr/preheat/image_preaheater.go
    • Line 1: warning: package comment should be of the form "Package preheat ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 37: warning: exported var IMAGE_MANIFESTS_PATTERN should have comment or be unexported (golint)
    • Line 39: warning: exported type ImagePreheat should have comment or be unexported (golint)
    • Line 43: warning: exported method ImagePreheat.Type should have comment or be unexported (golint)
    • Line 47: warning: comment on exported method ImagePreheat.NewWorker should be of the form "NewWorker ..." (golint)
    • Line 63: warning: exported type ImageWorker should have comment or be unexported (golint)
    • Line 285: warning: exported type Layer should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign99%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!