MongoDB object modeling designed to work in an asynchronous environment.
This report summarizes scanner evidence for Automattic/mongoose, a JavaScript project with 27,461 GitHub stars. SynthScan examined 227,132 lines of code across 654 source files, recording 150 pattern matches distributed across 7 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? 98 finding(s).
Are imports declared and package/API names verified? 52 finding(s).
Are wrappers, guards, and repeated structures necessary? 85 finding(s).
Which changes need focused human review? 150 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 150 distinct pattern matches across 7 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 |
|---|---|---|---|---|
| CRITICAL | test/model.discriminator.test.js | 2120 | assert.equal(Triangle.schema.s.hooks._pres.get('save').filter(hook => hook.fn.name === 'testHook12472').length, 2); | CODE |
| CRITICAL | test/model.discriminator.test.js | 2121 | assert.equal(Square.schema.s.hooks._pres.get('save').filter(hook => hook.fn.name === 'testHook12472').length, 1); | CODE |
| CRITICAL | test/model.discriminator.test.js | 2151 | assert.equal(Triangle.schema.s.hooks._pres.get('save').filter(hook => hook.fn.name === 'testHook12604').length, 2); | CODE |
| CRITICAL | test/model.discriminator.test.js | 2152 | assert.equal(Square.schema.s.hooks._pres.get('save').filter(hook => hook.fn.name === 'testHook12604').length, 1); | CODE |
| CRITICAL | test/model.populate.test.js | 11965 | assert.deepStrictEqual(obj.rubric.parameters.param1.evaluationPrompts.map(prompt => prompt.name), ['Test Prompt', 'T | CODE |
| CRITICAL | test/model.populate.test.js | 11966 | assert.deepStrictEqual(obj.rubric.parameters.param2.evaluationPrompts.map(prompt => prompt.name), ['Test Prompt 3']) | CODE |
| CRITICAL | test/document.test.js | 6260 | mongoose.Schema.Types.Boolean.convertToTrue.add('aye'); | CODE |
| CRITICAL | test/document.test.js | 6261 | mongoose.Schema.Types.Boolean.convertToFalse.add('nay'); | CODE |
| CRITICAL⚡ | test/document.test.js | 6273 | mongoose.Schema.Types.Boolean.convertToTrue.delete('aye'); | CODE |
| CRITICAL⚡ | test/document.test.js | 6274 | mongoose.Schema.Types.Boolean.convertToFalse.delete('nay'); | CODE |
| CRITICAL⚡ | test/document.test.js | 6282 | mongoose.Schema.Types.Boolean.convertToFalse.add(null); | CODE |
| CRITICAL | test/docs/transactions.test.js | 25 | !db.client.topology.s.description.type.includes('ReplicaSet')) { | CODE |
| CRITICAL | docs/schematypes.md | 464 | mongoose.Schema.Types.Boolean.convertToFalse.add('nay'); | CODE |
| CRITICAL | lib/schema/boolean.js | 177 | * mongoose.Schema.Types.Boolean.convertToTrue.add('affirmative'); | COMMENT |
| CRITICAL | lib/schema/boolean.js | 199 | * mongoose.Schema.Types.Boolean.convertToFalse.add('nay'); | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | types/index.d.ts | 1232 | export function overwriteMiddlewareResult(val: any): Kareem.OverwriteResult; | CODE |
| LOW | types/index.d.ts | 1236 | export function overwriteMiddlewareArguments(val: any): Kareem.OverwriteArguments; | CODE |
| LOW | test/document.populate.test.js | 846 | beforeEach(function setupVirtualPopulateModels() { | CODE |
| LOW | test/document.populate.test.js | 900 | beforeEach(function setupEmbeddedGetterPopulateModels() { | CODE |
| LOW | test/model.middleware.test.js | 388 | it('static hooks async stack traces (gh-15317) (gh-5982)', async function staticHookAsyncStackTrace() { | CODE |
| LOW | test/model.discriminator.querying.test.js | 155 | async function checkHydratesCorrectModels(fields) { | CODE |
| LOW | test/model.discriminator.querying.test.js | 399 | async function checkHydratesCorrectModels(fields, checkUndefinedRevenue) { | CODE |
| LOW | test/model.test.js | 10298 | function generateRandomCollectionName() { | CODE |
| LOW | test/model.updateOne.test.js | 3381 | function getPaymentWithDotSeparatedPaths() { | CODE |
| LOW | test/model.updateOne.test.js | 3755 | function createDollarPathTestContext() { | CODE |
| LOW | test/document.test.js | 14954 | it('works with save() validation errors', async function asyncSaveValidationErrors() { | CODE |
| LOW | test/document.test.js | 15122 | it('works with async pre deleteOne errors on subdocuments', async function asyncSubdocPreDeleteOneErrors() { | CODE |
| LOW | test/document.test.js | 15220 | it('works with aggregate server errors', async function asyncAggregateServerErrors() { | CODE |
| LOW | test/encryptedSchema.test.js | 17 | function schemaHasEncryptedProperty(schema, path) { | CODE |
| LOW | test/model.insertMany.test.js | 834 | it('async stack traces with server error (gh-15317)', async function insertManyWithServerError() { | CODE |
| LOW | test/types/schema.test.ts | 1997 | function testInferRawDocTypeFromSchema() { | CODE |
| LOW | test/types/schema.test.ts | 2019 | function testInferHydratedDocTypeFromSchema() { | CODE |
| LOW | test/types/schema.test.ts | 2110 | function testNewSchemaWithMethodsAndVirtuals() { | CODE |
| LOW | test/types/schema.test.ts | 2370 | function allowNullFalseInferredTypes() { | CODE |
| LOW | test/types/schema.test.ts | 2409 | function staticReturnsSchemaWithStaticAdded() { | CODE |
| LOW | test/types/document.test.ts | 201 | function autoTypedDocumentConnection() { | CODE |
| LOW | test/types/document.test.ts | 710 | function autoInferredWithCustomVersionKey() { | CODE |
| LOW | test/types/document.test.ts | 775 | function withoutSchemaLevelOptions() { | CODE |
| LOW | test/types/document.test.ts | 807 | function withCustomVersionKeyAndSchemaToObject() { | CODE |
| LOW | test/types/document.test.ts | 876 | function testCombinedFlattenOptions() { | CODE |
| LOW | test/types/models.test.ts | 56 | async function standardSchemaModelValidate(): Promise<void> { | CODE |
| LOW | test/types/models.test.ts | 100 | async function modelValidateReturnsCastedObject(): Promise<void> { | CODE |
| LOW | test/types/models.test.ts | 436 | async function overwriteBulkWriteContents() { | CODE |
| LOW | test/types/models.test.ts | 543 | function schemaInstanceMethodsAndQueryHelpers() { | CODE |
| LOW⚡ | test/types/models.test.ts | 1258 | async function customModelInstanceWithStatics() { | CODE |
| LOW | test/types/base.test.ts | 113 | function baseConnectionAndCollection() { | CODE |
| LOW | test/types/schemaTypeOptions.test.ts | 37 | function validatorMessageFunctions() { | CODE |
| LOW | test/types/create.test.ts | 133 | async function createWithAggregateErrors() { | CODE |
| LOW | test/types/connection.test.ts | 115 | function schemaInstanceMethodsAndQueryHelpersOnConnection() { | CODE |
| LOW | test/types/schema.create.test.ts | 1890 | function testInferRawDocTypeFromSchema() { | CODE |
| LOW | test/types/schema.create.test.ts | 1914 | async function testInferHydratedDocTypeFromSchema() { | CODE |
| LOW | test/types/schema.create.test.ts | 2039 | function allowNullFalseInferredTypes() { | CODE |
| LOW | docs/js/sidebar-collapse.js | 4 | function scrollActiveSidebarLinkIntoView() { | CODE |
| LOW | docs/source/api.js | 248 | function normalizeMarkdownDescription(description) { | CODE |
| LOW | lib/aggregate.js | 1087 | return traceAggregate(async function maybeTracedConnectionAggregate() { | CODE |
| LOW | lib/query.js | 3449 | function prepareDiscriminatorCriteria(query) { | CODE |
| LOW | lib/query.js | 4026 | function convertNewToReturnDocument(options) { | CODE |
| LOW | lib/queryHelpers.js | 27 | exports.preparePopulationOptionsMQ = function preparePopulationOptionsMQ(query, options) { | CODE |
| LOW | lib/connection.js | 1678 | Connection.prototype.authMechanismDoesNotRequirePassword = function authMechanismDoesNotRequirePassword() { | CODE |
| LOW | lib/connection.js | 1696 | Connection.prototype.optionsProvideAuthenticationData = function optionsProvideAuthenticationData(options) { | CODE |
| LOW | lib/document.js | 4731 | function applySchemaTypeTransforms(self, json) { | CODE |
| LOW | lib/cursor/queryCursor.js | 330 | return cursorNextChannel.trace(function maybeTracedQueryCursorNext() { | CODE |
| LOW | lib/plugins/trackTransaction.js | 17 | function trackTransactionPreDeleteOne() { | CODE |
| LOW | lib/plugins/sharding.js | 32 | function shardingPluginPreDeleteOne() { | CODE |
| LOW | lib/plugins/sharding.js | 36 | function shardingPluginPreUpdateOne() { | CODE |
| LOW | lib/schema/array.js | 657 | function createLogicalQueryOperatorHandler(op) { | CODE |
| LOW | lib/schema/array.js | 658 | return function logicalQueryOperatorHandler(val, context) { | CODE |
| LOW | lib/schema/string.js | 737 | function formatMaxLengthValidatorMessage(msg) { | CODE |
| LOW | lib/schema/documentArrayElement.js | 27 | function SchemaDocumentArrayElement(path, schema, options, parentSchema) { | CODE |
| LOW | lib/helpers/buildMiddlewareFilter.js | 30 | function middlewareFiltersFromLastArg(args) { | CODE |
| LOW | lib/helpers/getDefaultBulkwriteResult.js | 3 | function getDefaultBulkwriteResult() { | CODE |
| LOW | lib/helpers/update/castArrayFilters.js | 34 | function castArrayFiltersForUpdate(arrayFilters, update, schema, model, options, context) { | CODE |
| LOW | lib/helpers/update/applyTimestampsToChildren.js | 12 | function applyTimestampsToChildren(now, update, schema) { | CODE |
| LOW | lib/helpers/update/applyTimestampsToChildren.js | 82 | function applyTimestampsToDocumentArray(arr, schematype, now) { | CODE |
| LOW | lib/helpers/update/applyTimestampsToChildren.js | 108 | function applyTimestampsToSingleNested(subdoc, schematype, now) { | CODE |
| 25 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/document.populate.test.js | 939 | const createdTeam = await Team.create({ captain: 'John Doe', players: [{ player: 'John Doe' }, { player: 'Foo Bar' | CODE |
| LOW | test/model.discriminator.test.js | 396 | employee.name.full = 'John Doe'; | CODE |
| LOW | test/model.discriminator.test.js | 397 | assert.equal(employee.name.full, 'John Doe'); | CODE |
| LOW | test/model.test.js | 7661 | userToUpdate.name = 'John Doe'; | CODE |
| LOW | test/model.test.js | 7683 | userToUpdate.name = 'John Doe'; | CODE |
| LOW | test/model.test.js | 7705 | userToUpdate.name = 'John Doe'; | CODE |
| LOW | test/model.test.js | 8581 | userToUpdate.name = 'John Doe'; | CODE |
| LOW | test/model.test.js | 8608 | userToUpdate.name = 'John Doe'; | CODE |
| LOW | test/model.test.js | 8630 | userToUpdate.name = 'John Doe'; | CODE |
| LOW | test/model.populate.test.js | 6573 | await User.create({ id: 111, name: 'John Doe' }); | CODE |
| LOW | test/model.populate.test.js | 6592 | assert.equal(doc.outer.inner.flexible[0].users_$[0].name, 'John Doe'); | CODE |
| LOW | test/model.populate.test.js | 8445 | const user = await User.create({ fullName: 'John Doe', companyId: company._id }); | CODE |
| LOW | test/model.populate.test.js | 8499 | const user = await User.create({ fullName: 'John Doe', company: 'GitHub' }); | CODE |
| LOW | test/model.populate.test.js | 11346 | email: 'admin@example.com', | CODE |
| LOW | test/model.populate.test.js | 11574 | await Author.create({ group: 'AUTH1', name: 'John Doe' }); | CODE |
| LOW | test/document.test.js | 814 | const post = await Post.create({ owner: savedUser._id, content: 'lorem ipsum' }); | CODE |
| LOW | test/document.test.js | 1119 | company: { companyName: 'Acme Inc' } | CODE |
| LOW | test/document.test.js | 2836 | username: 'John Doe', | CODE |
| LOW | test/document.test.js | 2841 | username: 'John Doe', | CODE |
| LOW | test/document.test.js | 5301 | title: 'Lorem Ipsum Dolor', | CODE |
| LOW | test/document.test.js | 5409 | title: 'Lorem Ipsum Dolor', | CODE |
| LOW | test/document.test.js | 9777 | email: 'foo@bar.com', | CODE |
| LOW | test/document.test.js | 12486 | addresses: [{ street: '123 Main St', city: 'Boston', image: { url: 'google.com' } }], | CODE |
| LOW | test/document.test.js | 12693 | phones: [{ number: '555-1234' }] | CODE |
| LOW | test/document.test.js | 14269 | email: 'test@test.com' | CODE |
| LOW | test/types/queries.test.ts | 647 | const update: UpdateQuery<IUser> = { $addToSet: { friendsNames: 'John Doe' } }; | CODE |
| LOW | test/types/queries.test.ts | 651 | update.$addToSet.friendsNames = 'Jane Doe'; | CODE |
| LOW | test/types/schema.test.ts | 1361 | const userIdTypeHint = 'placeholder' as UserId; | CODE |
| LOW | test/types/schema.test.ts | 1487 | schema.statics.createWithFullName('John Doe'); | CODE |
| LOW | test/types/schema.test.ts | 2227 | console.log('placeholder', this.modelName); | CODE |
| LOW⚡ | test/types/models.test.ts | 1249 | const data = { name: 'John Doe', age: 30, address: '123 Main St' }; | CODE |
| LOW⚡ | test/types/models.test.ts | 1249 | const data = { name: 'John Doe', age: 30, address: '123 Main St' }; | CODE |
| LOW | test/types/schema.create.test.ts | 1301 | const userIdTypeHint = 'placeholder' as UserId; | CODE |
| LOW | test/types/schema.create.test.ts | 1429 | schema.statics.createWithFullName('John Doe'); | CODE |
| LOW | docs/documents.md | 350 | doc.name = 'Jane Doe'; | CODE |
| LOW | docs/documents.md | 355 | await doc.updateOne({ name: 'John Doe' }); | CODE |
| LOW | lib/schema/string.js | 136 | * new User({ name: ' John Doe ' }).name; // 'John Doe' | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | lib/query.js | 127 | // this is the case where we have a CustomQuery, we need to check if we got | COMMENT |
| LOW | lib/schema.js | 3062 | // Now that we found the array, we need to check if there | COMMENT |
| LOW | lib/schema.js | 3164 | // Now that we found the array, we need to check if there | COMMENT |
| LOW | lib/helpers/populate/getSchemaTypes.js | 83 | // Now that we found the array, we need to check if there | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | index.js | 61 | // The following properties are not exported using ESM because `setDriver()` can mutate these | COMMENT |
| LOW | types/index.d.ts | 1 | /// <reference path="./aggregate.d.ts" /> | COMMENT |
| LOW | test/docs/promises.test.js | 141 | // acquit:ignore:end | COMMENT |
| LOW | test/docs/lean.test.js | 41 | // To enable the `lean` option for a query, use the `lean()` function. | COMMENT |
| LOW | docs/promises.md | 81 | await Band.findOne({ _id: badId }); | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/encryptedSchema.test.js | 250 | // Don't forget to add `Int8` to the type registry | COMMENT |
| LOW | test/encryptedSchema.test.js | 280 | // Don't forget to add `Int8` to the type registry | COMMENT |
| LOW | test/docs/schematypes.test.js | 54 | // Don't forget to add `Int8` to the type registry | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | scripts/configure-cluster-with-encryption.sh | 19 | # for configuration options for the exported variables, see here: https://github.com/mongodb-labs/drivers-evergreen-to | COMMENT |