A shell parser, formatter, and interpreter with bash and zsh support; includes shfmt
This report summarizes scanner evidence for mvdan/sh, a Go project with 9,169 GitHub stars. SynthScan examined 53,768 lines of code across 106 source files, recording 64 pattern matches distributed across 2 syntactic categories. The legacy adjusted pattern signal is 1.2 (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? 64 finding(s).
Are imports declared and package/API names verified? 0 finding(s).
Are wrappers, guards, and repeated structures necessary? 0 finding(s).
Which changes need focused human review? 64 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 64 distinct pattern matches across 2 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 | cmd/shfmt/main.go | 281 | if err := filepath.WalkDir(path, func(path string, entry fs.DirEntry, err error) error { | COMMENT |
| LOW | expand/doc.go | 1 | // Copyright (c) 2018, Daniel Martí <mvdan@mvdan.cc> | COMMENT |
| LOW | expand/environ.go | 21 | // set, use Variable.IsSet. | COMMENT |
| LOW | expand/environ.go | 41 | // such as `export foo` or `readonly foo` alter the attributes but not the value, | COMMENT |
| LOW | expand/expand.go | 21 | "syscall" | COMMENT |
| LOW | expand/expand.go | 41 | // * "HOME foo" to retrieve user foo's home directory (if unset, | COMMENT |
| LOW | expand/expand.go | 61 | // ProcSubst expands a process substitution node. | COMMENT |
| LOW | shell/example_test.go | 121 | // Output: | COMMENT |
| LOW | shell/doc.go | 1 | // Copyright (c) 2017, Daniel Martí <mvdan@mvdan.cc> | COMMENT |
| LOW | shell/glob.go | 21 | // The pattern is parsed like the arguments to a command, as in [Fields], | COMMENT |
| LOW | shell/match.go | 1 | // Copyright (c) 2026, Daniel Martí <mvdan@mvdan.cc> | COMMENT |
| LOW | shell/expand.go | 41 | // expansion, tilde expansion, and word splitting. | COMMENT |
| LOW | interp/handler.go | 61 | kind handlerKind | COMMENT |
| LOW | interp/handler.go | 81 | // due to backwards compatibility. | COMMENT |
| LOW | interp/handler.go | 101 | // The args slice is never empty. | COMMENT |
| LOW | interp/handler.go | 121 | // The args slice is never empty. | COMMENT |
| LOW | interp/handler.go | 401 | // The path parameter may be relative to the current directory, | COMMENT |
| LOW | interp/handler.go | 501 | AccessExec AccessMode = 0b001 | COMMENT |
| LOW | interp/handler.go | 521 | COMMENT | |
| LOW | interp/handler.go | 541 | // OpenSubshell is called exactly once, from the background subshell | COMMENT |
| LOW | interp/runner.go | 521 | } | COMMENT |
| LOW | interp/vars.go | 21 | "mvdan.cc/sh/v3/internal/arithm" | COMMENT |
| LOW | interp/api.go | 1 | // Copyright (c) 2017, Daniel Martí <mvdan@mvdan.cc> | COMMENT |
| LOW | interp/api.go | 41 | "time" | COMMENT |
| LOW | interp/api.go | 61 | // If it includes a TMPDIR variable describing an absolute directory, | COMMENT |
| LOW | interp/api.go | 181 | COMMENT | |
| LOW | interp/api.go | 201 | COMMENT | |
| LOW | interp/api.go | 541 | return nil | COMMENT |
| LOW | interp/api.go | 701 | func ExecHandler(f ExecHandlerFunc) RunnerOption { | COMMENT |
| LOW | interp/api.go | 801 | r.procSubstHandler = f | COMMENT |
| LOW | interp/api.go | 1041 | // These correspond to indexes (offset by the above seven items) of | COMMENT |
| LOW | interp/api.go | 1201 | status uint8 | COMMENT |
| LOW | interp/api.go | 1261 | COMMENT | |
| LOW | interp/api.go | 1361 | } | COMMENT |
| LOW | interp/api.go | 1381 | // Subshell is not safe to use concurrently with [Run]. Orchestrating this is | COMMENT |
| LOW | interp/builtin.go | 21 | "mvdan.cc/sh/v3/expand" | COMMENT |
| LOW | internal/arithm/word.go | 1 | // Copyright (c) 2026, Daniel Martí <mvdan@mvdan.cc> | COMMENT |
| LOW | .github/workflows/test.yml | 1 | on: [push, pull_request] | COMMENT |
| LOW | pattern/pattern.go | 61 | Filenames // "*" and "?" don't match slashes; only "**" does; only makes sense with EntireStri | COMMENT |
| LOW | pattern/pattern.go | 501 | switch name { | COMMENT |
| LOW | syntax/example_test.go | 121 | fmt.Printf("Quote(%17q): %s\n", s, quoted) | COMMENT |
| LOW | syntax/example_test.go | 161 | // Output: | COMMENT |
| LOW | syntax/example_test.go | 181 | // . . . . . . . 0: *syntax.SglQuoted { | COMMENT |
| LOW | syntax/simplify.go | 1 | // Copyright (c) 2017, Daniel Martí <mvdan@mvdan.cc> | COMMENT |
| LOW | syntax/parser_test.go | 341 | if strings.Contains(in, "\\\r\n") { | COMMENT |
| LOW | syntax/quote.go | 21 | COMMENT | |
| LOW | syntax/quote.go | 41 | // In such cases, the returned error type will be *QuoteError. | COMMENT |
| LOW | syntax/doc.go | 1 | // Copyright (c) 2016, Daniel Martí <mvdan@mvdan.cc> | COMMENT |
| LOW | syntax/braces.go | 1 | // Copyright (c) 2018, Daniel Martí <mvdan@mvdan.cc> | COMMENT |
| LOW | syntax/braces.go | 41 | return true | COMMENT |
| LOW | syntax/parser.go | 21 | type ParserOption func(*Parser) | COMMENT |
| LOW | syntax/parser.go | 41 | COMMENT | |
| LOW | syntax/parser.go | 61 | // | COMMENT |
| LOW | syntax/parser.go | 81 | // Its string representation is "zsh". | COMMENT |
| LOW | syntax/parser.go | 181 | if !yield(n) { | COMMENT |
| LOW | syntax/parser.go | 341 | return nil | COMMENT |
| LOW | syntax/printer.go | 41 | // SwitchCaseIndent will make switch cases be indented. As such, switch | COMMENT |
| LOW | syntax/printer.go | 101 | COMMENT | |
| LOW | syntax/nodes.go | 121 | // offset numbers will stop increasing past a very large number. | COMMENT |
| LOW | syntax/nodes.go | 281 | func (*LetClause) commandNode() {} | COMMENT |
| 1 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | expand/param.go | 491 | // TODO: implement, like @A but listing keys for assoc arrays. | COMMENT |
| LOW | expand/param.go | 586 | // TODO: implement prompt expansion (\u, \h, \w, etc.). | COMMENT |
| LOW | interp/builtin.go | 512 | // TODO: implement. for now, having this as a no-op is better than nothing. | COMMENT |