[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81768":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":10,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":12,"stars30d":12,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":13,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":14,"fork":14,"defaultBranch":15,"hasWiki":16,"hasPages":14,"topics":17,"createdAt":8,"pushedAt":8,"updatedAt":18,"readmeContent":19,"aiSummary":20,"trendingCount":12,"starSnapshotCount":12,"syncStatus":11,"lastSyncTime":21,"discoverSource":22},81768,"dry4go","unclebob\u002Fdry4go","unclebob",null,"Go",23,2,0,35.43,false,"master",true,[],"2026-06-12 04:01:35","# dry4go\n\ndry4go finds candidate duplicate Go code across files and directories. It reports fuzzy structural matches by filename and line range so another mechanism can evaluate and reduce duplication.\n\n## Overview\n\ndry4go compares Go functions and methods by converting each function body and\nsignature shape into normalized syntax nodes. The normalized tree is walked to\ncollect a set of structural fingerprints, one for the whole function and one for\neach nested syntax node.\n\nSimilarity is Jaccard similarity over those fingerprint sets:\n\n```text\nscore = shared fingerprints \u002F all fingerprints seen in either function\n```\n\nA score of `1.0` means the normalized structures have the same fingerprint set.\nLower scores mean the functions still share structure, but each function also\nhas structure the other does not. The default `--threshold 0.82` reports\ncandidates whose normalized structures are close enough to be worth review.\n\nGo differs from Clojure in important ways, so dry4go treats functions and\nmethods as the comparison units and uses Go's parser\u002FAST instead of textual\nforms. Identifiers, local names, selector names, and literal values normalize\naway. Structural Go syntax is preserved, including:\n\n- function and method shape\n- parameter and result type structure\n- blocks and statement order\n- `if`, `for`, `range`, `switch`, `select`\n- assignments, returns, calls, selectors, indexing, slicing\n- composite literals, map\u002Farray\u002Fstruct\u002Ffunction types\n- operators such as `+`, `==`, `&&`, and `||`\n\nFor example, these functions can match strongly even though their names, local\nvariables, predicates, and field names differ:\n\n```go\nfunc Alpha(xs []int) []int {\n\tvar ys []int\n\tfor _, x := range xs {\n\t\tif x%2 == 1 {\n\t\t\tys = append(ys, x+1)\n\t\t}\n\t}\n\treturn ys\n}\n\nfunc Beta(items []int) []int {\n\tvar kept []int\n\tfor _, item := range items {\n\t\tif item%2 == 0 {\n\t\t\tkept = append(kept, item+1)\n\t\t}\n\t}\n\treturn kept\n}\n```\n\n## Usage\n\n```bash\ndry4go [options] [file-or-directory ...]\n```\n\nOptions:\n\n```text\n--threshold N   Minimum structural similarity score, default 0.82\n--min-lines N   Minimum source lines in a candidate function, default 4\n--min-nodes N   Minimum normalized syntax nodes, default 20\n--format F      text or json, default text\n--json          Same as --format json\n--text          Same as --format text\n```\n\nExamples:\n\n```bash\ndry4go .\ndry4go internal\u002Ffoo\u002Ffoo.go internal\u002Fbar\u002Fbar.go\ndry4go --json --threshold 0.9 .\u002Finternal .\u002Fcmd\n```\n\nEvery file named on the command line participates in the same duplication\nsearch. When an argument is a directory, dry4go recursively includes every\n`.go` file under that directory in the same search set, skipping `.git`,\n`vendor`, and `target` directories.\n\nDefault text output is intended for quick reading:\n\n```text\nDUPLICATE score=0.89\n  internal\u002Fbilling\u002Finvoice.go:12-25\n  internal\u002Fbilling\u002Freceipt.go:30-44\n```\n\nJSON output is intended for tools:\n\n```json\n{\n  \"candidates\": [\n    {\n      \"score\": 0.8909090909090909,\n      \"left\": {\"file\": \"internal\u002Fbilling\u002Finvoice.go\", \"start_line\": 12, \"end_line\": 25},\n      \"right\": {\"file\": \"internal\u002Fbilling\u002Freceipt.go\", \"start_line\": 30, \"end_line\": 44},\n      \"left_nodes\": 88,\n      \"right_nodes\": 91\n    }\n  ]\n}\n```\n\n## Development\n\n```bash\ngo test .\u002F...\ngo run .\u002Fcmd\u002Fdry4go --help\ngo run .\u002Fcmd\u002Fdry4go --threshold 0.75 .\n```\n\n## License\n\nCopyright (c) Robert C. Martin. All rights reserved.\n","dry4go是一个用于检测Go语言代码中潜在重复代码的工具。它通过将函数体和签名转换为标准化的语法节点，并基于这些节点生成结构指纹来比较不同文件或目录下的Go函数和方法，使用Jaccard相似度衡量结构相似性，默认阈值为0.82。该工具能够识别出尽管名称、局部变量等细节不同但逻辑结构相似的函数，帮助开发者减少冗余代码。适用于大型Go项目维护过程中清理重复代码，提高代码质量和可维护性。","2026-06-11 04:06:19","CREATED_QUERY"]