Preparing report...

Report for github.com/pion/ion-sfu

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


golint51%

Golint is a linter for Go source code.

    • ion-sfu/pkg/sfu/sfu.go
    • Line 31: warning: exported type Candidates should have comment or be unexported (golint)
    • Line 45: warning: exported type WebRTCTimeoutsConfig should have comment or be unexported (golint)
    • Line 262: warning: exported method SFU.GetSession should have comment or be unexported (golint)
    • Line 270: warning: exported method SFU.NewDatachannel should have comment or be unexported (golint)
    • ion-sfu/pkg/sfu/subscriber.go
    • Line 14: warning: exported const APIChannelLabel should have comment or be unexported (golint)
    • Line 16: warning: exported type Subscriber should have comment or be unexported (golint)
    • Line 74: warning: exported method Subscriber.AddDatachannel should have comment or be unexported (golint)
    • Line 104: warning: exported method Subscriber.OnNegotiationNeeded should have comment or be unexported (golint)
    • Line 111: warning: exported method Subscriber.CreateOffer should have comment or be unexported (golint)
    • Line 139: warning: exported method Subscriber.AddDownTrack should have comment or be unexported (golint)
    • Line 150: warning: exported method Subscriber.RemoveDownTrack should have comment or be unexported (golint)
    • Line 169: warning: exported method Subscriber.AddDataChannel should have comment or be unexported (golint)
    • Line 205: warning: exported method Subscriber.RegisterDatachannel should have comment or be unexported (golint)
    • Line 209: warning: exported method Subscriber.GetDatachannel should have comment or be unexported (golint)
    • Line 213: warning: exported method Subscriber.GetDownTracks should have comment or be unexported (golint)
    • ion-sfu/pkg/buffer/bucket.go
    • Line 10: warning: exported type Bucket should have comment or be unexported (golint)
    • Line 19: warning: exported function NewBucket should have comment or be unexported (golint)
    • Line 26: warning: exported method Bucket.AddPacket should have comment or be unexported (golint)
    • Line 45: warning: exported method Bucket.GetPacket should have comment or be unexported (golint)
    • ion-sfu/cmd/signal/grpc/server/wrapped.go
    • Line 18: warning: exported type WrapperedServerOptions should have comment or be unexported (golint)
    • Line 31: warning: exported function DefaultWrapperedServerOptions should have comment or be unexported (golint)
    • Line 46: warning: exported type WrapperedGRPCWebServer should have comment or be unexported (golint)
    • Line 51: warning: exported function NewWrapperedGRPCWebServer should have comment or be unexported (golint)
    • Line 102: warning: exported method WrapperedGRPCWebServer.Serve should have comment or be unexported (golint)
    • ion-sfu/pkg/sfu/audioobserver.go
    • Line 14: warning: exported type AudioObserver should have comment or be unexported (golint)
    • Line 22: warning: exported function NewAudioObserver should have comment or be unexported (golint)
    • Line 77: warning: exported method AudioObserver.Calc should have comment or be unexported (golint)
    • ion-sfu/pkg/sfu/publisher.go
    • Line 16: warning: exported type Publisher should have comment or be unexported (golint)
    • Line 136: warning: exported method Publisher.Answer should have comment or be unexported (golint)
    • Line 183: warning: exported method Publisher.OnICEConnectionStateChange should have comment or be unexported (golint)
    • Line 187: warning: exported method Publisher.SignalingState should have comment or be unexported (golint)
    • Line 191: warning: exported method Publisher.PeerConnection should have comment or be unexported (golint)
    • ion-sfu/pkg/sfu/session.go
    • Line 28: warning: exported type SessionLocal should have comment or be unexported (golint)
    • Line 40: warning: exported const AudioLevelsMethod should have comment (or a comment on this block) or be unexported (golint)
    • Line 60: warning: exported method SessionLocal.AudioObserver should have comment or be unexported (golint)
    • Line 64: warning: exported method SessionLocal.GetDCMiddlewares should have comment or be unexported (golint)
    • Line 68: warning: exported method SessionLocal.GetDataChannelLabels should have comment or be unexported (golint)
    • Line 79: warning: exported method SessionLocal.AddPeer should have comment or be unexported (golint)
    • Line 99: warning: exported method SessionLocal.AddDatachannel should have comment or be unexported (golint)
    • Line 295: warning: exported method SessionLocal.GetDataChannels should have comment or be unexported (golint)
    • ion-sfu/pkg/sfu/turn.go
    • Line 27: warning: exported type TurnAuth should have comment or be unexported (golint)
    • Line 32: warning: comment on exported type TurnConfig should be of the form "TurnConfig ..." (with optional leading article) (golint)
    • Line 43: warning: exported function InitTurnServer should have comment or be unexported (golint)
    • ion-sfu/pkg/stats/stream.go
    • Line 56: warning: exported var Sessions should have comment or be unexported (golint)
    • Line 81: warning: exported function InitStats should have comment or be unexported (golint)
    • Line 122: warning: exported method Stream.SetCName should have comment or be unexported (golint)
    • Line 129: warning: exported method Stream.SetDriftInMillis should have comment or be unexported (golint)
    • Line 133: warning: exported method Stream.GetDriftInMillis should have comment or be unexported (golint)
    • Line 137: warning: exported method Stream.UpdateStats should have comment or be unexported (golint)
    • Line 157: warning: exported method Stream.CalcStats should have comment or be unexported (golint)
    • ion-sfu/pkg/relay/relay.go
    • Line 19: warning: exported type Provider should have comment or be unexported (golint)
    • Line 30: warning: exported type Signal should have comment or be unexported (golint)
    • Line 40: warning: exported type SignalMeta should have comment or be unexported (golint)
    • Line 46: warning: exported type Peer should have comment or be unexported (golint)
    • Line 62: warning: exported function New should have comment or be unexported (golint)
    • Line 70: warning: exported method Provider.SetSettingEngine should have comment or be unexported (golint)
    • Line 75: warning: exported method Provider.SetSignaler should have comment or be unexported (golint)
    • Line 79: warning: exported method Provider.OnRemoteStream should have comment or be unexported (golint)
    • Line 83: warning: exported method Provider.OnDatachannel should have comment or be unexported (golint)
    • Line 87: warning: exported method Provider.AddDataChannels should have comment or be unexported (golint)
    • Line 107: warning: exported method Provider.Send should have comment or be unexported (golint)
    • Line 126: warning: exported method Provider.Receive should have comment or be unexported (golint)
    • Line 216: warning: exported method Peer.WriteRTCP should have comment or be unexported (golint)
    • Line 221: warning: exported method Peer.LocalTracks should have comment or be unexported (golint)
    • Line 225: warning: exported method Peer.Close should have comment or be unexported (golint)
    • ion-sfu/pkg/buffer/factory.go
    • Line 11: warning: exported type Factory should have comment or be unexported (golint)
    • Line 20: warning: exported function NewBufferFactory should have comment or be unexported (golint)
    • Line 47: warning: exported method Factory.GetOrNew should have comment or be unexported (golint)
    • Line 79: warning: exported method Factory.GetBufferPair should have comment or be unexported (golint)
    • Line 85: warning: exported method Factory.GetBuffer should have comment or be unexported (golint)
    • Line 91: warning: exported method Factory.GetRTCPReader should have comment or be unexported (golint)
    • ion-sfu/pkg/sfu/downtrack.go
    • Line 20: warning: exported const SimpleDownTrack should have comment (or a comment on this block) or be unexported (golint)
    • Line 146: warning: exported method DownTrack.SetTransceiver should have comment or be unexported (golint)
    • Line 188: warning: exported method DownTrack.SetInitialLayers should have comment or be unexported (golint)
    • Line 193: warning: exported method DownTrack.SwitchSpatialLayer should have comment or be unexported (golint)
    • Line 215: warning: exported method DownTrack.UptrackLayersChange should have comment or be unexported (golint)
    • Line 249: warning: exported method DownTrack.SwitchTemporalLayer should have comment or be unexported (golint)
    • Line 271: warning: exported method DownTrack.OnBind should have comment or be unexported (golint)
    • Line 275: warning: exported method DownTrack.CreateSourceDescriptionChunks should have comment or be unexported (golint)
    • Line 296: warning: exported method DownTrack.CreateSenderReport should have comment or be unexported (golint)
    • Line 315: warning: exported method DownTrack.UpdateStats should have comment or be unexported (golint)
    • ion-sfu/pkg/sfu/peer.go
    • Line 27: warning: exported type Peer should have comment or be unexported (golint)
    • Line 52: warning: exported type ChannelAPIMessage should have comment or be unexported (golint)
    • Line 250: warning: exported method PeerLocal.SendDCMessage should have comment or be unexported (golint)
    • Line 287: warning: exported method PeerLocal.Subscriber should have comment or be unexported (golint)
    • Line 291: warning: exported method PeerLocal.Publisher should have comment or be unexported (golint)
    • Line 295: warning: exported method PeerLocal.Session should have comment or be unexported (golint)
    • ion-sfu/pkg/sfu/receiver.go
    • Line 77: warning: exported method WebRTCReceiver.StreamID should have comment or be unexported (golint)
    • Line 81: warning: exported method WebRTCReceiver.TrackID should have comment or be unexported (golint)
    • Line 85: warning: exported method WebRTCReceiver.SSRC should have comment or be unexported (golint)
    • Line 92: warning: exported method WebRTCReceiver.Codec should have comment or be unexported (golint)
    • Line 96: warning: exported method WebRTCReceiver.Kind should have comment or be unexported (golint)
    • Line 100: warning: exported method WebRTCReceiver.AddUpTrack should have comment or be unexported (golint)
    • Line 167: warning: exported method WebRTCReceiver.AddDownTrack should have comment or be unexported (golint)
    • Line 205: warning: exported method WebRTCReceiver.SwitchDownTrack should have comment or be unexported (golint)
    • Line 215: warning: exported method WebRTCReceiver.GetBitrate should have comment or be unexported (golint)
    • Line 225: warning: exported method WebRTCReceiver.GetMaxTemporalLayer should have comment or be unexported (golint)
    • Line 260: warning: exported method WebRTCReceiver.SendRTCP should have comment or be unexported (golint)
    • Line 273: warning: exported method WebRTCReceiver.SetRTCPCh should have comment or be unexported (golint)
    • Line 277: warning: exported method WebRTCReceiver.RetransmitPackets should have comment or be unexported (golint)
    • ion-sfu/cmd/signal/allrpc/server/server.go
    • Line 26: warning: exported type Server should have comment or be unexported (golint)
    • Line 101: warning: comment on exported method Server.ServePProf should be of the form "ServePProf ..." (golint)
    • Line 107: warning: comment on exported method Server.ServeMetrics should be of the form "ServeMetrics ..." (golint)
    • ion-sfu/pkg/buffer/buffer.go
    • Line 33: warning: exported type ExtPacket should have comment or be unexported (golint)
    • Line 99: warning: exported type Stats should have comment or be unexported (golint)
    • Line 108: warning: comment on exported type Options should be of the form "Options ..." (with optional leading article) (golint)
    • Line 125: warning: exported method Buffer.Bind should have comment or be unexported (golint)
    • Line 234: warning: exported method Buffer.ReadExtended should have comment or be unexported (golint)
    • Line 250: warning: exported method Buffer.Close should have comment or be unexported (golint)
    • Line 267: warning: exported method Buffer.OnClose should have comment or be unexported (golint)
    • Line 492: warning: exported method Buffer.SetSenderReportData should have comment or be unexported (golint)
    • Line 514: warning: exported method Buffer.GetPacket should have comment or be unexported (golint)
    • Line 528: warning: exported method Buffer.MaxTemporalLayer should have comment or be unexported (golint)
    • Line 532: warning: exported method Buffer.OnTransportWideCC should have comment or be unexported (golint)
    • Line 536: warning: exported method Buffer.OnFeedback should have comment or be unexported (golint)
    • Line 540: warning: exported method Buffer.OnAudioLevel should have comment or be unexported (golint)
    • ion-sfu/pkg/buffer/rtcpreader.go
    • Line 8: warning: exported type RTCPReader should have comment or be unexported (golint)
    • Line 15: warning: exported function NewRTCPReader should have comment or be unexported (golint)
    • Line 30: warning: exported method RTCPReader.OnClose should have comment or be unexported (golint)
    • Line 34: warning: exported method RTCPReader.Close should have comment or be unexported (golint)
    • Line 40: warning: exported method RTCPReader.OnPacket should have comment or be unexported (golint)
    • ion-sfu/cmd/signal/grpc/server/server.go
    • Line 16: warning: exported type SFUServer should have comment or be unexported (golint)
    • Line 22: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 26: warning: comment on exported method SFUServer.Signal should be of the form "Signal ..." (golint)
    • ion-sfu/pkg/sfu/datachannel.go
    • Line 19: warning: exported type ProcessArgs should have comment or be unexported (golint)
    • Line 25: warning: exported type Middlewares should have comment or be unexported (golint)
    • Line 27: warning: exported type MessageProcessor should have comment or be unexported (golint)
    • Line 31: warning: exported type ProcessFunc should have comment or be unexported (golint)
    • Line 52: warning: exported method ProcessFunc.Process should have comment or be unexported (golint)
    • Line 56: warning: exported method Middlewares.Process should have comment or be unexported (golint)
    • Line 60: warning: exported method Middlewares.ProcessFunc should have comment or be unexported (golint)

gocyclo73%

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.

    • ion-sfu/pkg/relay/relay.go
    • Line 254: warning: cyclomatic complexity 23 of function (*Peer).receive() is high (> 15) (gocyclo)
    • Line 390: warning: cyclomatic complexity 20 of function (*Peer).send() is high (> 15) (gocyclo)
    • ion-sfu/pkg/sfu/downtrack.go
    • Line 369: warning: cyclomatic complexity 29 of function (*DownTrack).writeSimulcastRTP() is high (> 15) (gocyclo)
    • Line 483: warning: cyclomatic complexity 23 of function (*DownTrack).handleRTCP() is high (> 15) (gocyclo)
    • Line 551: warning: cyclomatic complexity 17 of function (*DownTrack).handleLayerChange() is high (> 15) (gocyclo)

ineffassign91%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!