Function with cyclomatic complexity higher than threshold GO-R1005
Anti-pattern
Minor
3 months ago3 months old
func handleServerConn has a cyclomatic complexity of 17 with "high" risk
 34	return cmd[i:]
 35}
 36
 37func handleServerConn(keyID string, chans <-chan ssh.NewChannel) { 38	for newChan := range chans {
 39		if newChan.ChannelType() != "session" {
 40			_ = newChan.Reject(ssh.UnknownChannelType, "unknown channel type")
func renderFile has a cyclomatic complexity of 24 with "high" risk
119	}
120}
121
122func renderFile(c *context.Context, entry *git.TreeEntry, treeLink, rawLink string) {123	c.Data["IsViewFile"] = true
124
125	blob := entry.Blob()
func renderDirectory has a cyclomatic complexity of 17 with "high" risk
 33	FORKS    = "repo/forks"
 34)
 35
 36func renderDirectory(c *context.Context, treeLink string) { 37	tree, err := c.Repo.Commit.Subtree(c.Repo.TreePath)
 38	if err != nil {
 39		c.NotFoundOrError(gitutil.NewError(err), "get subtree")
func Releases has a cyclomatic complexity of 19 with "high" risk
 46	return nil
 47}
 48
 49func Releases(c *context.Context) { 50	c.Data["Title"] = c.Tr("repo.release.releases")
 51	c.Data["PageIsViewFiles"] = true
 52	c.Data["PageIsReleaseList"] = true
func editFilePost has a cyclomatic complexity of 30 with "very-high" risk
119	editFile(c, true)
120}
121
122func editFilePost(c *context.Context, f form.EditRepoFile, isNewFile bool) {123	c.PageIs("Edit")
124	c.RequireHighlightJS()
125	c.RequireSimpleMDE()