Preparing report...

Report for github.com/jmpsec/osctrl

A+    Excellent!    Found 25 issues across 86 files

Tweet

gofmt90%

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!


gocyclo86%

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.

    • osctrl/admin/handlers/post.go
    • Line 1157: warning: cyclomatic complexity 41 of function (*HandlersAdmin).UsersPOSTHandler() is high (> 15) (gocyclo)
    • Line 501: warning: cyclomatic complexity 39 of function (*HandlersAdmin).ConfPOSTHandler() is high (> 15) (gocyclo)
    • Line 98: warning: cyclomatic complexity 36 of function (*HandlersAdmin).QueryRunPOSTHandler() is high (> 15) (gocyclo)
    • Line 236: warning: cyclomatic complexity 33 of function (*HandlersAdmin).CarvesRunPOSTHandler() is high (> 15) (gocyclo)
    • Line 1057: warning: cyclomatic complexity 22 of function (*HandlersAdmin).SettingsPOSTHandler() is high (> 15) (gocyclo)
    • Line 1615: warning: cyclomatic complexity 21 of function (*HandlersAdmin).EditProfilePOSTHandler() is high (> 15) (gocyclo)
    • Line 958: warning: cyclomatic complexity 21 of function (*HandlersAdmin).EnvsPOSTHandler() is high (> 15) (gocyclo)
    • Line 1334: warning: cyclomatic complexity 20 of function (*HandlersAdmin).TagsPOSTHandler() is high (> 15) (gocyclo)
    • Line 797: warning: cyclomatic complexity 18 of function (*HandlersAdmin).ExpirationPOSTHandler() is high (> 15) (gocyclo)
    • Line 876: warning: cyclomatic complexity 18 of function (*HandlersAdmin).NodeActionsPOSTHandler() is high (> 15) (gocyclo)
    • Line 377: warning: cyclomatic complexity 18 of function (*HandlersAdmin).QueryActionsPOSTHandler() is high (> 15) (gocyclo)
    • Line 1422: warning: cyclomatic complexity 16 of function (*HandlersAdmin).TagNodesPOSTHandler() is high (> 15) (gocyclo)

golint90%

