Preparing report...

Report for github.com/oragono/oragono

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


gocyclo78%

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.

    • oragono/irc/client.go
    • Line 1194: warning: cyclomatic complexity 41 of function (*Client).destroy() is high (> 15) (gocyclo)
    • Line 627: warning: cyclomatic complexity 25 of function (*Client).run() is high (> 15) (gocyclo)
    • oragono/irc/handlers.go
    • Line 2109: warning: cyclomatic complexity 43 of function dispatchMessageToTarget() is high (> 15) (gocyclo)
    • Line 533: warning: cyclomatic complexity 40 of function chathistoryHandler() is high (> 15) (gocyclo)
    • Line 3211: warning: cyclomatic complexity 31 of function whoHandler() is high (> 15) (gocyclo)
    • Line 424: warning: cyclomatic complexity 29 of function capHandler() is high (> 15) (gocyclo)
    • Line 1547: warning: cyclomatic complexity 28 of function listHandler() is high (> 15) (gocyclo)
    • Line 1351: warning: cyclomatic complexity 28 of function klineHandler() is high (> 15) (gocyclo)
    • Line 809: warning: cyclomatic complexity 27 of function dlineHandler() is high (> 15) (gocyclo)
    • Line 3116: warning: cyclomatic complexity 26 of function (*Client).rplWhoReply() is high (> 15) (gocyclo)
    • Line 2693: warning: cyclomatic complexity 21 of function renameHandler() is high (> 15) (gocyclo)
    • Line 2490: warning: cyclomatic complexity 21 of function registerHandler() is high (> 15) (gocyclo)
    • Line 3037: warning: cyclomatic complexity 17 of function webircHandler() is high (> 15) (gocyclo)
    • Line 2047: warning: cyclomatic complexity 17 of function messageHandler() is high (> 15) (gocyclo)
    • Line 143: warning: cyclomatic complexity 16 of function authenticateHandler() is high (> 15) (gocyclo)
    • oragono/irc/nickserv.go
    • Line 477: warning: cyclomatic complexity 37 of function nsSetHandler() is high (> 15) (gocyclo)
    • Line 1215: warning: cyclomatic complexity 32 of function nsCertHandler() is high (> 15) (gocyclo)
    • Line 384: warning: cyclomatic complexity 27 of function displaySetting() is high (> 15) (gocyclo)
    • Line 1014: warning: cyclomatic complexity 19 of function nsPasswdHandler() is high (> 15) (gocyclo)
    • Line 835: warning: cyclomatic complexity 16 of function nsRegisterHandler() is high (> 15) (gocyclo)
    • oragono/irc/accounts.go
    • Line 943: warning: cyclomatic complexity 31 of function (*AccountManager).SetNickReserved() is high (> 15) (gocyclo)
    • Line 341: warning: cyclomatic complexity 30 of function (*AccountManager).Register() is high (> 15) (gocyclo)
    • Line 784: warning: cyclomatic complexity 28 of function (*AccountManager).Verify() is high (> 15) (gocyclo)
    • Line 1478: warning: cyclomatic complexity 17 of function (*AccountManager).Unregister() is high (> 15) (gocyclo)
    • Line 1630: warning: cyclomatic complexity 16 of function (*AccountManager).AuthenticateByCertificate() is high (> 15) (gocyclo)
    • oragono/irc/chanserv.go
    • Line 203: warning: cyclomatic complexity 20 of function csAmodeHandler() is high (> 15) (gocyclo)
    • Line 877: warning: cyclomatic complexity 20 of function csHowToBanHandler() is high (> 15) (gocyclo)
    • Line 529: warning: cyclomatic complexity 17 of function csTransferHandler() is high (> 15) (gocyclo)
    • oragono/irc/config.go
    • Line 1090: warning: cyclomatic complexity 106 of function LoadConfig() is high (> 15) (gocyclo)
    • Line 1025: warning: cyclomatic complexity 17 of function mungeFromEnvironment() is high (> 15) (gocyclo)
    • oragono/irc/server.go
    • Line 547: warning: cyclomatic complexity 50 of function (*Server).applyConfig() is high (> 15) (gocyclo)
    • Line 868: warning: cyclomatic complexity 25 of function (*Server).GetHistorySequence() is high (> 15) (gocyclo)
    • Line 160: warning: cyclomatic complexity 19 of function (*Server).checkBans() is high (> 15) (gocyclo)
    • Line 273: warning: cyclomatic complexity 18 of function (*Server).tryRegister() is high (> 15) (gocyclo)
    • Line 465: warning: cyclomatic complexity 17 of function (*Client).getWhoisOf() is high (> 15) (gocyclo)
    • oragono/irc/channel.go
    • Line 732: warning: cyclomatic complexity 43 of function (*Channel).Join() is high (> 15) (gocyclo)
    • Line 1038: warning: cyclomatic complexity 30 of function (*Channel).replayHistoryItems() is high (> 15) (gocyclo)
    • Line 1272: warning: cyclomatic complexity 22 of function (*Channel).SendSplitMessage() is high (> 15) (gocyclo)
    • Line 440: warning: cyclomatic complexity 20 of function (*Channel).Names() is high (> 15) (gocyclo)
    • oragono/irc/modes.go
    • Line 159: warning: cyclomatic complexity 54 of function (*Channel).ApplyChannelModeChanges() is high (> 15) (gocyclo)
    • Line 33: warning: cyclomatic complexity 29 of function ApplyUserModeChanges() is high (> 15) (gocyclo)
    • Line 367: warning: cyclomatic complexity 20 of function (*Channel).ProcessAccountToUmodeChange() is high (> 15) (gocyclo)

