The Official Golang driver for MongoDB
This report summarizes scanner evidence for mongodb/mongo-go-driver, a Go project with 8,540 GitHub stars. SynthScan examined 221,877 lines of code across 722 source files, recording 296 pattern matches distributed across 10 syntactic categories. The legacy adjusted pattern signal is 1.4 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 283 finding(s).
Are imports declared and package/API names verified? 13 finding(s).
Are wrappers, guards, and repeated structures necessary? 0 finding(s).
Which changes need focused human review? 296 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 296 distinct pattern matches across 10 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | bson/raw_value.go | 121 | // String implements the fmt.String interface. This method will return values in extended JSON | COMMENT |
| LOW | bson/marshal.go | 21 | } | COMMENT |
| LOW | bson/marshal.go | 61 | // the same memory cost. To obtain this property when the stored type | COMMENT |
| LOW | bson/marshal.go | 101 | // the same memory cost. To obtain this property when the stored type | COMMENT |
| LOW | bson/encoder.go | 101 | // NilByteSliceAsEmpty causes the Encoder to marshal nil Go byte slices as empty BSON binary values | COMMENT |
| LOW | bson/mgoregistry.go | 101 | } | COMMENT |
| LOW | bson/unmarshal.go | 1 | // Copyright (C) MongoDB, Inc. 2017-present. | COMMENT |
| LOW | bson/unmarshal.go | 21 | // implement the ValueUnmarshaler interface instead. | COMMENT |
| LOW | bson/objectid.go | 101 | var buf [24]byte | COMMENT |
| LOW | bson/objectid.go | 141 | COMMENT | |
| LOW | bson/registry.go | 41 | // errNoTypeMapEntry is returned when there wasn't a type available for the provided BSON type. | COMMENT |
| LOW | bson/registry.go | 61 | // 2. Interface encoders/decoders - These can be registered using the RegisterInterfaceEncoder and | COMMENT |
| LOW | bson/registry.go | 121 | // RegisterTypeDecoder registers the provided ValueDecoder for the provided type. | COMMENT |
| LOW | bson/registry.go | 141 | // | COMMENT |
| LOW | bson/registry.go | 221 | // reg.RegisterTypeMapEntry(TypeEmbeddedDocument, reflect.TypeOf(bson.Raw{})) | COMMENT |
| LOW | bson/registry.go | 301 | // 2. A decoder registered using RegisterInterfaceDecoder for an interface implemented by the type or by | COMMENT |
| LOW | bson/struct_tag_parser.go | 1 | // Copyright (C) MongoDB, Inc. 2017-present. | COMMENT |
| LOW | bson/struct_tag_parser.go | 21 | // The properties are defined below: | COMMENT |
| LOW | bson/struct_tag_parser.go | 41 | MinSize bool | COMMENT |
| LOW | bson/struct_tag_parser.go | 61 | // A bool | COMMENT |
| LOW | bson/writer.go | 1 | // Copyright (C) MongoDB, Inc. 2017-present. | COMMENT |
| LOW | bson/doc.go | 1 | // Copyright (C) MongoDB, Inc. 2017-present. | COMMENT |
| LOW | bson/doc.go | 21 | // | COMMENT |
| LOW | bson/doc.go | 41 | // 15. BSON 128-bit decimal unmarshals to an bson.Decimal128. | COMMENT |
| LOW | bson/doc.go | 61 | // # Structs | COMMENT |
| LOW | bson/doc.go | 81 | // field, followed by a comma-separated list of options. The name may be omitted in order to specify options without | COMMENT |
| LOW | bson/doc.go | 101 | // 4. inline: If the inline struct tag is specified for a struct or map field, the field will be "flattened" when | COMMENT |
| LOW | bson/doc.go | 121 | // if err != nil { return err } | COMMENT |
| LOW | bson/streaming_byte_src.go | 1 | // Copyright (C) MongoDB, Inc. 2025-present. | COMMENT |
| LOW | bson/extjson_tables.go | 1 | // Copyright (C) MongoDB, Inc. 2017-present. | COMMENT |
| LOW | bson/mgocompat/doc.go | 1 | // Copyright (C) MongoDB, Inc. 2022-present. | COMMENT |
| LOW | bson/mgocompat/doc.go | 21 | // 2) Registry does not have special handling for marshaling array ops ("$in", "$nin", "$all"). | COMMENT |
| LOW | bson/mgocompat/doc.go | 41 | // | COMMENT |
| LOW | .evergreen/run-mongodb-aws-ecs-test.sh | 21 | COMMENT | |
| LOW | .evergreen/config.yml | 1 | ######################################## | COMMENT |
| LOW | ext/awsauth/doc.go | 1 | // Copyright (C) MongoDB, Inc. 2017-present. | COMMENT |
| LOW | ext/awsauth/doc.go | 21 | // adapts to the driver's options.AWSCredentialsProvider interface structurally: | COMMENT |
| LOW | ext/awsauth/doc.go | 41 | // (https://go.dev/ref/mod#minimal-version-selection) means an application | COMMENT |
| LOW | etc/setup-cse-dev.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | etc/setup-cse-dev.sh | 41 | PKG_CONFIG="$(pwd)/etc/libmongocrypt-pkg-config.sh" | COMMENT |
| LOW | etc/libmongocrypt-pkg-config.sh | 1 | #!/bin/sh | COMMENT |
| LOW | etc/gen-ec-certs/gen-ec-certs.sh | 21 | # Generate Server certificate ... begin | COMMENT |
| LOW | internal/cmd/testsfp/main.go | 1 | // Copyright (C) MongoDB, Inc. 2026-present. | COMMENT |
| LOW | internal/ptrutil/int64.go | 1 | // Copyright (C) MongoDB, Inc. 2023-present. | COMMENT |
| LOW | internal/randutil/jitter.go | 1 | // Copyright (C) MongoDB, Inc. 2022-present. | COMMENT |
| LOW | internal/logger/logger.go | 101 | } | COMMENT |
| LOW | internal/logger/level.go | 1 | // Copyright (C) MongoDB, Inc. 2023-present. | COMMENT |
| LOW | internal/test/awsauth/mongodb_aws_prose_test.go | 21 | ) | COMMENT |
| LOW | internal/test/awsauth/mongodb_aws_prose_test.go | 201 | // --------------------------------------------------------------------------- | COMMENT |
| LOW | internal/test/awsauth/mongodb_aws_prose_test.go | 221 | } | COMMENT |
| LOW | internal/test/awsauth/mongodb_aws_prose_test.go | 241 | runScenarioTests(t, rawURI, credsFromURI(t, rawURI)) | COMMENT |
| LOW | internal/test/awsauth/mongodb_aws_prose_test.go | 261 | // Sample URIs both with and without optional session tokens set are shown | COMMENT |
| LOW | internal/test/prose/doc.go | 1 | // Copyright (C) MongoDB, Inc. 2026-present. | COMMENT |
| LOW | internal/integration/handshake_test.go | 1221 | // metadata value to make the tests more reliable and prevent | COMMENT |
| LOW | internal/integration/sdam_prose_test.go | 41 | heartbeatIntervalClientOpts := options.Client(). | COMMENT |
| LOW | …nal/integration/initial_dns_seedlist_discovery_test.go | 221 | // Because the Go driver tests can be run either against a server with SSL enabled or without, a | COMMENT |
| LOW | internal/integration/clam_prose_test.go | 161 | COMMENT | |
| LOW | internal/integration/clam_prose_test.go | 221 | mt := mtest.New(t, mtest.NewOptions().CreateClient(false)) | COMMENT |
| LOW | internal/integration/main.go | 1 | // Copyright (C) MongoDB, Inc. 2017-present. | COMMENT |
| LOW | internal/integration/mtest/mongotest.go | 501 | } | COMMENT |
| 199 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | .evergreen/config.yml | 44 | # Define an alias for the task runner script. | COMMENT |
| MEDIUM | etc/profile-test.sh | 5 | # Create a temporary file to store the profile or trace data. Trap the exit | COMMENT |
| MEDIUM | etc/run-oidc-remote-test.sh | 20 | # Define the command to run on the azure VM. | COMMENT |
| MEDIUM | etc/run-oidc-remote-test.sh | 28 | # Define the command to run on the gcp VM. | COMMENT |
| MEDIUM | etc/run-fuzz.sh | 32 | # Create a set of directories that are already in the subdirectories testdata/fuzz/$fuzzer corpus. This | COMMENT |
| MEDIUM | etc/run-fuzz.sh | 55 | # Create the directory if it doesn't exist. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | bson/testdata/lorem.txt | 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc hendrerit nibh eu lorem scelerisque iaculis. Mauris tincid | CODE |
| LOW | bson/testdata/lorem.txt | 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc hendrerit nibh eu lorem scelerisque iaculis. Mauris tincid | CODE |
| LOW | …ernal/integration/client_side_encryption_prose_test.go | 361 | Username: "fake-user", | CODE |
| LOW | x/mongo/driver/compression_test.go | 33 | payload := []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt") | CODE |
| LOW | x/mongo/driver/compression_test.go | 33 | payload := []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt") | CODE |
| LOW | x/mongo/driver/compression_test.go | 117 | payload := []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit") | CODE |
| LOW | x/mongo/driver/compression_test.go | 117 | payload := []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit") | CODE |
| LOW | x/mongo/driver/batches_test.go | 22 | []byte("Lorem ipsum dolor sit amet"), | CODE |
| LOW | x/mongo/driver/batches_test.go | 22 | []byte("Lorem ipsum dolor sit amet"), | CODE |
| LOW | x/mongo/driver/batches_test.go | 52 | dst = append(dst, "Lorem ipsum dolor sit amet"...) | CODE |
| LOW | x/mongo/driver/batches_test.go | 52 | dst = append(dst, "Lorem ipsum dolor sit amet"...) | CODE |
| LOW | x/mongo/driver/batches_test.go | 71 | dst = bsoncore.AppendDocumentElement(dst, "0", []byte("Lorem ipsum dolor sit amet")) | CODE |
| LOW | x/mongo/driver/batches_test.go | 71 | dst = bsoncore.AppendDocumentElement(dst, "0", []byte("Lorem ipsum dolor sit amet")) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | bson/raw_value.go | 139 | // NOTE: This method is called StringValue to avoid a collision with the String method which | COMMENT |
| LOW | internal/docexamples/examples.go | 1985 | // Step 1: Define the callback that specifies the sequence of operations to perform inside the transaction. | COMMENT |
| LOW | internal/docexamples/examples.go | 1999 | // Step 2: Start a session and run the callback using WithTransaction. | COMMENT |
| LOW | x/bsonx/bsoncore/value.go | 469 | // NOTE: This method is called StringValue to avoid a collision with the String method which | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | bson/primitive.go | 197 | // Example usage: | COMMENT |
| LOW | bson/primitive.go | 269 | // Example usage: | COMMENT |
| LOW | bson/primitive.go | 284 | // Example usage: | COMMENT |
| LOW | mongo/mongo.go | 37 | // Example usage: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | etc/check_license.sh | 14 | # Check if first 24 bytes match first 24 bytes of copyright notice. | COMMENT |
| LOW | etc/check_license.sh | 24 | # Check if first 14 bytes matches the prefix "// Copied from" | COMMENT |
| LOW | etc/run-fuzz.sh | 46 | # Check if any new corpus files were generated for the fuzzer. If there are new corpus files, move them | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/custom_dns/custom_dns.go | 27 | // TODO: Handle error. | COMMENT |
| LOW | examples/custom_dns/custom_dns.go | 72 | // TODO: Handle error. | COMMENT |
| LOW | examples/custom_dns/custom_dns.go | 77 | // TODO: Handle error. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | internal/logger/logger.go | 111 | // It's worth noting that many structured logs defined by DBX-wide | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | internal/docexamples/examples.go | 1985 | // Step 1: Define the callback that specifies the sequence of operations to perform inside the transaction. | COMMENT |
| LOW | internal/docexamples/examples.go | 1999 | // Step 2: Start a session and run the callback using WithTransaction. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | x/mongo/driver/topology/pool_test.go | 1234 | // be made robust without replacing time.Sleep with explicit synchronization, | COMMENT |