Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ GITTENSORY_REVIEW_ENRICHMENT=false
# Current analyzer names:
# dependency,lockfileDrift,secret,license,installScript,heavyDependency,actionPin,eol,redos
# provenance,codeowners,secretLog,assetWeight,typosquat,commitSignature,iacMisconfig,nativeBuild
# history,docCommentDrift
# history,docCommentDrift,duplication
#
# Profile defaults:
# fast: dependency,lockfileDrift,secret,license,installScript,heavyDependency,actionPin,eol
# redos,provenance,secretLog,typosquat,iacMisconfig,nativeBuild
# balanced (default): dependency,lockfileDrift,secret,license,installScript,heavyDependency
# actionPin,eol,redos,provenance,codeowners,secretLog,assetWeight,typosquat,commitSignature
# iacMisconfig,nativeBuild,history,docCommentDrift
# iacMisconfig,nativeBuild,history,docCommentDrift,duplication
# deep: dependency,lockfileDrift,secret,license,installScript,heavyDependency,actionPin,eol
# redos,provenance,codeowners,secretLog,assetWeight,typosquat,commitSignature,iacMisconfig
# nativeBuild,history,docCommentDrift
# nativeBuild,history,docCommentDrift,duplication
# END GENERATED REES ANALYZERS

# Submitter-reputation spend control (internal-only): downgrades new/burst/low-rep
Expand Down
28 changes: 28 additions & 0 deletions apps/gittensory-ui/src/lib/rees-analyzers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,34 @@ export const REES_ANALYZERS = [
"Conservative: only named function declarations with confidently-enumerable params; non-parameter signature edits are not reported.",
},
},
{
name: "duplication",
title: "Near-verbatim duplicated code",
category: "quality",
cost: "github-light",
defaultEnabled: true,
profiles: ["balanced", "deep"],
requires: ["files", "github-token", "head-sha"],
limits: {
minRun: 8,
maxCandidates: 40,
maxFetches: 30,
maxFindings: 25,
maxFileBytes: 500000,
},
docs: {
summary:
"Flags added code that is a near-verbatim duplicate of a block already present elsewhere in the repo.",
looksAt:
"Added diff hunks in changed source files compared against same-extension repo files fetched from the git tree at headSha.",
reports:
"The head file:line, the existing source file:line it duplicates, and the matched line count.",
network:
"Calls the GitHub API for the git tree and candidate blobs. Requires headSha and token forwarding for private repos.",
notes:
"Conservative: trivial/boilerplate lines are dropped and a long contiguous run is required, so incidental overlap is not flagged. Never returns code content.",
},
},
] as const satisfies readonly ReesAnalyzerDoc[];

export const REES_ANALYZER_NAMES = REES_ANALYZERS.map((analyzer) => analyzer.name);
30 changes: 30 additions & 0 deletions review-enrichment/analyzer-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,36 @@
"network": "Calls the GitHub API for changed file contents. Requires headSha and token forwarding for private repos.",
"notes": "Conservative: only named function declarations with confidently-enumerable params; non-parameter signature edits are not reported."
}
},
{
"name": "duplication",
"title": "Near-verbatim duplicated code",
"category": "quality",
"cost": "github-light",
"defaultEnabled": true,
"profiles": [
"balanced",
"deep"
],
"requires": [
"files",
"github-token",
"head-sha"
],
"limits": {
"minRun": 8,
"maxCandidates": 40,
"maxFetches": 30,
"maxFindings": 25,
"maxFileBytes": 500000
},
"docs": {
"summary": "Flags added code that is a near-verbatim duplicate of a block already present elsewhere in the repo.",
"looksAt": "Added diff hunks in changed source files compared against same-extension repo files fetched from the git tree at headSha.",
"reports": "The head file:line, the existing source file:line it duplicates, and the matched line count.",
"network": "Calls the GitHub API for the git tree and candidate blobs. Requires headSha and token forwarding for private repos.",
"notes": "Conservative: trivial/boilerplate lines are dropped and a long contiguous run is required, so incidental overlap is not flagged. Never returns code content."
}
}
]
}
Loading
Loading