golint69%

Golint is a linter for Go source code.

    • oragono/irc/utils/crypto.go
    • Line 22: warning: comment on exported var B32Encoder should be of the form "B32Encoder ..." (golint)
    • Line 25: warning: exported var ErrInvalidCertfp should have comment or be unexported (golint)
    • Line 33: warning: exported const SecretTokenLength should have comment (or a comment on this block) or be unexported (golint)
    • Line 36: warning: comment on exported function GenerateSecretToken should be of the form "GenerateSecretToken ..." (golint)
    • Line 45: warning: comment on exported function MungeSecretToken should be of the form "MungeSecretToken ..." (golint)
    • Line 68: warning: comment on exported function SecretTokensMatch should be of the form "SecretTokensMatch ..." (golint)
    • Line 79: warning: comment on exported function GenerateSecretKey should be of the form "GenerateSecretKey ..." (golint)
    • Line 86: warning: comment on exported function NormalizeCertfp should be of the form "NormalizeCertfp ..." (golint)
    • Line 96: warning: exported function GetCertFP should have comment or be unexported (golint)
    • oragono/irc/history/targets.go
    • Line 11: warning: exported type TargetListing should have comment or be unexported (golint)
    • Line 16: warning: comment on exported function MergeTargets should be of the form "MergeTargets ..." (golint)
    • Line 72: warning: exported function ReverseCorrespondents should have comment or be unexported (golint)
    • Line 79: warning: exported function SortCorrespondents should have comment or be unexported (golint)
    • oragono/irc/jwt/extjwt.go
    • Line 20: warning: exported var ErrNoKeys should have comment or be unexported (golint)
    • Line 23: warning: exported type MapClaims should have comment or be unexported (golint)
    • Line 25: warning: exported type JwtServiceConfig should have comment or be unexported (golint)
    • Line 33: warning: exported method JwtServiceConfig.Postprocess should have comment or be unexported (golint)
    • Line 61: warning: exported method JwtServiceConfig.Enabled should have comment or be unexported (golint)
    • Line 65: warning: exported method JwtServiceConfig.Sign should have comment or be unexported (golint)
    • oragono/irc/flatip/flatip.go
    • Line 16: warning: exported var IPv6loopback should have comment or be unexported (golint)
    • Line 96: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 101: warning: exported method IP.IsUnspecified should have comment or be unexported (golint)
    • Line 158: warning: comment on exported function FromNetIPNet should be of the form "FromNetIPNet ..." (golint)
    • Line 199: warning: receiver name ipnet should be consistent with previous receiver name cidr for IPNet (golint)
    • oragono/irc/mysql/history.go
    • Line 19: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 26: warning: exported var ErrDisallowed should have comment or be unexported (golint)
    • Line 30: warning: comment on exported const MaxTargetLength should be of the form "MaxTargetLength ..." (golint)
    • Line 47: warning: exported type MySQL should have comment or be unexported (golint)
    • Line 65: warning: exported method MySQL.Initialize should have comment or be unexported (golint)
    • Line 71: warning: exported method MySQL.SetConfig should have comment or be unexported (golint)
    • Line 90: warning: exported method MySQL.Open should have comment or be unexported (golint)
    • Line 90: warning: receiver name m should be consistent with previous receiver name mysql for MySQL (golint)
    • Line 572: warning: exported method MySQL.Forget should have comment or be unexported (golint)
    • Line 592: warning: exported method MySQL.AddChannelItem should have comment or be unexported (golint)
    • Line 672: warning: exported method MySQL.AddDirectMessage should have comment or be unexported (golint)
    • Line 725: warning: comment on exported method MySQL.DeleteMsgid should be of the form "DeleteMsgid ..." (golint)
    • Line 753: warning: exported method MySQL.Export should have comment or be unexported (golint)
    • Line 973: warning: exported method MySQL.ListChannels should have comment or be unexported (golint)
    • Line 1021: warning: exported method MySQL.Close should have comment or be unexported (golint)
    • Line 1065: warning: receiver name seq should be consistent with previous receiver name s for mySQLHistorySequence (golint)
    • Line 1078: warning: receiver name seq should be consistent with previous receiver name s for mySQLHistorySequence (golint)
    • Line 1082: warning: receiver name seq should be consistent with previous receiver name s for mySQLHistorySequence (golint)
    • Line 1086: warning: exported method MySQL.MakeSequence should have comment or be unexported (golint)
    • oragono/irc/utils/sync.go
    • Line 18: warning: exported method Once.Do should have comment or be unexported (golint)
    • Line 33: warning: exported method Once.Done should have comment or be unexported (golint)
    • oragono/irc/caps/constants.go
    • Line 16: warning: error var NoSuchCap should have name of the form ErrFoo (golint)
    • Line 16: warning: exported var NoSuchCap should have comment or be unexported (golint)
    • Line 24: warning: exported function NameToCapability should have comment or be unexported (golint)
    • Line 58: warning: comment on exported const MultilineBatchType should be of the form "MultilineBatchType ..." (golint)
    • Line 60: warning: exported const MultilineConcatTag should have comment (or a comment on this block) or be unexported (golint)
    • Line 61: warning: comment on exported const RelaymsgTagName should be of the form "RelaymsgTagName ..." (golint)
    • Line 63: warning: comment on exported const BotTagName should be of the form "BotTagName ..." (golint)
    • oragono/irc/cloaks/cloaks.go
    • Line 14: warning: exported type CloakConfig should have comment or be unexported (golint)
    • Line 29: warning: exported method CloakConfig.Initialize should have comment or be unexported (golint)
    • Line 48: warning: exported method CloakConfig.SetSecret should have comment or be unexported (golint)
    • Line 52: warning: comment on exported method CloakConfig.ComputeCloak should be of the form "ComputeCloak ..." (golint)
    • Line 55: warning: receiver name config should be consistent with previous receiver name cloakConfig for CloakConfig (golint)
    • Line 72: warning: receiver name config should be consistent with previous receiver name cloakConfig for CloakConfig (golint)
    • Line 83: warning: exported method CloakConfig.ComputeAccountCloak should have comment or be unexported (golint)
    • Line 83: warning: receiver name config should be consistent with previous receiver name cloakConfig for CloakConfig (golint)
    • oragono/irc/utils/net.go
    • Line 16: warning: exported var IPv4LoopbackAddress should have comment or be unexported (golint)
    • Line 67: warning: comment on exported function IPInNets should be of the form "IPInNets ..." (golint)
    • Line 104: warning: comment on exported function NetToNormalizedString should be of the form "NetToNormalizedString ..." (golint)
    • Line 116: warning: comment on exported function NormalizedNetFromString should be of the form "NormalizedNetFromString ..." (golint)
    • Line 134: warning: comment on exported function ParseNetList should be of the form "ParseNetList ..." (golint)
    • Line 149: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 156: warning: comment on exported function HandleXForwardedFor should be of the form "HandleXForwardedFor ..." (golint)
    • oragono/irc/migrations/passwords.go
    • Line 24: warning: exported var ErrHashInvalid should have comment or be unexported (golint)
    • Line 32: warning: exported type PassphraseCheck should have comment or be unexported (golint)
    • Line 34: warning: exported function CheckAthemePassphrase should have comment or be unexported (golint)
    • Line 162: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 185: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 213: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 230: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 235: warning: exported function CheckAnopePassphrase should have comment or be unexported (golint)
    • Line 249: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 261: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • oragono/irc/email/dkim.go
    • Line 13: warning: exported var ErrMissingFields should have comment or be unexported (golint)
    • Line 16: warning: exported type DKIMConfig should have comment or be unexported (golint)
    • Line 23: warning: exported method DKIMConfig.Postprocess should have comment or be unexported (golint)
    • Line 47: warning: exported function DKIMSign should have comment or be unexported (golint)
    • oragono/irc/sno/utils.go
    • Line 10: warning: exported function IsValidMask should have comment or be unexported (golint)
    • Line 28: warning: exported method Masks.Contains should have comment or be unexported (golint)
    • Line 37: warning: comment on exported function EvaluateSnomaskChanges should be of the form "EvaluateSnomaskChanges ..." (golint)
    • oragono/irc/modes/modes.go
    • Line 60: warning: exported method ModeChanges.Strings should have comment or be unexported (golint)
    • Line 136: warning: exported var ChannelFounder should have comment or be unexported (golint)
    • Line 342: warning: comment on exported function NewModeSet should be of the form "NewModeSet ..." (golint)
    • Line 348: warning: comment on exported method ModeSet.HasMode should be of the form "HasMode ..." (golint)
    • Line 357: warning: comment on exported method ModeSet.SetMode should be of the form "SetMode ..." (golint)
    • Line 362: warning: comment on exported method ModeSet.Copy should be of the form "Copy ..." (golint)
    • Line 367: warning: comment on exported method ModeSet.AllModes should be of the form "AllModes ..." (golint)
    • Line 427: warning: exported type ByCodepoint should have comment or be unexported (golint)
    • Line 433: warning: exported function RplMyInfo should have comment or be unexported (golint)
    • Line 453: warning: exported function ChanmodesToken should have comment or be unexported (golint)
    • oragono/irc/flatip/flatip_test.go
    • Line 41: warning: don't use underscores in Go names; var localhost_v4 should be localhostV4 (golint)
    • Line 42: warning: don't use underscores in Go names; var localhost_v4_again should be localhostV4Again (golint)
    • Line 44: warning: don't use underscores in Go names; var loopback_v6 should be loopbackV6 (golint)
    • Line 45: warning: don't use underscores in Go names; var google_v6 should be googleV6 (golint)
    • Line 60: warning: don't use underscores in Go names; var flatip_ should be flatip (golint)
    • oragono/irc/history/history.go
    • Line 12: warning: exported type ItemType should have comment or be unexported (golint)
    • Line 16: warning: exported const Privmsg should have comment (or a comment on this block) or be unexported (golint)
    • Line 56: warning: exported type Predicate should have comment or be unexported (golint)
    • Line 58: warning: exported function Reverse should have comment or be unexported (golint)
    • Line 80: warning: exported function NewHistoryBuffer should have comment or be unexported (golint)
    • Line 86: warning: exported method Buffer.Initialize should have comment or be unexported (golint)
    • Line 108: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 143: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 158: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 205: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 237: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 284: warning: exported method Buffer.MakeSequence should have comment or be unexported (golint)
    • Line 284: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 320: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 352: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 379: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 386: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 393: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 402: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 411: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 438: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • Line 465: warning: receiver name list should be consistent with previous receiver name hist for Buffer (golint)
    • oragono/irc/utils/glob.go
    • Line 38: warning: exported function CompileGlob should have comment or be unexported (golint)
    • Line 49: warning: comment on exported function CompileMasks should be of the form "CompileMasks ..." (golint)
    • oragono/irc/utils/args.go
    • Line 14: warning: exported const IRCv3TimestampFormat should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported var ErrInvalidParams should have comment or be unexported (golint)
    • Line 21: warning: exported function StringToBool should have comment or be unexported (golint)
    • Line 33: warning: comment on exported function SafeErrorParam should be of the form "SafeErrorParam ..." (golint)
    • Line 42: warning: exported type IncompatibleSchemaError should have comment or be unexported (golint)
    • Line 51: warning: exported function NanoToTimestamp should have comment or be unexported (golint)
    • Line 55: warning: exported function BoolDefaultTrue should have comment or be unexported (golint)
    • oragono/irc/utils/text.go
    • Line 11: warning: exported function IsRestrictedCTCPMessage should have comment or be unexported (golint)
    • Line 17: warning: exported type MessagePair should have comment or be unexported (golint)
    • Line 35: warning: exported function MakeMessage should have comment or be unexported (golint)
    • Line 43: warning: exported method SplitMessage.Append should have comment or be unexported (golint)
    • Line 53: warning: exported method SplitMessage.SetTime should have comment or be unexported (golint)
    • Line 58: warning: exported method SplitMessage.LenLines should have comment or be unexported (golint)
    • Line 62: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 69: warning: exported method SplitMessage.ValidMultiline should have comment or be unexported (golint)
    • Line 79: warning: exported method SplitMessage.IsRestrictedCTCPMessage should have comment or be unexported (golint)
    • Line 91: warning: exported method SplitMessage.Is512 should have comment or be unexported (golint)
    • Line 104: warning: exported method TokenLineBuilder.Initialize should have comment or be unexported (golint)
    • oragono/irc/connection_limits/limiter.go
    • Line 4: warning: don't use an underscore in package name (golint)
    • Line 18: warning: exported var ErrLimitExceeded should have comment or be unexported (golint)
    • Line 22: warning: exported type CustomLimitConfig should have comment or be unexported (golint)
    • Line 61: warning: exported type LimiterConfig should have comment or be unexported (golint)
    • Line 68: warning: exported method LimiterConfig.UnmarshalYAML should have comment or be unexported (golint)
    • Line 214: warning: exported type LimiterStatus should have comment or be unexported (golint)
    • Line 225: warning: exported method Limiter.Status should have comment or be unexported (golint)
    • oragono/irc/passwd/bcrypt.go
    • Line 10: warning: exported const MinCost should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported function GenerateFromPassword should have comment or be unexported (golint)
    • Line 31: warning: exported function CompareHashAndPassword should have comment or be unexported (golint)
    • oragono/irc/email/email.go
    • Line 17: warning: exported var ErrBlacklistedAddress should have comment or be unexported (golint)
    • Line 22: warning: exported type MTAConfig should have comment or be unexported (golint)
    • Line 29: warning: exported type MailtoConfig should have comment or be unexported (golint)
    • Line 45: warning: exported method MailtoConfig.Postprocess should have comment or be unexported (golint)
    • Line 91: warning: exported function SendMail should have comment or be unexported (golint)
    • oragono/irc/utils/proxy.go
    • Line 40: warning: exported var ErrBadProxyLine should have comment or be unexported (golint)
    • Line 206: warning: comment on exported type WrappedConn should be of the form "WrappedConn ..." (with optional leading article) (golint)
    • Line 228: warning: exported function NewReloadableListener should have comment or be unexported (golint)
    • Line 235: warning: exported method ReloadableListener.Reload should have comment or be unexported (golint)
    • Line 241: warning: exported method ReloadableListener.Accept should have comment or be unexported (golint)
    • Line 286: warning: exported method ReloadableListener.Close should have comment or be unexported (golint)
    • Line 294: warning: exported method ReloadableListener.Addr should have comment or be unexported (golint)
    • oragono/irc/utils/types.go
    • Line 8: warning: exported type StringSet should have comment or be unexported (golint)
    • Line 10: warning: exported method StringSet.Has should have comment or be unexported (golint)
    • Line 15: warning: exported method StringSet.Add should have comment or be unexported (golint)
    • oragono/irc/connection_limits/tor.go
    • Line 4: warning: don't use an underscore in package name (golint)
    • Line 22: warning: exported method TorLimiter.Configure should have comment or be unexported (golint)
    • Line 30: warning: exported method TorLimiter.AddClient should have comment or be unexported (golint)
    • Line 45: warning: exported method TorLimiter.RemoveClient 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.


misspell96%

Misspell Finds commonly misspelled English words