Repository Analysis

golang/go

The Go programming language

2.7 Likely human-written View on GitHub
2.7
Adjusted Score
2.7
Raw Score
100%
Time Factor
2026-05-29
Last Push
134,101
Stars
Go
Language
2,571,289
Lines of Code
12115
Files
7169
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 2HIGH 9MEDIUM 83LOW 7075

Pattern Findings

7169 matches across 14 categories. Click a row to expand file-level details.

Over-Commented Block7014 hits · 6434 pts
SeverityFileLineSnippet
LOWtest/fibo.go1// skip
LOWtest/import6.go1// errorcheck
LOWtest/rangegen.go1// runoutput
LOWtest/nilptr_aix.go1// run
LOWtest/import2.go1// compiledir
LOWtest/mergemul.go1// runoutput
LOWtest/mergemul.go41}
LOWtest/live_uintptrkeepalive.go1// errorcheck -0 -m -live -std
LOWtest/nilptr.go1// run
LOWtest/divmod.go1// run
LOWtest/live1.go1// compile
LOWtest/closure3.go1// errorcheckandrundir -0 -m -d=inlfuncswithclosures=1
LOWtest/runtime.go1// errorcheck
LOWtest/linkname3.go21// ERROR "//go:linkname must refer to declared function or variable"
LOWtest/cmplxdivide.c1// Copyright 2010 The Go Authors. All rights reserved.
LOWtest/escape_alias.go1// errorcheck -0 -d=escapealias=1
LOWtest/eof.go1// compile
LOWtest/nosplit.go21 "strconv"
LOWtest/nosplit.go41# Within a stanza, ; can be used instead of \n to separate lines.
LOWtest/eof1.go1// compile
LOWtest/solitaire.go1// build
LOWtest/live.go1// errorcheckwithauto -0 -l -live -wb=0 -d=ssa/insert_resched_checks/off
LOWtest/method4.go1// rundir
LOWtest/inline_sync.go1// errorcheck -0 -m
LOWtest/map.go321 panic(fmt.Sprintf("tuple existence assign: mit[%d]\n", i))
LOWtest/recover4.go1// run
LOWtest/recover.go441 panic(112)
LOWtest/import4.go1// errorcheckdir
LOWtest/closure5.go1// compiledir
LOWtest/interface/private.go1// errorcheckdir
LOWtest/chan/select5.go421// it wants to choose between n possibilities.
LOWtest/chan/powser2.go1// run
LOWtest/chan/powser1.go1// run
LOWtest/chan/powser1.go61 d2[0] = mkdch()
LOWtest/chan/powser1.go561// Exponential of a power series with constant term 0
LOWtest/typeparam/absdiff.go41// For now, a lone type parameter is not permitted as RHS in a type declaration (issue #45639).
LOWtest/typeparam/absdiff.go61// return complexAbs[T](complex(d, 0))
LOWtest/typeparam/absdiff.go81 // if got, want := orderedAbsDifference(-1.0, 2.0), 3.0; got != want {
LOWtest/typeparam/issue47892.go1// rundir
LOWtest/typeparam/boundmethod.go81 // stringify on a normal type, whose bound method is associated with the base type.
LOWtest/typeparam/issue47708.go21// type Bob[T any] T
LOWtest/typeparam/gencrawler.go1// rundir
LOWtest/typeparam/dedup.go1// rundir
LOWtest/typeparam/nested.go1// run
LOWtest/typeparam/nested.go21// From this data it tests two things:
LOWtest/typeparam/issue48094.dir/a.go21// a T
LOWtest/typeparam/absdiffimp.dir/a.go41// // ordered numeric types.
LOWtest/typeparam/absdiffimp.dir/a.go61//
LOWtest/typeparam/absdiffimp.dir/main.go1// Copyright 2021 The Go Authors. All rights reserved.
LOWtest/typeparam/absdiffimp.dir/main.go21 // }
LOWtest/codegen/comparisons.go221 c2 := a^b < 0
LOWtest/codegen/atomics.go21 // arm64/v8.0:"LDADDALW"
LOWtest/codegen/atomics.go41 // arm64/v8.0:".*arm64HasATOMICS"
LOWtest/codegen/atomics.go61}
LOWtest/codegen/atomics.go81 // arm64/v8.1:"LDORALW"
LOWtest/codegen/mapaccess.go21
LOWtest/codegen/mapaccess.go41 // amd64:-".*mapaccess"
LOWtest/codegen/mapaccess.go81 // 386:-".*mapaccess"
LOWtest/codegen/mapaccess.go101 // arm:-".*mapaccess"
LOWtest/codegen/mapaccess.go141 // amd64:-".*mapaccess"
6954 more matches not shown…
AI Slop Vocabulary61 hits · 176 pts
SeverityFileLineSnippet
MEDIUMtest/codegen/comparisons.go309// CMN and CMP for subtraction expressions to make the pattern robust.
LOWsrc/make.bash61# (Or just pass them to the make.bash command line.)
MEDIUMsrc/cmd/go/alldocs.go2285// Consumers should be robust to this.
MEDIUMsrc/cmd/go/internal/work/exec.go2476 // Definitely want -fPIC but on Windows gcc complains
MEDIUMsrc/cmd/trace/pprof.go243// Because slices aren't comparable and we want to leverage maps for deduplication,
MEDIUMsrc/cmd/internal/obj/dwarf.go98 // https://github.com/go-delve/delve/issues/1694), however the bug
LOWsrc/cmd/internal/test2json/testdata/benchshort.json5{"Action":"output","Output":"# but to avoid questions of timing, we just use a file with no \\n at all.\n"}
MEDIUMsrc/cmd/internal/src/pos.go391// Depending on the debugger (gdb or delve) it may or may not be displayed.
MEDIUMsrc/cmd/internal/src/xpos.go73// gdb chooses not to display the bogus line; delve shows it with a complaint, but the
MEDIUMsrc/cmd/compile/internal/noder/reader.go2681 // TODO(mdempsky): Is there a more robust way to get the
MEDIUMsrc/cmd/compile/internal/noder/reader.go2974 // TODO(mdempsky): Is there a more robust way to get the
MEDIUMsrc/cmd/compile/internal/noder/reader.go3073 // TODO(mark): It's not ideal to rely on string naming here. Find a more robust solution.
MEDIUMsrc/cmd/compile/internal/noder/reader.go4256// https://github.com/go-delve/delve/blob/cb91509630529e6055be845688fd21eb89ae8714/pkg/proc/eval.go#L28
MEDIUMsrc/cmd/compile/internal/types2/context_test.go21 // make them robust to internal type assertions, but could equally well use
MEDIUMsrc/cmd/compile/internal/types2/context.go31// Nevertheless, in the future it could be helpful to allow users to leverage
MEDIUMsrc/cmd/compile/internal/ssa/debug.go1884 // #yield is used by delve.
MEDIUMsrc/cmd/compile/internal/ssa/debug.go1884 // #yield is used by delve.
MEDIUMsrc/cmd/compile/internal/ssa/known_bits.go294// We also leverage known bits of the shift amount to remove "branches" in the switch that are proved to be impossible.
MEDIUMsrc/cmd/compile/internal/ssa/dom.go22// This seems to make loop-finding more robust.
MEDIUMsrc/cmd/compile/internal/ssa/debug_test.go50// TestNexting go-builds a file, then uses a debugger (default delve, optionally gdb)
MEDIUMsrc/cmd/compile/internal/ssa/testdata/scopes.go33 for x := 0; x <= 1; x++ { // From delve scopetest.go
MEDIUMsrc/cmd/compile/internal/ssa/testdata/scopes.go51 { // From delve testnextprog.go
MEDIUMsrc/cmd/cgo/out.go1089 // string.h for memset, and is also robust to C++
MEDIUMsrc/cmd/cgo/gcc.go469 // but usually it does. Certainly if we don't see the completed:1 error, we did
MEDIUMsrc/cmd/covdata/tool_test.go29// TestMain used here so that we can leverage the test executable
MEDIUMsrc/cmd/cover/cover_test.go48// TestMain used here so that we can leverage the test executable
MEDIUMsrc/net/dnsclient_unix_test.go1356 // Return NXDOMAIN to utilize the search list.
MEDIUMsrc/net/http/serve_test.go894 // TODO(panjf2000): sleep is not so robust, maybe find a better way to test this?
MEDIUMsrc/go/token/position.go548 // The iterator is robust to modification by yield.
MEDIUMsrc/go/types/context_test.go24 // make them robust to internal type assertions, but could equally well use
MEDIUMsrc/go/types/context.go34// Nevertheless, in the future it could be helpful to allow users to leverage
MEDIUMsrc/go/printer/testdata/parser.go579 // it here for more robust parsing and better error messages
MEDIUMsrc/go/printer/testdata/parser.go637 // accept them all for more robust parsing and complain
MEDIUMsrc/go/internal/gcimporter/gcimporter_test.go173 // the files we consider in an attempt to make this test more robust to
MEDIUMsrc/go/parser/parser.go748 // it here for more robust parsing and better error messages
MEDIUMsrc/runtime/proc.go38// We need to balance between keeping enough running worker threads to utilize
MEDIUMsrc/runtime/metrics.go1027// Broken out for more robust testing. metricsLock must be held and
MEDIUMsrc/runtime/proc_test.go490 // fairly large factor here to make this robust: if the
MEDIUMsrc/runtime/mpagealloc_test.go622 // Test to check for issue #40191. Essentially, the candidate searchAddr
MEDIUMsrc/runtime/mpagealloc_test.go622 // Test to check for issue #40191. Essentially, the candidate searchAddr
MEDIUMsrc/runtime/mgcpacer_test.go404 // Provide a lot of room for the limit. Essentially, this should behave just like
MEDIUMsrc/runtime/export_test.go1677 // a bit more robust.
MEDIUMsrc/runtime/mpagealloc.go165 // This is slightly more nuanced than just a shift for the exclusive
MEDIUMsrc/runtime/symtabinl_test.go48 // this robust.
MEDIUMsrc/runtime/complex.go20 // Algorithm for robust complex division as described in
MEDIUMsrc/runtime/mprof.go965 // Absolutely no data, suggesting that a garbage collection
MEDIUMsrc/runtime/mgcscavenge.go28// Essentially, we wish to have the application's RSS track the heap goal, but
MEDIUMsrc/runtime/pprof/label.go96// Currently only the CPU and goroutine profiles utilize any labels
MEDIUMsrc/internal/trace/gc.go131 // It will show up very early in the trace, but we need to be robust to
MEDIUMsrc/internal/trace/event.go839// may be tracked in the future, and callers must be robust to this
MEDIUMsrc/internal/trace/resources.go35// New GoStates may be added in the future. Users of this type must be robust
MEDIUMsrc/internal/trace/resources.go77// New ProcStates may be added in the future. Users of this type must be robust
MEDIUMsrc/internal/trace/resources.go113// New ResourceKinds may be added in the future. Users of this type must be robust
MEDIUMsrc/internal/trace/value.go32// New ValueKinds may be added in the future. Users of this type must be robust
MEDIUMsrc/internal/runtime/gc/scan/mkasm.go128 // shuffle those bytes together. Certainly for f >= 16 this makes sense
MEDIUMsrc/simd/archsimd/_gen/unify/closure.go119 // Essentially the same as Def.
LOW…d/archsimd/_gen/simdgen/ops/BitwiseLogic/go_amd64.yaml28# for unmasked operations, right now we don't realize that we can just use the
MEDIUMsrc/time/time.go32// time.Now().Before(deadline), are similarly robust against wall clock
MEDIUMsrc/testing/testing.go117// statistically robust A/B comparisons.
MEDIUMsrc/testing/testing.go147// New benchmarks should prefer using [B.Loop], which is more robust
1 more matches not shown…
Synthetic Comment Markers9 hits · 68 pts
SeverityFileLineSnippet
HIGHsrc/cmd/asm/internal/asm/parse.go1721// at reports whether the next tokens are as requested.
HIGHsrc/cmd/go/internal/modload/load.go1229 // add them as requested.
HIGHsrc/cmd/go/internal/modload/load.go1823 // add them as requested.
HIGHsrc/cmd/internal/obj/util.go745// AlignmentPadding bytes to add to align code as requested.
HIGHsrc/cmd/internal/obj/util.go760// AlignmentPaddingLength is the number of bytes to add to align code as requested.
HIGHsrc/cmd/internal/obj/ppc64/asm9.go590// padding bytes to add to align code as requested.
HIGHsrc/cmd/compile/internal/ssa/debug_test.go711 // Normalize value as requested.
HIGHsrc/crypto/internal/sysrand/rand_netbsd.go13 // as many as requested up to 256, derived from the system entropy pool;
HIGHsrc/fmt/print.go405// not, as requested, by temporarily setting the sharp flag.
Decorative Section Separators15 hits · 51 pts
SeverityFileLineSnippet
MEDIUMsrc/cmd/go/testdata/script/cover_build_pkg_select.txt6#-------------------------------------------
MEDIUMsrc/cmd/go/testdata/script/cover_build_pkg_select.txt37#-------------------------------------------
MEDIUMsrc/cmd/go/testdata/script/cover_build_pkg_select.txt79#-------------------------------------------
MEDIUM…go/testdata/script/cgo_suspect_flag_force_external.txt29#-----------------------
MEDIUMsrc/cmd/compile/internal/ssa/looprotate.go68 // │ │ └─►It─┘ │ │ │ └─────┘ │
MEDIUMsrc/cmd/compile/internal/ssa/looprotate.go71 // │ └─►Ot───┘ │ └───────┘
MEDIUMsrc/crypto/cipher/gcm.go142 // ┌───────────────────────────┬ ─ ─
MEDIUMsrc/crypto/cipher/gcm.go144 // └▽─────────────────────────▲┴ ─ ─
MEDIUMsrc/crypto/cipher/gcm.go147 // ┌───▼─────────────────────────△──┐
MEDIUMsrc/crypto/cipher/gcm.go149 // └────────────────────────────────┘
MEDIUMsrc/runtime/mprof.go107 // ┠┅┅┅┅┅┅┅┅┅┅┅P
MEDIUMsrc/runtime/mprof.go111 // ┠┅┅┅┅┅┅┅┅┅┅┅P
MEDIUMsrc/encoding/json/jsontext/token.go65 // ╔══════════════════╦════════════╤════════════╤════════════╗
MEDIUMsrc/encoding/json/jsontext/token.go67 // ╠══════════════════╬════════════╪════════════╪════════════╣
MEDIUMsrc/encoding/json/jsontext/token.go80 // ╚══════════════════╩════════════╧════════════╧════════════╝
Fake / Example Data28 hits · 32 pts
SeverityFileLineSnippet
LOWsrc/compress/flate/deflate_test.go466 dict = "hello world Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labor
LOWsrc/compress/flate/deflate_test.go466 dict = "hello world Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labor
LOWsrc/compress/flate/deflate_test.go467 text = "hello world again Lorem ipsum dolor sit amet"
LOWsrc/compress/flate/deflate_test.go467 text = "hello world again Lorem ipsum dolor sit amet"
LOWsrc/compress/flate/inflate_test.go17 "lorem ipsum izzle fo rizzle",
LOWsrc/compress/flate/inflate_test.go73 "lorem ipsum izzle fo rizzle",
LOWsrc/compress/gzip/fuzz_test.go18 inp := []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et d
LOWsrc/compress/gzip/fuzz_test.go18 inp := []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et d
LOWsrc/compress/lzw/writer_test.go118 data = []byte(`lorem ipsum dolor sit amet`)
LOWsrc/compress/lzw/writer_test.go118 data = []byte(`lorem ipsum dolor sit amet`)
LOWsrc/compress/zlib/writer_test.go210 var input = []byte("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labor
LOWsrc/compress/zlib/writer_test.go210 var input = []byte("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labor
LOWsrc/net/mail/message_test.go381 7: {"John Doe", "no angle-addr"},
LOWsrc/net/mail/message_test.go436 Name: "John Doe",
LOWsrc/net/mail/message_test.go452 Name: "John Doe",
LOWsrc/net/mail/message_test.go740 Name: "John Doe",
LOWsrc/net/mail/message_test.go750 Name: "John Doe",
LOWsrc/net/mail/message_test.go760 Name: "John Doe",
LOWsrc/net/mail/message_test.go825 Name: "John Doe",
LOWsrc/net/mail/message_test.go869 Name: "John Doe",
LOWsrc/net/mail/message_test.go989 Name: "John Doe",
LOWsrc/net/smtp/example_test.go60 auth := smtp.PlainAuth("", "user@example.com", "password", hostname)
LOWsrc/net/smtp/example_test.go70 auth := smtp.PlainAuth("", "user@example.com", "password", "mail.example.com")
LOWsrc/archive/tar/fuzz_test.go16 inp := []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et d
LOWsrc/archive/tar/fuzz_test.go16 inp := []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et d
LOWsrc/encoding/xml/atom_test.go14 Author: Person{Name: "John Doe"},
LOWsrc/encoding/xml/marshal_test.go534 contentsAttr = "lorem ipsum"
LOWsrc/encoding/xml/marshal_test.go1059 ExpectXML: `<dummy name="Sarah" age="12">lorem ipsum</dummy>`,
Slop Phrases12 hits · 25 pts
SeverityFileLineSnippet
MEDIUMsrc/cmd/internal/obj/dwarf.go30// It's worth noting that this function doesn't generate the full debug_lines
LOWsrc/cmd/compile/internal/ir/func.go55 // if you add or remove a field, don't forget to update sizeof_test.go
LOWsrc/cmd/compile/internal/base/debug.go15// Don't forget to note that concurrency is "ok" when it is,
LOWsrc/bufio/example_test.go20 w.Flush() // Don't forget to flush!
LOWsrc/net/http/example_test.go30 // Don't forget to close the connection:
LOWsrc/net/http/internal/httpcommon/httpcommon.go554 // but this ensures we don't forget to include a CountError reason.
MEDIUMsrc/net/rpc/server.go58Here is a simple example. A server wishes to export an object of type Arith:
MEDIUMsrc/runtime/arena.go744 // assist the GC proportionally (and it's worth noting that the arena
MEDIUMsrc/runtime/metrics/doc.go39As mentioned earlier, metric keys are strings. Their format is simple and well-defined,
MEDIUMsrc/internal/syscall/windows/registry/key.go9// Here is a simple example, opening a registry key and reading a string value from it.
MEDIUMsrc/os/file.go16// Here is a simple example, opening a file and reading some of it.
MEDIUMsrc/text/template/doc.go463constant. Here is a simple example:
Hallucination Indicators2 hits · 20 pts
SeverityFileLineSnippet
CRITICAL…c/cmd/compile/internal/test/testdata/addressed_test.go129 if which != v3.p.p.p.p.p.p.p.val() {
CRITICAL…c/cmd/compile/internal/test/testdata/addressed_test.go130 output += fmt.Sprintln("Expected which=", which, "got v3.p.p.p.p.p.p.p.val()=", v3.p.p.p.p.p.p.p.val())
Verbosity Indicators8 hits · 16 pts
SeverityFileLineSnippet
LOWsrc/cmd/compile/internal/ssa/shortcircuit.go12 // Step 1: Replace a phi arg with a constant if that arg
LOWsrc/cmd/compile/internal/ssa/shortcircuit.go53 // Step 2: Redirect control flow around known branches.
LOWsrc/net/http/server.go1156// The purpose of this function is to provide more helpful error messages.
LOWsrc/runtime/secret/secret.go74 // Step 1: increment the nesting count.
LOWsrc/runtime/secret/secret.go77 // Step 2: call helper. The helper just calls f
LOWsrc/runtime/secret/secret.go81 // Step 3: erase everything used by f (stack, registers).
LOWsrc/runtime/secret/secret.go84 // Step 4: decrement the nesting count.
LOWsrc/runtime/secret/secret.go87 // Step 5: re-raise any caught panic.
Example Usage Blocks6 hits · 9 pts
SeverityFileLineSnippet
LOWlib/hg/goreposum.py24# Usage:
LOWsrc/database/sql/sql.go105// Example usage:
LOWsrc/database/sql/sql.go478// Example usage:
LOWsrc/database/sql/sql.go2877// Example usage:
LOWsrc/encoding/json/v2/options.go86// Example usage:
LOWsrc/encoding/json/jsontext/encode.go905// Example usage:
Excessive Try-Catch Wrapping7 hits · 9 pts
SeverityFileLineSnippet
LOWsrc/runtime/runtime-gdb.py36 except Exception:
LOWsrc/runtime/runtime-gdb.py322 except Exception:
LOWsrc/runtime/runtime-gdb.py445 except Exception:
LOWsrc/runtime/runtime-gdb.py454 except Exception:
LOWsrc/runtime/runtime-gdb.py673 except Exception as e:
MEDIUMsrc/runtime/runtime-gdb.py33def read_runtime_const(varname, default):
MEDIUMsrc/runtime/runtime-gdb.py316def matcher(val):
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMsrc/simd/archsimd/_gen/simdgen/types.yaml1# This file defines the possible types of each operand and result.
Redundant / Tautological Comments2 hits · 3 pts
SeverityFileLineSnippet
LOWsrc/syscall/mksyscall_libc.pl166 # Check if err return available
LOWsrc/syscall/mksyscall.pl155 # Check if err return available
Unused Imports2 hits · 2 pts
SeverityFileLineSnippet
LOWlib/hg/goreposum.py28
LOWsrc/runtime/runtime-gdb.py18
Deep Nesting2 hits · 2 pts
SeverityFileLineSnippet
LOWsrc/runtime/runtime-gdb.py166
LOWsrc/runtime/runtime-gdb.py478