Golint is a linter for Go source code.

    • osctrl/tls/handlers/handlers.go
    • Line 67: warning: exported type HandlersOption should have comment or be unexported (golint)
    • Line 69: warning: exported function WithEnvs should have comment or be unexported (golint)
    • Line 75: warning: exported function WithEnvsMap should have comment or be unexported (golint)
    • Line 81: warning: exported function WithSettings should have comment or be unexported (golint)
    • Line 87: warning: exported function WithSettingsMap should have comment or be unexported (golint)
    • Line 93: warning: exported function WithNodes should have comment or be unexported (golint)
    • Line 99: warning: exported function WithTags should have comment or be unexported (golint)
    • Line 105: warning: exported function WithQueries should have comment or be unexported (golint)
    • Line 111: warning: exported function WithCarves should have comment or be unexported (golint)
    • Line 117: warning: exported function WithMetrics should have comment or be unexported (golint)
    • Line 123: warning: exported function WithLogs should have comment or be unexported (golint)
    • osctrl/admin/handlers/handlers.go
    • Line 54: warning: exported type HandlersOption should have comment or be unexported (golint)
    • Line 56: warning: exported function WithDB should have comment or be unexported (golint)
    • Line 62: warning: exported function WithEnvs should have comment or be unexported (golint)
    • Line 68: warning: exported function WithUsers should have comment or be unexported (golint)
    • Line 74: warning: exported function WithTags should have comment or be unexported (golint)
    • Line 80: warning: exported function WithSettings should have comment or be unexported (golint)
    • Line 86: warning: exported function WithNodes should have comment or be unexported (golint)
    • Line 92: warning: exported function WithQueries should have comment or be unexported (golint)
    • Line 98: warning: exported function WithCarves should have comment or be unexported (golint)
    • Line 104: warning: exported function WithMetrics should have comment or be unexported (golint)
    • Line 110: warning: exported function WithLoggerDB should have comment or be unexported (golint)
    • Line 116: warning: exported function WithSessions should have comment or be unexported (golint)
    • Line 122: warning: exported function WithVersion should have comment or be unexported (golint)
    • Line 128: warning: exported function WithOsqueryTables should have comment or be unexported (golint)
    • Line 134: warning: exported function WithAdminConfig should have comment or be unexported (golint)
    • osctrl/logging/db.go
    • Line 64: warning: exported function CreateLoggerDB should have comment or be unexported (golint)
    • Line 192: warning: comment on exported method LoggerDB.Result should be of the form "Result ..." (golint)
    • osctrl/logging/graylog.go
    • Line 31: warning: comment on exported function LoadGraylog should be of the form "LoadGraylog ..." (golint)
    • Line 57: warning: exported function CreateLoggerGraylog should have comment or be unexported (golint)
    • Line 98: warning: comment on exported method LoggerGraylog.Send should be of the form "Send ..." (golint)
    • osctrl/logging/splunk.go
    • Line 40: warning: exported function CreateLoggerSplunk should have comment or be unexported (golint)
    • Line 56: warning: comment on exported function LoadSplunk should be of the form "LoadSplunk ..." (golint)
    • osctrl/admin/sessions/sessions.go
    • Line 34: warning: exported const AdminLevel should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported const CtxUser should have comment (or a comment on this block) or be unexported (golint)
    • Line 47: warning: comment on exported type SessionValues should be of the form "SessionValues ..." (with optional leading article) (golint)
    • Line 50: warning: comment on exported type ContextValue should be of the form "ContextValue ..." (with optional leading article) (golint)
    • Line 53: warning: comment on exported type ContextKey should be of the form "ContextKey ..." (with optional leading article) (golint)
    • Line 202: warning: comment on exported function GenerateCSRF should be of the form "GenerateCSRF ..." (golint)
    • Line 209: warning: comment on exported function LevelPermissions should be of the form "LevelPermissions ..." (golint)
    • Line 226: warning: comment on exported function CheckCSRFToken should be of the form "CheckCSRFToken ..." (golint)
    • osctrl/admin/auth/auth.go
    • Line 20: warning: exported type AuthOption should have comment or be unexported (golint)
    • Line 22: warning: exported function WithSessions should have comment or be unexported (golint)
    • Line 28: warning: exported function WithUsers should have comment or be unexported (golint)
    • Line 65: warning: comment on exported method AdminAuth.HandlerAuthCheck should be of the form "HandlerAuthCheck ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.

    • osctrl/admin/auth/auth.go
    • Line 9: warning: no required module provides package github.com/jmpsec/osctrl/admin/sessions; to add it: (ineffassign)
    • Line 10: warning: no required module provides package github.com/jmpsec/osctrl/settings; to add it: (ineffassign)
    • Line 11: warning: no required module provides package github.com/jmpsec/osctrl/users; to add it: (ineffassign)
    • Line 9: warning: could not import github.com/jmpsec/osctrl/admin/sessions (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/jmpsec/osctrl/settings (invalid package name: "") (ineffassign)
    • Line 11: warning: could not import github.com/jmpsec/osctrl/users (invalid package name: "") (ineffassign)
    • Line 201: warning: undeclared name: tls (ineffassign)
    • Line 201: warning: undeclared name: JWTData (ineffassign)
    • Line 68: warning: undeclared name: adminConfig (ineffassign)
    • Line 89: warning: undeclared name: samlMiddleware (ineffassign)
    • Line 90: warning: undeclared name: samlConfig (ineffassign)
    • Line 93: warning: undeclared name: samlConfig (ineffassign)
    • Line 96: warning: undeclared name: samlData (ineffassign)
    • Line 99: warning: undeclared name: samlConfig (ineffassign)
    • Line 108: warning: undeclared name: forbiddenPath (ineffassign)
    • Line 114: warning: undeclared name: forbiddenPath (ineffassign)
    • Line 121: warning: undeclared name: samlConfig (ineffassign)
    • Line 137: warning: undeclared name: samlMiddleware (ineffassign)
    • Line 139: warning: undeclared name: samlMiddleware (ineffassign)
    • Line 142: warning: undeclared name: headersConfig (ineffassign)
    • Line 142: warning: undeclared name: headersConfig (ineffassign)
    • Line 143: warning: undeclared name: headersConfig (ineffassign)
    • Line 143: warning: undeclared name: headersConfig (ineffassign)
    • Line 144: warning: undeclared name: headersConfig (ineffassign)
    • Line 144: warning: undeclared name: headersConfig (ineffassign)
    • Line 145: warning: undeclared name: headersConfig (ineffassign)
    • Line 145: warning: undeclared name: headersConfig (ineffassign)
    • Line 148: warning: undeclared name: forbiddenPath (ineffassign)
    • Line 154: warning: undeclared name: generateCSRF (ineffassign)
    • Line 156: warning: undeclared name: headersConfig (ineffassign)
    • Line 160: warning: undeclared name: headersConfig (ineffassign)
    • Line 167: warning: undeclared name: forbiddenPath (ineffassign)
    • Line 173: warning: undeclared name: forbiddenPath (ineffassign)
    • Line 178: warning: undeclared name: forbiddenPath (ineffassign)
    • Line 196: warning: undeclared name: levelPermissions (ineffassign)
    • Line 203: warning: undeclared name: jwt (ineffassign)
    • Line 207: warning: undeclared name: jwt (ineffassign)
    • Line 207: warning: undeclared name: jwt (ineffassign)
    • Line 208: warning: undeclared name: x509 (ineffassign)
    • Line 212: warning: undeclared name: JWTData (ineffassign)
    • Line 214: warning: undeclared name: JWTData (ineffassign)
    • Line 215: warning: tokenClaims.Subject undefined (type TokenClaims has no field or method Subject) (ineffassign)
    • osctrl/admin/sessions/sessions.go
    • Line 11: warning: no required module provides package github.com/gorilla/securecookie; to add it: (ineffassign)
    • Line 12: warning: no required module provides package github.com/gorilla/sessions; to add it: (ineffassign)
    • Line 13: warning: no required module provides package github.com/jinzhu/gorm; to add it: (ineffassign)
    • Line 14: warning: no required module provides package github.com/jmpsec/osctrl/users; to add it: (ineffassign)
    • Line 11: warning: could not import github.com/gorilla/securecookie (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import github.com/gorilla/sessions (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import github.com/jinzhu/gorm (invalid package name: "") (ineffassign)
    • Line 14: warning: could not import github.com/jmpsec/osctrl/users (invalid package name: "") (ineffassign)
    • osctrl/logging/db.go
    • Line 117: warning: CleanStatusLogs not declared by package settings (ineffassign)
    • Line 118: warning: CleanStatusLogs not declared by package settings (ineffassign)
    • Line 119: warning: CleanStatusLogs not declared by package settings (ineffassign)
    • Line 122: warning: CleanStatusInterval not declared by package settings (ineffassign)
    • Line 123: warning: CleanStatusInterval not declared by package settings (ineffassign)
    • Line 124: warning: CleanStatusInterval not declared by package settings (ineffassign)
    • Line 128: warning: CleanResultLogs not declared by package settings (ineffassign)
    • Line 129: warning: CleanResultLogs not declared by package settings (ineffassign)
    • Line 130: warning: CleanResultLogs not declared by package settings (ineffassign)
    • Line 133: warning: CleanResultInterval not declared by package settings (ineffassign)
    • Line 134: warning: CleanResultInterval not declared by package settings (ineffassign)
    • Line 135: warning: CleanResultInterval not declared by package settings (ineffassign)
    • Line 139: warning: CleanQueryLogs not declared by package settings (ineffassign)
    • Line 140: warning: CleanQueryLogs not declared by package settings (ineffassign)
    • Line 141: warning: CleanQueryLogs not declared by package settings (ineffassign)
    • Line 144: warning: CleanQueryEntries not declared by package settings (ineffassign)
    • Line 145: warning: CleanQueryEntries not declared by package settings (ineffassign)
    • Line 146: warning: CleanQueryEntries not declared by package settings (ineffassign)

misspell98%

Misspell Finds commonly misspelled English words