Preparing report...

Report for github.com/go-gitea/gitea

A+    Excellent!    Found 162 issues across 1252 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!


golint100%

Golint is a linter for Go source code.

No problems detected. Good job!


gocyclo88%

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.

    • gitea/services/pull/review.go
    • Line 116: warning: cyclomatic complexity 24 of function createCodeComment() is high (> 15) (gocyclo)
    • Line 22: warning: cyclomatic complexity 16 of function CreateCodeComment() is high (> 15) (gocyclo)
    • gitea/modules/context/repo.go
    • Line 397: warning: cyclomatic complexity 41 of function RepoAssignment() is high (> 15) (gocyclo)
    • Line 727: warning: cyclomatic complexity 24 of function RepoRefByType() is high (> 15) (gocyclo)
    • Line 682: warning: cyclomatic complexity 16 of function getRefName() is high (> 15) (gocyclo)
    • gitea/services/wiki/wiki.go
    • Line 85: warning: cyclomatic complexity 27 of function updateWikiPage() is high (> 15) (gocyclo)
    • Line 242: warning: cyclomatic complexity 19 of function DeleteWikiPage() is high (> 15) (gocyclo)
    • gitea/routers/api/v1/repo/repo.go
    • Line 614: warning: cyclomatic complexity 45 of function updateRepoUnits() is high (> 15) (gocyclo)
    • Line 518: warning: cyclomatic complexity 29 of function updateBasicProperties() is high (> 15) (gocyclo)
    • Line 46: warning: cyclomatic complexity 21 of function Search() is high (> 15) (gocyclo)
    • gitea/services/gitdiff/gitdiff.go
    • Line 683: warning: cyclomatic complexity 57 of function ParsePatch() is high (> 15) (gocyclo)
    • Line 925: warning: cyclomatic complexity 35 of function parseHunks() is high (> 15) (gocyclo)
    • Line 202: warning: cyclomatic complexity 30 of function fixupBrokenSpans() is high (> 15) (gocyclo)
    • Line 1192: warning: cyclomatic complexity 20 of function GetDiffRangeWithWhitespaceBehavior() is high (> 15) (gocyclo)
    • gitea/routers/api/v1/repo/issue.go
    • Line 551: warning: cyclomatic complexity 33 of function EditIssue() is high (> 15) (gocyclo)
    • Line 30: warning: cyclomatic complexity 26 of function SearchIssues() is high (> 15) (gocyclo)
    • Line 230: warning: cyclomatic complexity 24 of function ListIssues() is high (> 15) (gocyclo)
    • Line 435: warning: cyclomatic complexity 16 of function CreateIssue() is high (> 15) (gocyclo)
    • gitea/routers/repo/branch.go
    • Line 267: warning: cyclomatic complexity 18 of function loadOneBranch() is high (> 15) (gocyclo)
    • Line 374: warning: cyclomatic complexity 16 of function CreateBranch() is high (> 15) (gocyclo)
    • gitea/modules/repository/repo.go
    • Line 47: warning: cyclomatic complexity 28 of function MigrateRepositoryGitData() is high (> 15) (gocyclo)
    • Line 318: warning: cyclomatic complexity 16 of function StoreMissingLfsObjectsInRepository() is high (> 15) (gocyclo)
    • gitea/cmd/hook.go
    • Line 287: warning: cyclomatic complexity 25 of function runHookPostReceive() is high (> 15) (gocyclo)
    • Line 151: warning: cyclomatic complexity 19 of function runHookPreReceive() is high (> 15) (gocyclo)
    • gitea/routers/user/auth.go
    • Line 965: warning: cyclomatic complexity 27 of function LinkAccountPostRegister() is high (> 15) (gocyclo)
    • Line 1599: warning: cyclomatic complexity 21 of function ResetPasswdPost() is high (> 15) (gocyclo)
    • Line 1124: warning: cyclomatic complexity 19 of function SignUpPost() is high (> 15) (gocyclo)
    • Line 1233: warning: cyclomatic complexity 19 of function createUserInContext() is high (> 15) (gocyclo)
    • Line 155: warning: cyclomatic complexity 16 of function SignInPost() is high (> 15) (gocyclo)
    • Line 597: warning: cyclomatic complexity 16 of function SignInOAuthCallback() is high (> 15) (gocyclo)
    • gitea/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)
    • gitea/routers/user/home.go
    • Line 368: warning: cyclomatic complexity 52 of function buildIssueOverview() is high (> 15) (gocyclo)
    • Line 169: warning: cyclomatic complexity 29 of function Milestones() is high (> 15) (gocyclo)
    • gitea/routers/private/hook.go
    • Line 120: warning: cyclomatic complexity 39 of function HookPreReceive() is high (> 15) (gocyclo)
    • Line 374: warning: cyclomatic complexity 35 of function HookPostReceive() is high (> 15) (gocyclo)
    • gitea/routers/repo/issue.go
    • Line 1046: warning: cyclomatic complexity 149 of function ViewIssue() is high (> 15) (gocyclo)
    • Line 466: warning: cyclomatic complexity 44 of function RetrieveRepoReviewers() is high (> 15) (gocyclo)
    • Line 111: warning: cyclomatic complexity 43 of function issues() is high (> 15) (gocyclo)
    • Line 1986: warning: cyclomatic complexity 35 of function NewComment() is high (> 15) (gocyclo)
    • Line 2302: warning: cyclomatic complexity 21 of function ChangeCommentReaction() is high (> 15) (gocyclo)
    • Line 1821: warning: cyclomatic complexity 20 of function UpdatePullReviewRequest() is high (> 15) (gocyclo)
    • Line 2206: warning: cyclomatic complexity 19 of function ChangeIssueReaction() is high (> 15) (gocyclo)
    • Line 835: warning: cyclomatic complexity 18 of function ValidateRepoMetas() is high (> 15) (gocyclo)
    • Line 2522: warning: cyclomatic complexity 16 of function combineLabelComments() is high (> 15) (gocyclo)
    • gitea/routers/api/v1/repo/pull.go
    • Line 440: warning: cyclomatic complexity 43 of function EditPullRequest() is high (> 15) (gocyclo)
    • Line 689: warning: cyclomatic complexity 38 of function MergePullRequest() is high (> 15) (gocyclo)
    • Line 257: warning: cyclomatic complexity 23 of function CreatePullRequest() is high (> 15) (gocyclo)
    • Line 882: warning: cyclomatic complexity 19 of function parseCompareInfo() is high (> 15) (gocyclo)
    • gitea/modules/timeutil/since.go
    • Line 91: warning: cyclomatic complexity 22 of function computeTimeDiff() is high (> 15) (gocyclo)
    • Line 33: warning: cyclomatic complexity 16 of function computeTimeDiffFloor() is high (> 15) (gocyclo)
    • gitea/routers/repo/migrate.go
    • Line 68: warning: cyclomatic complexity 20 of function handleMigrateError() is high (> 15) (gocyclo)
    • Line 148: warning: cyclomatic complexity 17 of function MigratePost() is high (> 15) (gocyclo)
    • gitea/services/mirror/mirror.go
    • Line 395: warning: cyclomatic complexity 21 of function syncMirror() is high (> 15) (gocyclo)
    • Line 526: warning: cyclomatic complexity 20 of function checkAndUpdateEmptyRepository() is high (> 15) (gocyclo)
    • Line 210: warning: cyclomatic complexity 19 of function runSync() is high (> 15) (gocyclo)
    • gitea/routers/repo/editor.go
    • Line 404: warning: cyclomatic complexity 32 of function DeleteFilePost() is high (> 15) (gocyclo)
    • Line 180: warning: cyclomatic complexity 31 of function editFilePost() is high (> 15) (gocyclo)
    • Line 568: warning: cyclomatic complexity 30 of function UploadFilePost() is high (> 15) (gocyclo)
    • gitea/routers/repo/release.go
    • Line 280: warning: cyclomatic complexity 17 of function NewReleasePost() is high (> 15) (gocyclo)
    • Line 70: warning: cyclomatic complexity 16 of function releasesOrTags() is high (> 15) (gocyclo)
    • gitea/modules/markup/html.go
    • Line 600: warning: cyclomatic complexity 38 of function shortLinkProcessorFull() is high (> 15) (gocyclo)
    • Line 347: warning: cyclomatic complexity 26 of function visitNode() is high (> 15) (gocyclo)
    • gitea/routers/repo/lfs.go
    • Line 69: warning: cyclomatic complexity 19 of function LFSLocks() is high (> 15) (gocyclo)
    • Line 248: warning: cyclomatic complexity 18 of function LFSFileGet() is high (> 15) (gocyclo)
    • Line 402: warning: cyclomatic complexity 16 of function LFSPointerFiles() is high (> 15) (gocyclo)
    • gitea/routers/admin/users.go
    • Line 220: warning: cyclomatic complexity 25 of function EditUserPost() is high (> 15) (gocyclo)
    • Line 68: warning: cyclomatic complexity 20 of function NewUserPost() is high (> 15) (gocyclo)
    • gitea/services/pull/pull.go
    • Line 520: warning: cyclomatic complexity 27 of function GetSquashMergeCommitMessages() is high (> 15) (gocyclo)
    • Line 228: warning: cyclomatic complexity 23 of function AddTestPullRequestTask() is high (> 15) (gocyclo)
    • Line 319: warning: cyclomatic complexity 19 of function checkIfPRContentChanged() is high (> 15) (gocyclo)
    • gitea/routers/repo/pull.go
    • Line 350: warning: cyclomatic complexity 37 of function PrepareViewPullInfo() is high (> 15) (gocyclo)
    • Line 766: warning: cyclomatic complexity 37 of function MergePullRequest() is high (> 15) (gocyclo)
    • Line 1126: warning: cyclomatic complexity 23 of function CleanUpPullRequest() is high (> 15) (gocyclo)
    • Line 577: warning: cyclomatic complexity 22 of function ViewPullFiles() is high (> 15) (gocyclo)
    • Line 89: warning: cyclomatic complexity 18 of function getForkRepository() is high (> 15) (gocyclo)
    • Line 174: warning: cyclomatic complexity 17 of function ForkPost() is high (> 15) (gocyclo)
    • gitea/routers/home.go
    • Line 292: warning: cyclomatic complexity 22 of function ExploreCode() is high (> 15) (gocyclo)
    • Line 93: warning: cyclomatic complexity 16 of function RenderRepoSearch() is high (> 15) (gocyclo)
    • gitea/routers/repo/view.go
    • Line 128: warning: cyclomatic complexity 60 of function renderDirectory() is high (> 15) (gocyclo)
    • Line 387: warning: cyclomatic complexity 42 of function renderFile() is high (> 15) (gocyclo)
    • Line 58: warning: cyclomatic complexity 26 of function getReadmeFileFromPath() is high (> 15) (gocyclo)
    • gitea/cmd/admin.go
    • Line 635: warning: cyclomatic complexity 19 of function runUpdateOauth() is high (> 15) (gocyclo)
    • Line 365: warning: cyclomatic complexity 18 of function runCreateUser() is high (> 15) (gocyclo)
    • gitea/services/mailer/mail.go
    • Line 360: warning: cyclomatic complexity 21 of function actionToTemplate() is high (> 15) (gocyclo)
    • Line 178: warning: cyclomatic complexity 16 of function composeIssueCommentMessages() is high (> 15) (gocyclo)

