Preparing report...

Report for github.com/writeas/writefreely

D    Needs lots of improvement    Found 38 issues across 90 files

Tweet

gofmt0%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

An error occurred while running this test (exit status 127)


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!


golint65%

Golint is a linter for Go source code.

    • writefreely/migrations/migrations.go
    • Line 26: warning: exported function NewDatastore should have comment or be unexported (golint)
    • Line 36: warning: exported type Migration should have comment or be unexported (golint)
    • Line 46: warning: exported function New should have comment or be unexported (golint)
    • Line 76: warning: exported function SetInitialMigrations should have comment or be unexported (golint)
    • Line 85: warning: exported function Migrate should have comment or be unexported (golint)
    • writefreely/feed.go
    • Line 18: warning: should not use dot imports (golint)
    • Line 24: warning: exported function ViewFeed should have comment or be unexported (golint)
    • writefreely/page/page.go
    • Line 11: warning: package comment should be of the form "Package page ..." (golint)
    • Line 19: warning: exported type StaticPage should have comment or be unexported (golint)
    • Line 44: warning: exported method StaticPage.OfficialVersion should have comment or be unexported (golint)
    • writefreely/handle.go
    • Line 35: warning: exported const UserLevelNoneType should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported function UserLevelNone should have comment or be unexported (golint)
    • Line 45: warning: exported function UserLevelOptional should have comment or be unexported (golint)
    • Line 49: warning: exported function UserLevelNoneRequired should have comment or be unexported (golint)
    • Line 53: warning: exported function UserLevelUser should have comment or be unexported (golint)
    • Line 73: warning: exported type UserLevelFunc should have comment or be unexported (golint)
    • Line 76: warning: exported type Handler should have comment or be unexported (golint)
    • Line 310: warning: exported method Handler.UserAll should have comment or be unexported (golint)
    • Line 356: warning: exported method Handler.RedirectOnErr should have comment or be unexported (golint)
    • Line 373: warning: exported method Handler.Page should have comment or be unexported (golint)
    • Line 390: warning: exported method Handler.WebErrors should have comment or be unexported (golint)
    • Line 463: warning: exported method Handler.CollectionPostOrStatic should have comment or be unexported (golint)
    • Line 544: warning: exported method Handler.All should have comment or be unexported (golint)
    • Line 577: warning: exported method Handler.OAuth should have comment or be unexported (golint)
    • Line 608: warning: exported method Handler.AllReader should have comment or be unexported (golint)
    • Line 669: warning: exported method Handler.Download should have comment or be unexported (golint)
    • Line 714: warning: exported method Handler.Redirect should have comment or be unexported (golint)
    • Line 874: warning: exported method Handler.LogHandlerFunc should have comment or be unexported (golint)
    • Line 926: warning: exported method Handler.Gopher should have comment or be unexported (golint)
    • writefreely/routes.go
    • Line 214: warning: exported function RouteCollections should have comment or be unexported (golint)
    • Line 227: warning: exported function RouteRead should have comment or be unexported (golint)
    • writefreely/config/setup.go
    • Line 23: warning: exported type SetupData should have comment or be unexported (golint)
    • Line 28: warning: exported function Configure should have comment or be unexported (golint)
    • writefreely/account.go
    • Line 46: warning: exported type UserPage should have comment or be unexported (golint)
    • Line 57: warning: exported function NewUserPage should have comment or be unexported (golint)
    • Line 75: warning: exported method UserPage.SetMessaging should have comment or be unexported (golint)
    • Line 464: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • writefreely/activitypub.go
    • Line 58: warning: exported type RemoteUser should have comment or be unexported (golint)
    • Line 66: warning: exported method RemoteUser.AsPerson should have comment or be unexported (golint)
    • Line 402: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • writefreely/db/create.go
    • Line 18: warning: exported type ColumnType should have comment or be unexported (golint)
    • Line 20: warning: exported type OptionalInt should have comment or be unexported (golint)
    • Line 25: warning: exported type OptionalString should have comment or be unexported (golint)
    • Line 30: warning: exported type SQLBuilder should have comment or be unexported (golint)
    • Line 34: warning: exported type Column should have comment or be unexported (golint)
    • Line 44: warning: exported type CreateTableSqlBuilder should have comment or be unexported (golint)
    • Line 54: warning: exported const ColumnTypeBool should have comment (or a comment on this block) or be unexported (golint)
    • Line 65: warning: exported var UnsetSize should have comment or be unexported (golint)
    • Line 66: warning: exported var UnsetDefault should have comment or be unexported (golint)
    • Line 68: warning: exported method ColumnType.Format should have comment or be unexported (golint)
    • Line 132: warning: exported method Column.SetName should have comment or be unexported (golint)
    • Line 137: warning: exported method Column.SetNullable should have comment or be unexported (golint)
    • Line 142: warning: exported method Column.SetPrimaryKey should have comment or be unexported (golint)
    • Line 147: warning: exported method Column.SetDefault should have comment or be unexported (golint)
    • Line 152: warning: exported method Column.SetDefaultCurrentTimestamp should have comment or be unexported (golint)
    • Line 161: warning: exported method Column.SetType should have comment or be unexported (golint)
    • Line 166: warning: exported method Column.SetSize should have comment or be unexported (golint)
    • Line 204: warning: exported method CreateTableSqlBuilder.Column should have comment or be unexported (golint)
    • Line 213: warning: exported method CreateTableSqlBuilder.UniqueConstraint should have comment or be unexported (golint)
    • Line 224: warning: exported method CreateTableSqlBuilder.SetIfNotExists should have comment or be unexported (golint)
    • Line 229: warning: exported method CreateTableSqlBuilder.ToSQL should have comment or be unexported (golint)
    • writefreely/db/dialect.go
    • Line 5: warning: exported type DialectType should have comment or be unexported (golint)
    • Line 8: warning: exported const DialectSQLite should have comment (or a comment on this block) or be unexported (golint)
    • Line 12: warning: exported method DialectType.Column should have comment or be unexported (golint)
    • Line 23: warning: exported method DialectType.Table should have comment or be unexported (golint)
    • Line 34: warning: exported method DialectType.AlterTable should have comment or be unexported (golint)
    • Line 45: warning: exported method DialectType.CreateUniqueIndex should have comment or be unexported (golint)
    • Line 56: warning: exported method DialectType.CreateIndex should have comment or be unexported (golint)
    • Line 67: warning: exported method DialectType.DropIndex should have comment or be unexported (golint)
    • writefreely/db/raw.go
    • Line 3: warning: exported type RawSqlBuilder should have comment or be unexported (golint)
    • Line 7: warning: exported method RawSqlBuilder.ToSQL should have comment or be unexported (golint)
    • writefreely/config/config.go
    • Line 27: warning: exported const UserNormal should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported type UserType should have comment or be unexported (golint)
    • Line 68: warning: exported type WriteAsOauthCfg should have comment or be unexported (golint)
    • Line 78: warning: exported type GitlabOauthCfg should have comment or be unexported (golint)
    • Line 87: warning: exported type GiteaOauthCfg should have comment or be unexported (golint)
    • Line 96: warning: exported type SlackOauthCfg should have comment or be unexported (golint)
    • Line 104: warning: exported type GenericOauthCfg should have comment or be unexported (golint)
    • Line 231: warning: exported method AppCfg.LandingPath should have comment or be unexported (golint)
    • Line 238: warning: exported method AppCfg.SignupPath should have comment or be unexported (golint)
    • writefreely/db/alter.go
    • Line 8: warning: exported type AlterTableSqlBuilder should have comment or be unexported (golint)
    • Line 14: warning: exported method AlterTableSqlBuilder.AddColumn should have comment or be unexported (golint)
    • Line 21: warning: exported method AlterTableSqlBuilder.ChangeColumn should have comment or be unexported (golint)
    • Line 28: warning: exported method AlterTableSqlBuilder.AddUniqueConstraint should have comment or be unexported (golint)
    • Line 33: warning: exported method AlterTableSqlBuilder.ToSQL should have comment or be unexported (golint)
    • writefreely/invites.go
    • Line 27: warning: exported type Invite should have comment or be unexported (golint)
    • Line 37: warning: exported method Invite.Uses should have comment or be unexported (golint)
    • Line 41: warning: exported method Invite.Expired should have comment or be unexported (golint)
    • Line 45: warning: exported method Invite.Active should have comment or be unexported (golint)
    • Line 57: warning: exported method Invite.ExpiresFriendly should have comment or be unexported (golint)
    • writefreely/db/index.go
    • Line 8: warning: exported type CreateIndexSqlBuilder should have comment or be unexported (golint)
    • Line 16: warning: exported type DropIndexSqlBuilder should have comment or be unexported (golint)
    • Line 22: warning: exported method CreateIndexSqlBuilder.ToSQL should have comment or be unexported (golint)
    • Line 51: warning: exported method DropIndexSqlBuilder.ToSQL should have comment or be unexported (golint)
    • writefreely/cache.go
    • Line 29: warning: exported type AuthCache should have comment or be unexported (golint)
    • Line 46: warning: exported function CachePosts should have comment or be unexported (golint)
    • Line 56: warning: exported function GetPostsCache should have comment or be unexported (golint)
    • writefreely/collections.go
    • Line 40: warning: comment on exported type Collection should be of the form "Collection ..." (with optional leading article) (golint)
    • Line 65: warning: exported type CollectionObj should have comment or be unexported (golint)
    • Line 72: warning: exported type DisplayCollection should have comment or be unexported (golint)
    • Line 80: warning: exported type SubmittedCollection should have comment or be unexported (golint)
    • Line 103: warning: exported type CollectionFormat should have comment or be unexported (golint)
    • Line 119: warning: exported method SubmittedCollection.FediverseHandle should have comment or be unexported (golint)
    • Line 129: warning: comment on exported const CollUnlisted should be of the form "CollUnlisted ..." (golint)
    • Line 134: warning: exported const CollPublic should have comment (or a comment on this block) or be unexported (golint)
    • Line 154: warning: exported method CollectionFormat.Ascending should have comment or be unexported (golint)
    • Line 157: warning: exported method CollectionFormat.ShowDates should have comment or be unexported (golint)
    • Line 160: warning: exported method CollectionFormat.PostsPerPage should have comment or be unexported (golint)
    • Line 186: warning: exported method Collection.IsInstanceColl should have comment or be unexported (golint)
    • Line 191: warning: exported method Collection.IsUnlisted should have comment or be unexported (golint)
    • Line 195: warning: exported method Collection.IsPrivate should have comment or be unexported (golint)
    • Line 199: warning: exported method Collection.IsProtected should have comment or be unexported (golint)
    • Line 203: warning: exported method Collection.IsPublic should have comment or be unexported (golint)
    • Line 207: warning: exported method Collection.FriendlyVisibility should have comment or be unexported (golint)
    • Line 220: warning: exported method Collection.ShowFooterBranding should have comment or be unexported (golint)
    • Line 230: warning: exported method Collection.DisplayCanonicalURL should have comment or be unexported (golint)
    • Line 245: warning: exported method Collection.RedirectingCanonicalURL should have comment or be unexported (golint)
    • Line 285: warning: exported method Collection.DisplayTitle should have comment or be unexported (golint)
    • Line 292: warning: exported method Collection.StyleSheetDisplay should have comment or be unexported (golint)
    • Line 304: warning: exported method Collection.PersonObject should have comment or be unexported (golint)
    • Line 335: warning: exported method Collection.AvatarURL should have comment or be unexported (golint)
    • Line 343: warning: exported method Collection.FederatedAPIBase should have comment or be unexported (golint)
    • Line 347: warning: exported method Collection.FederatedAccount should have comment or be unexported (golint)
    • Line 352: warning: exported method Collection.RenderMathJax should have comment or be unexported (golint)
    • Line 560: warning: exported type CollectionPage should have comment or be unexported (golint)
    • Line 576: warning: exported function NewCollectionObj should have comment or be unexported (golint)
    • Line 583: warning: exported method CollectionObj.ScriptDisplay should have comment or be unexported (golint)
    • Line 589: warning: exported method CollectionObj.ExternalScripts should have comment or be unexported (golint)
    • Line 602: warning: exported method CollectionObj.CanShowScript should have comment or be unexported (golint)
    • Line 1069: 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)
    • writefreely/key/key.go
    • Line 19: warning: exported const EncKeysBytes should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: exported type Keychain should have comment or be unexported (golint)
    • writefreely/app.go
    • Line 105: warning: exported method App.SessionStore should have comment or be unexported (golint)
    • Line 109: warning: exported method App.SetSessionStore should have comment or be unexported (golint)
    • Line 217: warning: exported method App.ReqLog should have comment or be unexported (golint)
    • Line 427: warning: exported function Serve should have comment or be unexported (golint)
    • Line 516: warning: exported method App.InitDecoder should have comment or be unexported (golint)
    • writefreely/posts.go
    • Line 54: warning: exported type AnonymousPost should have comment or be unexported (golint)
    • Line 72: warning: exported type AuthenticatedPost should have comment or be unexported (golint)
    • Line 131: warning: exported type RawPost should have comment or be unexported (golint)
    • Line 148: warning: exported type AnonymousAuthPost should have comment or be unexported (golint)
    • Line 152: warning: exported type ClaimPostRequest should have comment or be unexported (golint)
    • Line 160: warning: exported type ClaimPostResult should have comment or be unexported (golint)
    • Line 168: warning: exported method Post.Direction should have comment or be unexported (golint)
    • Line 233: warning: exported method Post.SummaryHTML should have comment or be unexported (golint)
    • Line 243: warning: exported method Post.CreatedDate should have comment or be unexported (golint)
    • Line 247: warning: exported method Post.Created8601 should have comment or be unexported (golint)
    • Line 251: warning: exported method Post.IsScheduled should have comment or be unexported (golint)
    • Line 255: warning: exported method Post.HasTag should have comment or be unexported (golint)
    • Line 263: warning: exported method Post.HasTitleLink should have comment or be unexported (golint)
    • Line 970: warning: exported type PinPostResult should have comment or be unexported (golint)
    • Line 1125: warning: exported method PublicPost.CanonicalURL should have comment or be unexported (golint)
    • Line 1132: warning: exported method PublicPost.ActivityObject should have comment or be unexported (golint)
    • Line 1543: warning: comment on exported function PostsContains should be of the form "PostsContains ..." (golint)
    • Line 1558: warning: exported method RawPost.UserFacingCreated should have comment or be unexported (golint)
    • Line 1562: warning: exported method RawPost.Created8601 should have comment or be unexported (golint)
    • Line 1566: warning: exported method RawPost.Updated8601 should have comment or be unexported (golint)
    • writefreely/read.go
    • Line 22: warning: should not use dot imports (golint)
    • Line 69: warning: comment on exported method App.FetchPublicPosts should be of the form "FetchPublicPosts ..." (golint)
    • writefreely/admin.go
    • Line 93: warning: exported type AdminPage should have comment or be unexported (golint)
    • Line 97: warning: exported function NewAdminPage should have comment or be unexported (golint)
    • writefreely/users.go
    • Line 22: warning: exported type UserStatus should have comment or be unexported (golint)
    • Line 25: warning: exported const UserActive should have comment (or a comment on this block) or be unexported (golint)
    • Line 78: warning: exported type ExportUser should have comment or be unexported (golint)
    • Line 84: warning: exported type PublicUser should have comment or be unexported (golint)
    • Line 108: warning: exported method User.CreatedFriendly should have comment or be unexported (golint)
    • Line 125: warning: exported method User.IsAdmin should have comment or be unexported (golint)
    • Line 130: warning: exported method User.IsSilenced should have comment or be unexported (golint)
    • writefreely/semver.go
    • Line 24: warning: package comment should be of the form "Package writefreely ..." (golint)
    • Line 242: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 283: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 297: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 304: warning: if block ends with a return statement, so drop this else and outdent its block (golint)

