Preparing report...

Report for github.com/unfoldingword/dcs

(v1.16.2)

A+    Excellent!    Found 225 issues across 1512 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!


golint99%

Golint is a linter for Go source code.

    • models/repo.go
    • Line 1020: warning: exported function StatsCorrectSQL should have comment or be unexported (golint)
    • Line 1224: warning: exported function UpdateRepoStats should have comment or be unexported (golint)

gocyclo85%

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.

    • services/repository/push.go
    • Line 75: warning: cyclomatic complexity 38 of function pushUpdates() is high (> 15) (gocyclo)
    • Line 269: warning: cyclomatic complexity 23 of function pushUpdateAddTags() is high (> 15) (gocyclo)
    • models/user.go
    • Line 43: warning: cyclomatic complexity 26 of function DeleteUser() is high (> 15) (gocyclo)
    • routers/web/repo/compare.go
    • Line 179: warning: cyclomatic complexity 73 of function ParseCompareInfo() is high (> 15) (gocyclo)
    • Line 540: warning: cyclomatic complexity 18 of function PrepareCompareDiff() is high (> 15) (gocyclo)
    • Line 675: warning: cyclomatic complexity 17 of function CompareDiff() is high (> 15) (gocyclo)
    • modules/repository/repo.go
    • Line 51: warning: cyclomatic complexity 31 of function MigrateRepositoryGitData() is high (> 15) (gocyclo)
    • Line 345: warning: cyclomatic complexity 21 of function StoreMissingLfsObjectsInRepository() is high (> 15) (gocyclo)
    • routers/web/auth/oauth.go
    • Line 358: warning: cyclomatic complexity 24 of function AuthorizeOAuth() is high (> 15) (gocyclo)
    • Line 984: warning: cyclomatic complexity 22 of function handleOAuth2SignIn() is high (> 15) (gocyclo)
    • Line 811: warning: cyclomatic complexity 19 of function SignInOAuthCallback() is high (> 15) (gocyclo)
    • Line 1089: warning: cyclomatic complexity 18 of function oAuth2UserLoginCallback() is high (> 15) (gocyclo)
    • modules/markup/html.go
    • Line 612: warning: cyclomatic complexity 40 of function shortLinkProcessorFull() is high (> 15) (gocyclo)
    • Line 357: warning: cyclomatic complexity 26 of function visitNode() is high (> 15) (gocyclo)
    • Line 806: warning: cyclomatic complexity 17 of function issueIndexPatternProcessor() is high (> 15) (gocyclo)
    • modules/templates/helper.go
    • Line 49: warning: cyclomatic complexity 39 of function NewFuncMap() is high (> 15) (gocyclo)
    • Line 386: warning: cyclomatic complexity 16 of function NewTextFuncMap() is high (> 15) (gocyclo)
    • routers/web/repo/migrate.go
    • Line 152: warning: cyclomatic complexity 18 of function MigratePost() is high (> 15) (gocyclo)
    • Line 72: warning: cyclomatic complexity 18 of function handleMigrateError() is high (> 15) (gocyclo)
    • routers/web/admin/users.go
    • Line 251: warning: cyclomatic complexity 26 of function EditUserPost() is high (> 15) (gocyclo)
    • Line 96: warning: cyclomatic complexity 19 of function NewUserPost() is high (> 15) (gocyclo)
    • routers/api/v1/repo/repo.go
    • Line 738: warning: cyclomatic complexity 46 of function updateRepoUnits() is high (> 15) (gocyclo)
    • Line 642: warning: cyclomatic complexity 28 of function updateBasicProperties() is high (> 15) (gocyclo)
    • Line 51: warning: cyclomatic complexity 20 of function Search() is high (> 15) (gocyclo)
    • Line 315: warning: cyclomatic complexity 16 of function Generate() is high (> 15) (gocyclo)
    • services/lfs/server.go
    • Line 154: warning: cyclomatic complexity 24 of function BatchHandler() is high (> 15) (gocyclo)
    • Line 270: warning: cyclomatic complexity 16 of function UploadHandler() is high (> 15) (gocyclo)
    • services/pull/patch.go
    • Line 216: warning: cyclomatic complexity 39 of function checkConflicts() is high (> 15) (gocyclo)
    • Line 112: warning: cyclomatic complexity 37 of function attemptMerge() is high (> 15) (gocyclo)
    • cmd/admin.go
    • Line 780: warning: cyclomatic complexity 25 of function runUpdateOauth() is high (> 15) (gocyclo)
    • Line 482: warning: cyclomatic complexity 18 of function runCreateUser() is high (> 15) (gocyclo)
    • models/token.go
    • Line 93: warning: cyclomatic complexity 16 of function GetAccessTokenBySHA() is high (> 15) (gocyclo)
    • services/migrations/gitea_uploader.go
    • Line 596: warning: cyclomatic complexity 45 of function (*GiteaLocalUploader).newPullRequest() is high (> 15) (gocyclo)
    • Line 350: warning: cyclomatic complexity 25 of function (*GiteaLocalUploader).CreateIssues() is high (> 15) (gocyclo)
    • Line 234: warning: cyclomatic complexity 21 of function (*GiteaLocalUploader).CreateReleases() is high (> 15) (gocyclo)
    • Line 832: warning: cyclomatic complexity 19 of function (*GiteaLocalUploader).CreateReviews() is high (> 15) (gocyclo)
    • Line 466: warning: cyclomatic complexity 18 of function (*GiteaLocalUploader).CreateComments() is high (> 15) (gocyclo)
    • modules/git/commit_info_gogit.go
    • Line 179: warning: cyclomatic complexity 25 of function GetLastCommitForPaths() is high (> 15) (gocyclo)
    • Line 21: warning: cyclomatic complexity 18 of function (Entries).GetCommitsInfo() is high (> 15) (gocyclo)
    • models/issue.go
    • Line 2085: warning: cyclomatic complexity 36 of function (*Issue).ResolveMentionsByVisibility() is high (> 15) (gocyclo)
    • Line 1241: warning: cyclomatic complexity 28 of function (*IssuesOptions).setupSession() is high (> 15) (gocyclo)
    • Line 1703: warning: cyclomatic complexity 28 of function GetUserIssueStats() is high (> 15) (gocyclo)
    • Line 929: warning: cyclomatic complexity 26 of function newIssue() is high (> 15) (gocyclo)
    • Line 523: warning: cyclomatic complexity 17 of function (*Issue).ReplaceLabels() is high (> 15) (gocyclo)
    • Line 2243: warning: cyclomatic complexity 16 of function deleteIssuesByRepoID() is high (> 15) (gocyclo)
    • modules/gitgraph/parser.go
    • Line 262: warning: cyclomatic complexity 17 of function (*Parser).setOutFlow() is high (> 15) (gocyclo)
    • Line 288: warning: cyclomatic complexity 16 of function (*Parser).setInFlow() is high (> 15) (gocyclo)
    • routers/web/repo/issue.go
    • Line 1083: warning: cyclomatic complexity 155 of function ViewIssue() is high (> 15) (gocyclo)
    • Line 117: warning: cyclomatic complexity 45 of function issues() is high (> 15) (gocyclo)
    • Line 483: warning: cyclomatic complexity 44 of function RetrieveRepoReviewers() is high (> 15) (gocyclo)
    • Line 2052: warning: cyclomatic complexity 35 of function NewComment() is high (> 15) (gocyclo)
    • Line 2595: warning: cyclomatic complexity 22 of function combineLabelComments() is high (> 15) (gocyclo)
    • Line 2373: warning: cyclomatic complexity 21 of function ChangeCommentReaction() is high (> 15) (gocyclo)
    • Line 1887: warning: cyclomatic complexity 20 of function UpdatePullReviewRequest() is high (> 15) (gocyclo)
    • Line 856: warning: cyclomatic complexity 19 of function ValidateRepoMetas() is high (> 15) (gocyclo)
    • Line 2277: warning: cyclomatic complexity 18 of function ChangeIssueReaction() is high (> 15) (gocyclo)
    • services/mirror/mirror_pull.go
    • Line 185: warning: cyclomatic complexity 27 of function runSync() is high (> 15) (gocyclo)
    • Line 355: warning: cyclomatic complexity 21 of function SyncPullMirror() is high (> 15) (gocyclo)
    • Line 489: warning: cyclomatic complexity 20 of function checkAndUpdateEmptyRepository() is high (> 15) (gocyclo)
    • routers/web/repo/lfs.go
    • Line 249: warning: cyclomatic complexity 20 of function LFSFileGet() is high (> 15) (gocyclo)
    • Line 71: warning: cyclomatic complexity 19 of function LFSLocks() is high (> 15) (gocyclo)
    • Line 404: warning: cyclomatic complexity 18 of function LFSPointerFiles() is high (> 15) (gocyclo)
    • models/org.go
    • Line 743: warning: cyclomatic complexity 21 of function removeOrgUser() is high (> 15) (gocyclo)
    • Line 209: warning: cyclomatic complexity 16 of function CreateOrganization() is high (> 15) (gocyclo)
    • routers/api/v1/repo/issue.go
    • Line 669: warning: cyclomatic complexity 36 of function EditIssue() is high (> 15) (gocyclo)
    • Line 33: warning: cyclomatic complexity 33 of function SearchIssues() is high (> 15) (gocyclo)
    • Line 282: warning: cyclomatic complexity 26 of function ListIssues() is high (> 15) (gocyclo)
    • Line 553: warning: cyclomatic complexity 16 of function CreateIssue() is high (> 15) (gocyclo)
    • cmd/doctor.go
    • Line 128: warning: cyclomatic complexity 19 of function runDoctor() is high (> 15) (gocyclo)
    • cmd/dump_repo.go
    • Line 78: warning: cyclomatic complexity 17 of function runDumpRepository() is high (> 15) (gocyclo)
    • services/pull/merge.go
    • Line 120: warning: cyclomatic complexity 60 of function rawMerge() is high (> 15) (gocyclo)
    • Line 37: warning: cyclomatic complexity 17 of function Merge() is high (> 15) (gocyclo)
    • routers/web/auth/auth.go
    • Line 174: warning: cyclomatic complexity 22 of function SignInPost() is high (> 15) (gocyclo)
    • Line 427: warning: cyclomatic complexity 18 of function SignUpPost() is high (> 15) (gocyclo)
    • Line 537: warning: cyclomatic complexity 18 of function createUserInContext() is high (> 15) (gocyclo)
    • cmd/cert.go
    • Line 93: warning: cyclomatic complexity 21 of function runCert() is high (> 15) (gocyclo)
    • routers/web/repo/view.go
    • Line 138: warning: cyclomatic complexity 56 of function renderDirectory() is high (> 15) (gocyclo)
    • Line 374: warning: cyclomatic complexity 49 of function renderFile() is high (> 15) (gocyclo)
    • Line 68: warning: cyclomatic complexity 26 of function getReadmeFileFromPath() is high (> 15) (gocyclo)
    • Line 734: warning: cyclomatic complexity 17 of function renderDirectoryFiles() is high (> 15) (gocyclo)
    • Line 855: warning: cyclomatic complexity 16 of function renderCode() is high (> 15) (gocyclo)
    • services/wiki/wiki.go
    • Line 122: warning: cyclomatic complexity 28 of function updateWikiPage() is high (> 15) (gocyclo)
    • Line 281: warning: cyclomatic complexity 18 of function DeleteWikiPage() is high (> 15) (gocyclo)
    • cmd/hook.go
    • Line 486: warning: cyclomatic complexity 38 of function runHookProcReceive() is high (> 15) (gocyclo)
    • Line 307: warning: cyclomatic complexity 25 of function runHookPostReceive() is high (> 15) (gocyclo)
    • Line 164: warning: cyclomatic complexity 21 of function runHookPreReceive() is high (> 15) (gocyclo)
    • cmd/web.go
    • Line 81: warning: cyclomatic complexity 18 of function runWeb() is high (> 15) (gocyclo)
    • Line 203: warning: cyclomatic complexity 17 of function listen() is high (> 15) (gocyclo)
    • services/release/release.go
    • Line 187: warning: cyclomatic complexity 24 of function UpdateRelease() is high (> 15) (gocyclo)
    • Line 24: warning: cyclomatic complexity 17 of function createTag() is high (> 15) (gocyclo)
    • routers/api/v1/repo/branch.go
    • Line 539: warning: cyclomatic complexity 46 of function EditBranchProtection() is high (> 15) (gocyclo)
    • Line 371: warning: cyclomatic complexity 26 of function CreateBranchProtection() is high (> 15) (gocyclo)
    • cmd/dump.go
    • Line 152: warning: cyclomatic complexity 54 of function runDump() is high (> 15) (gocyclo)
    • routers/web/user/home.go
    • Line 352: warning: cyclomatic complexity 42 of function buildIssueOverview() is high (> 15) (gocyclo)
    • Line 152: warning: cyclomatic complexity 29 of function Milestones() is high (> 15) (gocyclo)
    • services/pull/pull.go
    • Line 566: warning: cyclomatic complexity 37 of function GetSquashMergeCommitMessages() is high (> 15) (gocyclo)
    • Line 236: warning: cyclomatic complexity 26 of function AddTestPullRequestTask() is high (> 15) (gocyclo)
    • Line 335: warning: cyclomatic complexity 19 of function checkIfPRContentChanged() is high (> 15) (gocyclo)
    • Line 30: warning: cyclomatic complexity 16 of function NewPullRequest() is high (> 15) (gocyclo)
    • services/repository/adopt.go
    • Line 103: warning: cyclomatic complexity 22 of function adoptRepository() is high (> 15) (gocyclo)
    • Line 272: warning: cyclomatic complexity 18 of function ListUnadoptedRepositories() is high (> 15) (gocyclo)
    • services/migrations/migrate.go
    • Line 178: warning: cyclomatic complexity 73 of function migrateRepository() is high (> 15) (gocyclo)
    • Line 43: warning: cyclomatic complexity 27 of function IsMigrateURLAllowed() is high (> 15) (gocyclo)
    • services/asymkey/sign.go
    • Line 272: warning: cyclomatic complexity 36 of function SignMerge() is high (> 15) (gocyclo)
    • Line 166: warning: cyclomatic complexity 17 of function SignWikiCommit() is high (> 15) (gocyclo)
    • Line 219: warning: cyclomatic complexity 17 of function SignCRUDAction() is high (> 15) (gocyclo)
    • modules/git/repo_attribute.go
    • Line 30: warning: cyclomatic complexity 18 of function (*Repository).CheckAttribute() is high (> 15) (gocyclo)
    • Line 320: warning: cyclomatic complexity 16 of function (*lineSeparatedAttributeWriter).Write() is high (> 15) (gocyclo)
    • routers/web/auth/openid.go
    • Line 146: warning: cyclomatic complexity 25 of function signInOpenIDVerify() is high (> 15) (gocyclo)
    • Line 359: warning: cyclomatic complexity 18 of function RegisterOpenIDPost() is high (> 15) (gocyclo)
    • services/webhook/general.go
    • Line 82: warning: cyclomatic complexity 18 of function getPullRequestPayloadInfo() is high (> 15) (gocyclo)
    • Line 30: warning: cyclomatic complexity 16 of function getIssuesPayloadInfo() is high (> 15) (gocyclo)
    • routers/web/repo/editor.go
    • Line 413: warning: cyclomatic complexity 31 of function DeleteFilePost() is high (> 15) (gocyclo)
    • Line 190: warning: cyclomatic complexity 30 of function editFilePost() is high (> 15) (gocyclo)
    • Line 576: warning: cyclomatic complexity 29 of function UploadFilePost() is high (> 15) (gocyclo)
    • models/repo.go
    • Line 718: warning: cyclomatic complexity 54 of function DeleteRepository() is high (> 15) (gocyclo)
    • Line 471: warning: cyclomatic complexity 28 of function CreateRepository() is high (> 15) (gocyclo)
    • Line 635: warning: cyclomatic complexity 16 of function updateRepository() is high (> 15) (gocyclo)
    • services/gitdiff/gitdiff.go
    • Line 717: warning: cyclomatic complexity 65 of function ParsePatch() is high (> 15) (gocyclo)
    • Line 1317: warning: cyclomatic complexity 47 of function GetDiff() is high (> 15) (gocyclo)
    • Line 1023: warning: cyclomatic complexity 44 of function parseHunks() is high (> 15) (gocyclo)
    • Line 210: warning: cyclomatic complexity 30 of function fixupBrokenSpans() is high (> 15) (gocyclo)
    • models/pull.go
    • Line 374: warning: cyclomatic complexity 18 of function (*PullRequest).SetMerged() is high (> 15) (gocyclo)
    • routers/web/repo/pull.go
    • Line 850: warning: cyclomatic complexity 46 of function MergePullRequest() is high (> 15) (gocyclo)
    • Line 394: warning: cyclomatic complexity 40 of function PrepareViewPullInfo() is high (> 15) (gocyclo)
    • Line 1220: warning: cyclomatic complexity 27 of function CleanUpPullRequest() is high (> 15) (gocyclo)
    • Line 632: warning: cyclomatic complexity 25 of function ViewPullFiles() is high (> 15) (gocyclo)
    • Line 92: warning: cyclomatic complexity 18 of function getForkRepository() is high (> 15) (gocyclo)
    • Line 176: warning: cyclomatic complexity 16 of function ForkPost() is high (> 15) (gocyclo)
    • Line 766: warning: cyclomatic complexity 16 of function UpdatePullRequest() is high (> 15) (gocyclo)
    • Line 1093: warning: cyclomatic complexity 16 of function CompareAndPullRequestPost() is high (> 15) (gocyclo)
    • modules/git/log_name_status.go
    • Line 101: warning: cyclomatic complexity 50 of function (*LogNameStatusRepoParser).Next() is high (> 15) (gocyclo)
    • Line 278: warning: cyclomatic complexity 32 of function WalkGitLog() is high (> 15) (gocyclo)
    • services/pull/review.go
    • Line 118: warning: cyclomatic complexity 24 of function createCodeComment() is high (> 15) (gocyclo)
    • Line 25: warning: cyclomatic complexity 16 of function CreateCodeComment() is high (> 15) (gocyclo)
    • cmd/serv.go
    • Line 98: warning: cyclomatic complexity 41 of function runServ() is high (> 15) (gocyclo)
    • modules/context/auth.go
    • Line 26: warning: cyclomatic complexity 28 of function Toggle() is high (> 15) (gocyclo)
    • Line 107: warning: cyclomatic complexity 24 of function ToggleAPI() is high (> 15) (gocyclo)
    • modules/context/repo.go
    • Line 412: warning: cyclomatic complexity 53 of function RepoAssignment() is high (> 15) (gocyclo)
    • Line 803: warning: cyclomatic complexity 26 of function RepoRefByType() is high (> 15) (gocyclo)
    • Line 737: warning: cyclomatic complexity 18 of function getRefName() is high (> 15) (gocyclo)
    • Line 970: warning: cyclomatic complexity 16 of function (*Context).IssueTemplatesFromDefaultBranch() is high (> 15) (gocyclo)
    • routers/api/v1/repo/pull.go
    • Line 681: warning: cyclomatic complexity 52 of function MergePullRequest() is high (> 15) (gocyclo)
    • Line 428: warning: cyclomatic complexity 45 of function EditPullRequest() is high (> 15) (gocyclo)
    • Line 245: warning: cyclomatic complexity 23 of function CreatePullRequest() is high (> 15) (gocyclo)
    • Line 920: warning: cyclomatic complexity 19 of function parseCompareInfo() is high (> 15) (gocyclo)
    • Line 1048: warning: cyclomatic complexity 16 of function UpdatePullRequest() is high (> 15) (gocyclo)
    • routers/web/repo/release.go
    • Line 294: warning: cyclomatic complexity 19 of function NewReleasePost() is high (> 15) (gocyclo)
    • Line 73: warning: cyclomatic complexity 18 of function releasesOrTags() is high (> 15) (gocyclo)

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!