ineffassign97%

IneffAssign detects ineffectual assignments in Go code.

    • gitea/integrations/api_repo_topic_test.go
    • Line 44: warning: ineffectual assignment to res (ineffassign)
    • Line 48: warning: ineffectual assignment to res (ineffassign)
    • Line 52: warning: ineffectual assignment to res (ineffassign)
    • Line 65: warning: ineffectual assignment to res (ineffassign)
    • Line 76: warning: ineffectual assignment to res (ineffassign)
    • Line 87: warning: ineffectual assignment to res (ineffassign)
    • Line 98: warning: ineffectual assignment to res (ineffassign)
    • Line 102: warning: ineffectual assignment to res (ineffassign)
    • Line 106: warning: ineffectual assignment to res (ineffassign)
    • Line 122: warning: ineffectual assignment to res (ineffassign)
    • gitea/integrations/api_repo_teams_test.go
    • Line 56: warning: ineffectual assignment to res (ineffassign)
    • Line 61: warning: ineffectual assignment to res (ineffassign)
    • Line 69: warning: ineffectual assignment to res (ineffassign)
    • Line 70: warning: ineffectual assignment to res (ineffassign)
    • Line 75: warning: ineffectual assignment to res (ineffassign)
    • Line 76: warning: ineffectual assignment to res (ineffassign)

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!