Preparing report...

Report for github.com/odyseeteam/transcoder

(v0.14.0)

A+    Excellent!    Found 49 issues across 68 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.

    • manager/http.go
    • Line 91: warning: cyclomatic complexity 19 of function (*HttpAPI).handleVideo() is high (> 15) (gocyclo)

golint30%

Golint is a linter for Go source code.

    • storage/storage.go
    • Line 7: warning: exported type StreamFragment should have comment or be unexported (golint)
    • Line 11: warning: exported type RemoteDriver should have comment or be unexported (golint)
    • Line 17: warning: exported type LocalDriver should have comment or be unexported (golint)
    • storage/s3.go
    • Line 17: warning: exported var ErrStreamExists should have comment or be unexported (golint)
    • Line 25: warning: exported type S3Configuration should have comment or be unexported (golint)
    • Line 30: warning: exported function S3Configure should have comment or be unexported (golint)
    • Line 65: warning: exported function InitS3Driver should have comment or be unexported (golint)
    • Line 95: warning: exported type S3Driver should have comment or be unexported (golint)
    • Line 100: warning: exported method S3Driver.Put should have comment or be unexported (golint)
    • Line 137: warning: exported method S3Driver.Delete should have comment or be unexported (golint)
    • Line 169: warning: exported method S3Driver.Get should have comment or be unexported (golint)
    • Line 173: warning: exported method S3Driver.GetFragment should have comment or be unexported (golint)
    • encoder/arguments.go
    • Line 11: warning: exported type Argument should have comment or be unexported (golint)
    • Line 14: warning: exported const MasterPlaylist should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: exported type Arguments should have comment or be unexported (golint)
    • Line 58: warning: exported function NewArguments should have comment or be unexported (golint)
    • video/models.go
    • Line 10: warning: exported type Video should have comment or be unexported (golint)
    • Line 37: warning: exported method Video.GetSize should have comment or be unexported (golint)
    • Line 41: warning: exported method Video.GetWeight should have comment or be unexported (golint)
    • video/schema.go
    • Line 5: warning: exported var InitialMigration should have comment or be unexported (golint)
    • pkg/dispatcher/dispatcher.go
    • Line 2: warning: package comment is detached; there should be no blank lines between it and the package statement (golint)
    • Line 12: warning: exported const TaskFailed should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported var ErrInvalidPayload should have comment or be unexported (golint)
    • Line 61: warning: exported method Task.SetResult should have comment or be unexported (golint)
    • Line 65: warning: exported method Result.Failed should have comment or be unexported (golint)
    • Line 69: warning: exported method Result.Done should have comment or be unexported (golint)
    • Line 73: warning: exported method Result.Value should have comment or be unexported (golint)
    • Line 132: warning: exported type Dispatcher should have comment or be unexported (golint)
    • Line 188: warning: exported method Dispatcher.Stop should have comment or be unexported (golint)
    • storage/local.go
    • Line 8: warning: exported type LocalStorage should have comment or be unexported (golint)
    • Line 12: warning: exported function Local should have comment or be unexported (golint)
    • Line 16: warning: exported method LocalStorage.New should have comment or be unexported (golint)
    • Line 20: warning: exported method LocalStorage.Open should have comment or be unexported (golint)
    • Line 26: warning: exported method LocalStorage.Delete should have comment or be unexported (golint)
    • storage/null.go
    • Line 3: warning: exported type NullDriver should have comment or be unexported (golint)
    • Line 5: warning: exported method NullDriver.Put should have comment or be unexported (golint)
    • Line 10: warning: exported method NullDriver.Delete should have comment or be unexported (golint)
    • Line 15: warning: exported method NullDriver.GetFragment should have comment or be unexported (golint)
    • encoder/encoder.go
    • Line 20: warning: exported type Encoder should have comment or be unexported (golint)
    • Line 28: warning: exported type Result should have comment or be unexported (golint)
    • Line 34: warning: exported type Configuration should have comment or be unexported (golint)
    • Line 51: warning: exported method Configuration.FfmpegPath should have comment or be unexported (golint)
    • Line 56: warning: exported method Configuration.FfprobePath should have comment or be unexported (golint)
    • Line 67: warning: exported function NewEncoder should have comment or be unexported (golint)
    • manager/errors.go
    • Line 6: warning: exported var ErrTranscodingUnderway should have comment or be unexported (golint)
    • client/metrics.go
    • Line 25: warning: exported var TranscodedCacheSizeBytes should have comment or be unexported (golint)
    • Line 59: warning: exported function RegisterMetrics should have comment or be unexported (golint)
    • pkg/mfr/mfr.go
    • Line 11: warning: exported const StatusNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported type Position should have comment or be unexported (golint)
    • Line 142: warning: exported method Queue.Hits should have comment or be unexported (golint)
    • Line 186: warning: exported method Queue.Size should have comment or be unexported (golint)
    • main.go
    • Line 31: warning: exported var CLI should have comment or be unexported (golint)
    • video/db.go
    • Line 10: warning: exported type DBTX should have comment or be unexported (golint)
    • Line 18: warning: exported function New should have comment or be unexported (golint)
    • Line 22: warning: exported type Queries should have comment or be unexported (golint)
    • manager/metrics.go
    • Line 12: warning: exported var QueueLength should have comment or be unexported (golint)
    • Line 28: warning: exported function RegisterMetrics should have comment or be unexported (golint)
    • manager/pool.go
    • Line 30: warning: exported function NewPool should have comment or be unexported (golint)
    • Line 114: warning: exported method Pool.Out should have comment or be unexported (golint)
    • client/client.go
    • Line 30: warning: exported const MasterPlaylistName should have comment (or a comment on this block) or be unexported (golint)
    • Line 58: warning: exported var ErrNotOK should have comment or be unexported (golint)
    • Line 71: warning: exported type HTTPRequester should have comment or be unexported (golint)
    • Line 75: warning: exported type Client should have comment or be unexported (golint)
    • Line 83: warning: exported type Configuration should have comment or be unexported (golint)
    • Line 93: warning: exported type Fragment should have comment or be unexported (golint)
    • Line 98: warning: exported function Configure should have comment or be unexported (golint)
    • Line 151: warning: exported method Configuration.HTTPClient should have comment or be unexported (golint)
    • Line 162: warning: exported method Fragment.Size should have comment or be unexported (golint)
    • Line 166: warning: exported method Fragment.Path should have comment or be unexported (golint)
    • Line 170: warning: exported function New should have comment or be unexported (golint)
    • Line 260: warning: exported method Client.BuildUrl should have comment or be unexported (golint)
    • db/db.go
    • Line 19: warning: exported type DB should have comment or be unexported (golint)
    • Line 60: warning: exported method DB.MigrateUp should have comment or be unexported (golint)
    • Line 71: warning: exported method DB.MigrateUpFromFile should have comment or be unexported (golint)
    • Line 79: warning: exported method DB.MigrateDown should have comment or be unexported (golint)
    • Line 90: warning: exported method DB.MigrateDownFromFile should have comment or be unexported (golint)
    • pkg/logging/logging.go
    • Line 13: warning: exported var EnvDebug should have comment or be unexported (golint)
    • Line 17: warning: exported var Prod should have comment or be unexported (golint)
    • Line 18: warning: exported var Dev should have comment or be unexported (golint)
    • Line 24: warning: exported function Create should have comment or be unexported (golint)
    • Line 29: warning: exported type KVLogger should have comment or be unexported (golint)
    • Line 37: warning: exported type NoopKVLogger should have comment or be unexported (golint)
    • Line 41: warning: exported method NoopKVLogger.With should have comment or be unexported (golint)
    • db/logger.go
    • Line 10: warning: exported function SetLogger should have comment or be unexported (golint)
    • formats/formats.go
    • Line 14: warning: exported const TypeHLS should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: exported type Format should have comment or be unexported (golint)
    • Line 27: warning: exported type Codec should have comment or be unexported (golint)
    • Line 29: warning: exported type Resolution should have comment or be unexported (golint)
    • Line 50: warning: exported var Resolutions should have comment or be unexported (golint)
    • Line 69: warning: exported method Format.GetBitrateForFPS should have comment or be unexported (golint)
    • Line 76: warning: exported function TargetFormats should have comment or be unexported (golint)
    • Line 165: warning: exported function DetectFPS should have comment or be unexported (golint)
    • Line 189: warning: exported function GetVideoStream should have comment or be unexported (golint)
    • workers/metrics.go
    • Line 10: warning: exported const StorageLocal should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported var TranscodingRunning should have comment or be unexported (golint)
    • Line 42: warning: exported function RegisterMetrics should have comment or be unexported (golint)
    • video/queries.go
    • Line 32: warning: exported type AddParams should have comment or be unexported (golint)
    • Line 42: warning: exported method Queries.Add should have comment or be unexported (golint)
    • Line 58: warning: exported method Queries.Get should have comment or be unexported (golint)
    • Line 77: warning: exported method Queries.ListLocal should have comment or be unexported (golint)
    • Line 99: warning: exported method Queries.ListLocalOnly should have comment or be unexported (golint)
    • Line 121: warning: exported method Queries.ListRemoteOnly should have comment or be unexported (golint)
    • Line 143: warning: exported method Queries.UpdateRemotePath should have comment or be unexported (golint)
    • Line 168: warning: exported method Queries.UpdatePath should have comment or be unexported (golint)
    • Line 193: warning: exported method Queries.Delete should have comment or be unexported (golint)
    • video/workers.go
    • Line 48: warning: exported function SpawnS3uploader should have comment or be unexported (golint)
    • internal/metrics/metrics.go
    • Line 10: warning: exported const StorageLocal should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported var DownloadedSizeMB should have comment or be unexported (golint)
    • Line 49: warning: exported function RegisterMetrics should have comment or be unexported (golint)
    • manager/request.go
    • Line 29: warning: exported type WriteCounter should have comment or be unexported (golint)
    • Line 36: warning: exported type TranscodingRequest should have comment or be unexported (golint)
    • Line 59: warning: exported function ResolveRequest should have comment or be unexported (golint)
    • Line 90: warning: exported function Resolve should have comment or be unexported (golint)
    • Line 145: warning: exported method TranscodingRequest.Release should have comment or be unexported (golint)
    • Line 145: warning: receiver name r should be consistent with previous receiver name c for TranscodingRequest (golint)
    • Line 150: warning: exported method TranscodingRequest.Reject should have comment or be unexported (golint)
    • Line 150: warning: receiver name r should be consistent with previous receiver name c for TranscodingRequest (golint)
    • Line 155: warning: exported method TranscodingRequest.Complete should have comment or be unexported (golint)
    • Line 155: warning: receiver name r should be consistent with previous receiver name c for TranscodingRequest (golint)
    • Line 164: warning: exported function SetBlobServer should have comment or be unexported (golint)
    • manager/manager.go
    • Line 29: warning: exported function LoadConfiguredChannels should have comment or be unexported (golint)
    • Line 44: warning: exported type VideoManager should have comment or be unexported (golint)
    • Line 111: warning: exported method VideoManager.Pool should have comment or be unexported (golint)
    • Line 115: warning: exported method VideoManager.RequestStatus should have comment or be unexported (golint)
    • Line 124: warning: exported method VideoManager.Library should have comment or be unexported (golint)
    • storage/testing.go
    • Line 4: warning: exported const OpDelete should have comment (or a comment on this block) or be unexported (golint)
    • Line 9: warning: exported type StorageOp should have comment or be unexported (golint)
    • Line 14: warning: exported type DummyStorage should have comment or be unexported (golint)
    • Line 19: warning: exported function Dummy should have comment or be unexported (golint)
    • Line 23: warning: exported method DummyStorage.Delete should have comment or be unexported (golint)
    • Line 28: warning: exported method DummyStorage.GetFragment should have comment or be unexported (golint)
    • Line 33: warning: exported method DummyStorage.Put should have comment or be unexported (golint)
    • video/size.go
    • Line 7: warning: exported function StringToSize should have comment or be unexported (golint)
    • manager/http.go
    • Line 30: warning: exported type HttpAPIConfiguration should have comment or be unexported (golint)
    • Line 37: warning: exported function ConfigureHttpAPI should have comment or be unexported (golint)
    • Line 44: warning: exported method HttpAPIConfiguration.Debug should have comment or be unexported (golint)
    • Line 49: warning: exported method HttpAPIConfiguration.Addr should have comment or be unexported (golint)
    • Line 54: warning: exported method HttpAPIConfiguration.VideoPath should have comment or be unexported (golint)
    • Line 59: warning: exported method HttpAPIConfiguration.VideoManager should have comment or be unexported (golint)
    • Line 64: warning: exported function NewHttpAPI should have comment or be unexported (golint)
    • Line 202: warning: exported method HttpAPI.Addr should have comment or be unexported (golint)
    • Line 202: warning: receiver name s should be consistent with previous receiver name h for HttpAPI (golint)
    • Line 206: warning: exported method HttpAPI.URL should have comment or be unexported (golint)
    • Line 206: warning: receiver name s should be consistent with previous receiver name h for HttpAPI (golint)
    • Line 210: warning: exported method HttpAPI.Start should have comment or be unexported (golint)
    • Line 210: warning: receiver name s should be consistent with previous receiver name h for HttpAPI (golint)
    • Line 215: warning: exported method HttpAPI.Shutdown should have comment or be unexported (golint)
    • Line 215: warning: receiver name s should be consistent with previous receiver name h for HttpAPI (golint)
    • storage/stream.go
    • Line 17: warning: exported const MasterPlaylistName should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported type RemoteStream should have comment or be unexported (golint)
    • Line 30: warning: exported type LocalStream should have comment or be unexported (golint)
    • Line 37: warning: exported type StreamFileLoader should have comment or be unexported (golint)
    • Line 38: warning: exported type StreamFileProcessor should have comment or be unexported (golint)
    • Line 44: warning: exported method LocalStream.FullPath should have comment or be unexported (golint)
    • Line 48: warning: exported method LocalStream.LastPath should have comment or be unexported (golint)
    • Line 52: warning: exported method LocalStream.Checksum should have comment or be unexported (golint)
    • Line 56: warning: exported method LocalStream.Size should have comment or be unexported (golint)
    • Line 60: warning: exported method LocalStream.ReadMeta should have comment or be unexported (golint)
    • Line 153: warning: exported method RemoteStream.URL should have comment or be unexported (golint)
    • pkg/config/config.go
    • Line 12: warning: exported function Read should have comment or be unexported (golint)
    • Line 20: warning: exported function ProjectRoot should have comment or be unexported (golint)
    • video/video.go
    • Line 11: warning: exported type Config should have comment or be unexported (golint)
    • Line 20: warning: exported function Configure should have comment or be unexported (golint)
    • Line 36: warning: comment on exported method Config.RemoteStorage should be of the form "RemoteStorage ..." (golint)
    • Line 42: warning: exported method Config.MaxLocalSize should have comment or be unexported (golint)
    • Line 47: warning: exported method Config.MaxRemoteSize should have comment or be unexported (golint)
    • Line 52: warning: exported type VideoLibrary should have comment or be unexported (golint)
    • Line 64: warning: exported function NewLibrary should have comment or be unexported (golint)
    • Line 72: warning: exported method Library.New should have comment or be unexported (golint)
    • Line 81: warning: exported method Library.Get should have comment or be unexported (golint)
    • Line 85: warning: exported method Library.Furlough should have comment or be unexported (golint)
    • Line 106: warning: exported method Library.Retire should have comment or be unexported (golint)
    • Line 127: warning: exported method Library.ListLocalOnly should have comment or be unexported (golint)
    • Line 133: warning: exported method Library.ListLocal should have comment or be unexported (golint)
    • Line 139: warning: exported method Library.ListRemoteOnly should have comment or be unexported (golint)
    • Line 145: warning: exported method Library.UpdateRemotePath should have comment or be unexported (golint)
    • pkg/dispatcher/metrics.go
    • Line 21: warning: exported var DispatcherQueueLength should have comment or be unexported (golint)
    • Line 41: warning: exported function RegisterMetrics should have comment or be unexported (golint)
    • pkg/timer/timer.go
    • Line 8: warning: exported type Timer should have comment or be unexported (golint)
    • Line 13: warning: exported function Start should have comment or be unexported (golint)
    • Line 17: warning: exported method Timer.Stop should have comment or be unexported (golint)
    • Line 24: warning: exported method Timer.Duration should have comment or be unexported (golint)
    • Line 31: warning: exported method Timer.DurationInt 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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!