Preparing report...

Report for github.com/bjdgyc/anylink

A+    Excellent!    Found 45 issues across 62 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!


gocyclo96%

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.


golint27%

Golint is a linter for Go source code.

    • anylink/server/base/cfg.go
    • Line 13: warning: exported const LinkModeTUN should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported var Cfg should have comment or be unexported (golint)
    • Line 32: warning: exported type ServerConfig should have comment or be unexported (golint)
    • Line 130: warning: exported type SCfg should have comment or be unexported (golint)
    • Line 137: warning: exported function ServerCfg2Slice should have comment or be unexported (golint)
    • anylink/server/dbdata/db_orm.go
    • Line 5: warning: exported const PageSize should have comment or be unexported (golint)
    • Line 7: warning: exported function Save should have comment or be unexported (golint)
    • Line 11: warning: exported function Update should have comment or be unexported (golint)
    • Line 15: warning: exported function UpdateField should have comment or be unexported (golint)
    • Line 19: warning: exported function Del should have comment or be unexported (golint)
    • Line 23: warning: exported function Set should have comment or be unexported (golint)
    • Line 27: warning: exported function Get should have comment or be unexported (golint)
    • Line 31: warning: exported function CountAll should have comment or be unexported (golint)
    • Line 36: warning: exported function One should have comment or be unexported (golint)
    • Line 40: warning: exported function Find should have comment or be unexported (golint)
    • Line 44: warning: exported function All should have comment or be unexported (golint)
    • Line 49: warning: exported function Prefix should have comment or be unexported (golint)
    • anylink/server/sessdata/online.go
    • Line 13: warning: exported type Online should have comment or be unexported (golint)
    • Line 30: warning: exported type Onlines should have comment or be unexported (golint)
    • Line 44: warning: exported function OnlineSess should have comment or be unexported (golint)
    • anylink/server/pkg/proxyproto/protocol.go
    • Line 4: warning: package comment should be of the form "Package proxyproto ..." (golint)
    • Line 27: warning: exported var ErrInvalidUpstream should have comment or be unexported (golint)
    • Line 129: warning: exported method Conn.ReadFrom should have comment or be unexported (golint)
    • Line 136: warning: exported method Conn.WriteTo should have comment or be unexported (golint)
    • Line 149: warning: exported method Conn.Close should have comment or be unexported (golint)
    • Line 153: warning: exported method Conn.LocalAddr should have comment or be unexported (golint)
    • Line 176: warning: exported method Conn.SetDeadline should have comment or be unexported (golint)
    • Line 180: warning: exported method Conn.SetReadDeadline should have comment or be unexported (golint)
    • Line 184: warning: exported method Conn.SetWriteDeadline should have comment or be unexported (golint)
    • Line 214: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • anylink/server/sessdata/ip_pool.go
    • Line 14: warning: exported var IpPool should have comment or be unexported (golint)
    • Line 61: warning: comment on exported function AcquireIp should be of the form "AcquireIp ..." (golint)
    • Line 82: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 155: warning: comment on exported function ReleaseIp should be of the form "ReleaseIp ..." (golint)
    • anylink/server/admin/api_user.go
    • Line 21: warning: exported function UserList should have comment or be unexported (golint)
    • Line 60: warning: exported function UserDetail should have comment or be unexported (golint)
    • Line 79: warning: exported function UserSet should have comment or be unexported (golint)
    • Line 113: warning: exported function UserDel should have comment or be unexported (golint)
    • Line 132: warning: exported function UserOtpQr should have comment or be unexported (golint)
    • Line 163: warning: comment on exported function UserOnline should be of the form "UserOnline ..." (golint)
    • Line 176: warning: exported function UserOffline should have comment or be unexported (golint)
    • Line 183: warning: exported function UserReline should have comment or be unexported (golint)
    • anylink/server/admin/resp.go
    • Line 12: warning: exported type Resp should have comment or be unexported (golint)
    • Line 54: warning: exported function RespSucess should have comment or be unexported (golint)
    • Line 58: warning: exported function RespError should have comment or be unexported (golint)
    • Line 62: warning: exported function RespData should have comment or be unexported (golint)
    • anylink/server/handler/link_tap.go
    • Line 51: warning: comment on exported function LinkTap should be of the form "LinkTap ..." (golint)
    • Line 110: warning: don't use underscores in Go names; var ip_src should be ipSrc (golint)
    • Line 120: warning: don't use underscores in Go names; var ip_dst should be ipDst (golint)
    • Line 187: warning: don't use underscores in Go names; var ip_dst should be ipDst (golint)
    • anylink/server/admin/api_group.go
    • Line 12: warning: exported function GroupList should have comment or be unexported (golint)
    • Line 40: warning: exported function GroupNames should have comment or be unexported (golint)
    • Line 50: warning: exported function GroupDetail should have comment or be unexported (golint)
    • Line 69: warning: exported function GroupSet should have comment or be unexported (golint)
    • Line 92: warning: exported function GroupDel should have comment or be unexported (golint)
    • anylink/server/pkg/utils/util.go
    • Line 13: warning: exported function InArrStr should have comment or be unexported (golint)
    • Line 23: warning: exported const KB should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported function HumanByte should have comment or be unexported (golint)
    • Line 64: warning: exported function RandomRunes should have comment or be unexported (golint)
    • anylink/server/dbdata/setting.go
    • Line 8: warning: exported const SettingBucket should have comment (or a comment on this block) or be unexported (golint)
    • Line 12: warning: exported function StructName should have comment or be unexported (golint)
    • Line 23: warning: exported function SettingSet should have comment or be unexported (golint)
    • Line 29: warning: exported function SettingGet should have comment or be unexported (golint)
    • Line 35: warning: exported type SettingSmtp should have comment or be unexported (golint)
    • Line 44: warning: exported type SettingOther should have comment or be unexported (golint)
    • anylink/server/handler/link_auth.go
    • Line 17: warning: exported function LinkAuth should have comment or be unexported (golint)
    • Line 99: warning: don't use underscores in Go names; const tpl_request should be tplRequest (golint)
    • Line 100: warning: don't use underscores in Go names; const tpl_complete should be tplComplete (golint)
    • Line 118: warning: comment on exported type RequestData should be of the form "RequestData ..." (with optional leading article) (golint)
    • Line 130: warning: don't use underscores in Go names; var auth_request should be authRequest (golint)
    • Line 160: warning: don't use underscores in Go names; var auth_complete should be authComplete (golint)
    • anylink/server/admin/api_set.go
    • Line 20: warning: exported function SetHome should have comment or be unexported (golint)
    • Line 35: warning: exported function SetSystem should have comment or be unexported (golint)
    • Line 85: warning: exported function SetSoft should have comment or be unexported (golint)
    • anylink/server/base/log.go
    • Line 80: warning: comment on exported function GetBaseLog should be of the form "GetBaseLog ..." (golint)
    • Line 107: warning: exported function Debug should have comment or be unexported (golint)
    • Line 115: warning: exported function Info should have comment or be unexported (golint)
    • Line 123: warning: exported function Warn should have comment or be unexported (golint)
    • Line 131: warning: exported function Error should have comment or be unexported (golint)
    • Line 139: warning: exported function Fatal should have comment or be unexported (golint)
    • anylink/server/dbdata/user.go
    • Line 13: warning: exported type User should have comment or be unexported (golint)
    • Line 29: warning: exported function SetUser should have comment or be unexported (golint)
    • Line 65: warning: comment on exported function CheckUser should be of the form "CheckUser ..." (golint)
    • anylink/server/handler/payload.go
    • Line 66: warning: don't use underscores in Go names; var ip_dst should be ipDst (golint)
    • Line 67: warning: don't use underscores in Go names; var ip_port should be ipPort (golint)
    • Line 83: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • anylink/server/admin/common.go
    • Line 15: warning: exported function SetJwtData should have comment or be unexported (golint)
    • Line 27: warning: exported function GetJwtData should have comment or be unexported (golint)
    • Line 46: warning: exported function SendMail should have comment or be unexported (golint)
    • anylink/server/admin/server.go
    • Line 1: warning: package comment should be of the form "Package admin ..." (golint)
    • Line 12: warning: comment on exported function StartAdmin should be of the form "StartAdmin ..." (golint)
    • anylink/server/pkg/utils/password_hash.go
    • Line 11: warning: exported function PasswordHash should have comment or be unexported (golint)
    • Line 16: warning: exported function PasswordVerify should have comment or be unexported (golint)
    • Line 28: warning: exported function RandSecret should have comment or be unexported (golint)
    • anylink/server/base/start.go
    • Line 3: warning: exported function Start should have comment or be unexported (golint)
    • Line 9: warning: exported function Test should have comment or be unexported (golint)
    • anylink/server/sessdata/limit_rate.go
    • Line 9: warning: exported type LimitRater should have comment or be unexported (golint)
    • Line 13: warning: comment on exported function NewLimitRater should be of the form "NewLimitRater ..." (golint)
    • Line 20: warning: comment on exported method LimitRater.Wait should be of the form "Wait ..." (golint)
    • anylink/server/sessdata/protocol.go
    • Line 3: warning: exported type LType should have comment or be unexported (golint)
    • Line 6: warning: exported const LTypeEthernet should have comment (or a comment on this block) or be unexported (golint)
    • Line 10: warning: exported type Payload should have comment or be unexported (golint)
    • anylink/server/sessdata/session.go
    • Line 24: warning: comment on exported type ConnSession should be of the form "ConnSession ..." (with optional leading article) (golint)
    • Line 50: warning: exported type Session should have comment or be unexported (golint)
    • Line 98: warning: exported function GenToken should have comment or be unexported (golint)
    • Line 105: warning: exported function NewSession should have comment or be unexported (golint)
    • Line 129: warning: exported method Session.NewConn should have comment or be unexported (golint)
    • Line 191: warning: exported method ConnSession.Close should have comment or be unexported (golint)
    • Line 207: warning: exported const BandwidthPeriodSec should have comment or be unexported (golint)
    • Line 232: warning: exported const MaxMtu should have comment or be unexported (golint)
    • Line 234: warning: exported method ConnSession.SetMtu should have comment or be unexported (golint)
    • Line 247: warning: exported method ConnSession.SetTunName should have comment or be unexported (golint)
    • Line 253: warning: exported method ConnSession.RateLimit should have comment or be unexported (golint)
    • Line 266: warning: exported function SToken2Sess should have comment or be unexported (golint)
    • Line 274: warning: exported function Token2Sess should have comment or be unexported (golint)
    • Line 280: warning: exported function Dtls2Sess should have comment or be unexported (golint)
    • Line 284: warning: exported function DelSess should have comment or be unexported (golint)
    • Line 288: warning: exported function CloseSess should have comment or be unexported (golint)
    • Line 300: warning: exported function CloseCSess should have comment or be unexported (golint)
    • Line 311: warning: exported function DelSessByStoken should have comment or be unexported (golint)
    • anylink/server/admin/api_ip_map.go
    • Line 13: warning: exported function UserIpMapList should have comment or be unexported (golint)
    • Line 41: warning: exported function UserIpMapDetail should have comment or be unexported (golint)
    • Line 60: warning: exported function UserIpMapSet should have comment or be unexported (golint)
    • Line 94: warning: exported function UserIpMapDel should have comment or be unexported (golint)
    • anylink/server/pkg/arpdis/addr.go
    • Line 10: warning: exported const StaleTimeNormal should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported type Addr should have comment or be unexported (golint)
    • Line 30: warning: exported function Lookup should have comment or be unexported (golint)
    • anylink/server/dbdata/group.go
    • Line 13: warning: exported const Allow should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type GroupLinkAcl should have comment or be unexported (golint)
    • Line 26: warning: exported type ValData should have comment or be unexported (golint)
    • Line 32: warning: exported type Group should have comment or be unexported (golint)
    • Line 47: warning: exported function GetGroupNames should have comment or be unexported (golint)
    • Line 61: warning: exported function SetGroup should have comment or be unexported (golint)
    • anylink/server/admin/api_other.go
    • Line 44: warning: exported function SetOtherSmtp should have comment or be unexported (golint)
    • Line 49: warning: exported function SetOtherSmtpEdit should have comment or be unexported (golint)
    • Line 54: warning: exported function SetOther should have comment or be unexported (golint)
    • Line 59: warning: exported function SetOtherEdit 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!