gocyclo84%

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.

    • writefreely/posts.go
    • Line 1319: warning: cyclomatic complexity 56 of function viewCollectionPost() is high (> 15) (gocyclo)
    • Line 271: warning: cyclomatic complexity 54 of function handleViewPost() is high (> 15) (gocyclo)
    • Line 493: warning: cyclomatic complexity 30 of function newPost() is high (> 15) (gocyclo)
    • Line 626: warning: cyclomatic complexity 29 of function existingPost() is high (> 15) (gocyclo)
    • Line 759: warning: cyclomatic complexity 26 of function deletePost() is high (> 15) (gocyclo)
    • writefreely/database.go
    • Line 1911: warning: cyclomatic complexity 30 of function (*datastore).ChangeSettings() is high (> 15) (gocyclo)
    • Line 852: warning: cyclomatic complexity 28 of function (*datastore).UpdateCollection() is high (> 15) (gocyclo)
    • Line 1396: warning: cyclomatic complexity 26 of function (*datastore).ClaimPosts() is high (> 15) (gocyclo)
    • Line 2225: warning: cyclomatic complexity 19 of function (*datastore).DeleteAccount() is high (> 15) (gocyclo)
    • Line 613: warning: cyclomatic complexity 18 of function (*datastore).CreatePost() is high (> 15) (gocyclo)
    • writefreely/activitypub.go
    • Line 293: warning: cyclomatic complexity 36 of function handleFetchCollectionInbox() is high (> 15) (gocyclo)
    • Line 664: warning: cyclomatic complexity 18 of function federatePost() is high (> 15) (gocyclo)
    • writefreely/account.go
    • Line 372: warning: cyclomatic complexity 38 of function login() is high (> 15) (gocyclo)
    • Line 130: warning: cyclomatic complexity 17 of function signupWithRegistration() is high (> 15) (gocyclo)
    • Line 865: warning: cyclomatic complexity 17 of function updateSettings() is high (> 15) (gocyclo)
    • writefreely/collections.go
    • Line 752: warning: cyclomatic complexity 26 of function handleViewCollection() is high (> 15) (gocyclo)
    • Line 623: warning: cyclomatic complexity 21 of function processCollectionPermissions() is high (> 15) (gocyclo)
    • Line 356: warning: cyclomatic complexity 17 of function newCollection() is high (> 15) (gocyclo)
    • Line 995: warning: cyclomatic complexity 17 of function existingCollection() is high (> 15) (gocyclo)

ineffassign92%

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!