Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/alibaba/open-code-review
/ functions
Functions
4,917 in github.com/alibaba/open-code-review
⨍
Functions
4,917
◇
Types & classes
436
↓ 4 callers
Function
extractHeadings
(markdown: string)
pages/src/utils/extractHeadings.ts:7
↓ 4 callers
Function
fencedBlock
(content, language = "")
scripts/github-actions/post-review-comments.js:1802
↓ 4 callers
Method
filterLargeScans
filterLargeScans drops items whose content exceeds 80% of MaxTokens.
internal/scan/agent.go:453
↓ 4 callers
Method
finalizeManifest
finalizeManifest freezes the run's coverage builder and stores the immutable manifest on the session for persistence and CLI consumption. Nil-safe. A
internal/agent/agent.go:1240
↓ 4 callers
Function
firstLine
firstLine returns the first non-empty trimmed line of git output, so a stray trailing newline or an unexpected second line never pollutes a resolved S
internal/diff/git.go:556
↓ 4 callers
Function
formatPlanGuidance
formatPlanGuidance parses the PLAN_TASK JSON output into a markdown snippet suitable for embedding in MAIN_TASK. On parse failure it returns the raw c
internal/scan/agent.go:1110
↓ 4 callers
Function
getShellEnv
()
extensions/vscode/src/extension/services/shellEnv.ts:29
↓ 4 callers
Function
handleSessions
(w http.ResponseWriter, r *http.Request, root, repo string)
internal/viewer/handler.go:35
↓ 4 callers
Function
helperCmd
helperCmd builds a helper command with its steering variables set on the Cmd itself, for the tests that hand an *exec.Cmd to runBrowserCmd directly.
internal/viewer/browser_exec_test.go:52
↓ 4 callers
Function
humanTokens
humanTokens formats a token count as e.g. "1.2M" / "850K" / "420".
internal/scan/estimate.go:114
↓ 4 callers
Function
humanTokens
humanTokens formats a token count as e.g. "1.2M" / "850K" / "420". Mirrors internal/scan/estimate.go; kept here so agent has no scan import.
internal/agent/estimate.go:101
↓ 4 callers
Function
initPreviewRepo
(t *testing.T)
internal/agent/preview_run_test.go:14
↓ 4 callers
Function
initRulesCheckTestRepo
(t *testing.T)
cmd/opencodereview/rules_cmd_test.go:14
↓ 4 callers
Function
isSubtaskErrorType
(warningType string)
cmd/opencodereview/output.go:64
↓ 4 callers
Function
isUserEditMsg
isUserEditMsg reports whether msg represents user text input (typing or paste).
cmd/opencodereview/provider_tui.go:886
↓ 4 callers
Function
itemList
(paths ...string)
internal/scan/batch_test.go:13
↓ 4 callers
Function
loadProjectRule
loadProjectRule reads <repoDir>/.opencodereview/rule.json. Since #287 anchored RepoDir at the git top-level, `ocr review` from a monorepo subdirectory
internal/config/rules/system_rules.go:410
↓ 4 callers
Function
loadReviewResumeState
(repoDir string, opts reviewOptions)
cmd/opencodereview/review_cmd.go:343
↓ 4 callers
Function
makeErr
(message, status, headers, data)
scripts/github-actions/post-review-comments.test.js:61
↓ 4 callers
Function
makeTask
()
internal/diff/relocation_test.go:35
↓ 4 callers
Function
manifestMessage
(manifest *session.RunManifest, findings int)
cmd/opencodereview/output.go:601
↓ 4 callers
Method
mapOpenAIResponse
mapOpenAIResponse converts the SDK response into ChatResponse.
internal/llm/client.go:809
↓ 4 callers
Method
maybeRunPlan
maybeRunPlan invokes PLAN_TASK on the file and returns a human-readable guidance string suitable for {{plan_guidance}} substitution. Returns "(no pre-
internal/scan/agent.go:816
↓ 4 callers
Method
modelProviderName
()
cmd/opencodereview/provider_tui.go:428
↓ 4 callers
Function
mustGetResult
mustGetResult extracts the first result from a SARIF document, failing the test if the structure is wrong.
cmd/opencodereview/sarif_test.go:35
↓ 4 callers
Function
nKey
()
cmd/opencodereview/provider_tui_test.go:1146
↓ 4 callers
Function
newCompressionRunner
newCompressionRunner returns a Runner whose template forces runCompression to issue a request, plus the message slice to feed it.
internal/llmloop/retry_identity_test.go:271
↓ 4 callers
Function
newManifestFlowAgentWithClient
(t *testing.T, diffs []model.Diff, resume *session.ResumeState, client llm.LLMClient)
internal/agent/manifest_integration_test.go:72
↓ 4 callers
Function
newMockResponse
(content string)
internal/diff/relocation_test.go:27
↓ 4 callers
Function
newRetryObserver
newRetryObserver builds the middleware that feeds collector. It sits inside the SDK retry loop, so it runs once per real HTTP attempt and sees neithe
internal/llm/retry_observer.go:30
↓ 4 callers
Function
normalizeLine
normalizeLine removes leading/trailing whitespace and strips any leading '+' or '-' diff marker.
internal/diff/resolver.go:301
↓ 4 callers
Function
objcRuleText
objcRuleText is the exact text a sniffed .m file must resolve to. Assert on identity rather than on wording: objc.md currently ships as a placeholder
internal/config/rules/sniffer_test.go:61
↓ 4 callers
Function
openAIClient
The four blind spots share one shape: the observer sees HTTP 200, the failure surfaces afterwards, and nothing downstream would notice the omission —
internal/llm/retry_boundary_test.go:27
↓ 4 callers
Function
outputJSONWithWarnings
(comments []model.LlmComment, warnings []agent.AgentWarning, filesReviewed, inputTokens, outputTokens, totalT
cmd/opencodereview/output.go:352
↓ 4 callers
Function
outputTextWithWarnings
(comments []model.LlmComment, warnings []agent.AgentWarning, manifest *session.RunManifest, out io.Writer)
cmd/opencodereview/output.go:68
↓ 4 callers
Function
parseNameStatus
(output: string)
extensions/vscode/src/extension/services/gitMap.ts:161
↓ 4 callers
Function
parseNonNegInt
(val, defaultVal)
scripts/github-actions/post-review-comments.js:1182
↓ 4 callers
Function
partitionMessages
partitionMessages divides messages into frozen, compress, and active zones. Frozen zone is always messages[0:2]. Active zone preserves the K most rece
internal/llmloop/compression.go:132
↓ 4 callers
Method
post
(msg: ConfigPanelHostToWebview)
extensions/vscode/src/extension/providers/ConfigPanelProvider.ts:61
↓ 4 callers
Method
post_discussion
(self, discussion, comment_id=None)
examples/gitlab_ci/post_review_test.py:186
↓ 4 callers
Function
printVersion
()
cmd/opencodereview/version.go:28
↓ 4 callers
Method
read
(self)
examples/gerrit_ci/post_review_test.py:514
↓ 4 callers
Function
readAllPages
(tag, pageFn, log, maxPages = 50)
scripts/github-actions/post-review-comments.js:1348
↓ 4 callers
Method
release
()
internal/gitcmd/runner.go:44
↓ 4 callers
Method
reloadConfigAfterSaveFailure
reloadConfigAfterSaveFailure reloads on-disk config and refreshes derived provider TUI state so the UI matches persisted data after a failed save. Ret
cmd/opencodereview/provider_tui.go:1699
↓ 4 callers
Method
reloadConfigAfterSaveFailure
reloadConfigAfterSaveFailure reloads on-disk config so in-memory state matches persisted data after a failed save. Returns false when reload could not
cmd/opencodereview/provider_tui.go:2774
↓ 4 callers
Function
renderListName
(name string, isCursor bool)
cmd/opencodereview/provider_tui.go:2090
↓ 4 callers
Method
requestCtx
requestCtx returns ctx carrying the identity of one logical LLM request, or ctx unchanged when identity is disabled (scan) or the meta is unusable. t
internal/llmloop/loop.go:82
↓ 4 callers
Function
resolveBackground
resolveBackground determines the effective background from the flag combination. --background-file wins over --background; the commit-message fallback
cmd/opencodereview/background_file.go:50
↓ 4 callers
Function
resolveEnv
(over = {})
scripts/github-actions/post-review-comments.test.js:4179
↓ 4 callers
Function
resolveRepoDir
resolveRepoDir resolves the repo dir for `ocr rules check`. It delegates to resolveWorkingDir(requireGit=true) so it anchors at the git top-level just
cmd/opencodereview/review_cmd.go:446
↓ 4 callers
Function
reviewModeString
(from, to, commit string)
internal/agent/util.go:147
↓ 4 callers
Function
reviseAttempt
reviseAttempt applies a client-boundary correction to the last attempt of the logical request identified by ctx. Requests without identity (scan, llm
internal/llm/retry_boundary.go:102
↓ 4 callers
Function
rollbackCfgActiveModel
(cfg *Config, providerName, prevModel string)
cmd/opencodereview/provider_tui.go:479
↓ 4 callers
Method
ruleConfigSHA256
ruleConfigSHA256 is the deterministic identity of the resolved rule configuration this run operates with: the resolver's effective rule-text layers (c
internal/agent/agent.go:1028
↓ 4 callers
Function
runConfigSet
(key, value string)
cmd/opencodereview/config_cmd.go:110
↓ 4 callers
Method
runGit
(ctx context.Context, args ...string)
internal/diff/git.go:644
↓ 4 callers
Function
runLLMTest
()
cmd/opencodereview/llm_cmd.go:53
↓ 4 callers
Function
runScanPreview
(cc *commonContext, scanTpl *template.ScanTemplate, scanPaths []string, outputFormat string, out io.Writer)
cmd/opencodereview/scan_cmd.go:269
↓ 4 callers
Method
run_main_with_captured_poster
(self, env_overrides, result=None)
examples/gitlab_ci/post_review_test.py:1515
↓ 4 callers
Method
run_with_urlopen
(self, fake_urlopen, config=None, discussion=None)
examples/gitlab_ci/post_review_test.py:1090
↓ 4 callers
Function
sarifInvocationFromRun
sarifInvocationFromRun builds the run.invocations entry from the manifest's terminal state and any warnings collected during the review. executionSuc
cmd/opencodereview/sarif.go:314
↓ 4 callers
Function
sarifResultFromComment
sarifResultFromComment maps a single LlmComment to a SARIF result. Field mapping follows FR-3 in the requirements spec: - Path → locations[].
cmd/opencodereview/sarif.go:228
↓ 4 callers
Method
scanItemFingerprint
(it model.ScanItem)
internal/scan/agent.go:251
↓ 4 callers
Function
scanTaskDoneResponse
()
internal/scan/coverage_test.go:849
↓ 4 callers
Method
selectedModel
()
cmd/opencodereview/provider_tui.go:3067
↓ 4 callers
Method
selectedModelFromState
()
cmd/opencodereview/provider_tui.go:1952
↓ 4 callers
Function
setRulesCheckRepo
setRulesCheckRepo points the rulesCheckCmd's package-level --repo flag at repo for the duration of the test, restoring it afterward. runRulesCheck rea
cmd/opencodereview/rules_cmd_test.go:46
↓ 4 callers
Method
sourceArtifactSHA256
sourceArtifactSHA256 is the deterministic content identity of this run's selected input: for every non-deleted diff (the same set registerCoverage sea
internal/agent/agent.go:996
↓ 4 callers
Function
statusBadge
statusBadge renders the per-file status tag. The letter carries the meaning, so with color disabled the bare "[A]"/"[M]"/... form is still unambiguous
cmd/opencodereview/output.go:789
↓ 4 callers
Function
stripThinkTags
stripThinkTags removes reasoning wrapper tags from content.
internal/llm/client.go:1529
↓ 4 callers
Method
summaryEnabled
()
internal/scan/agent.go:92
↓ 4 callers
Function
taskDoneResponseWithArguments
(arguments string)
internal/llmloop/loop_test.go:41
↓ 4 callers
Method
transition
transition moves a selected item to a terminal state through the single coverage entry point. Unknown item_id, an invalid failed classification, an em
internal/session/manifest.go:559
↓ 4 callers
Method
triggerAsyncCompression
triggerAsyncCompression kicks off a background compression job for the conversation owning st. A no-op when a job is already pending — the check-and-s
internal/llmloop/compression.go:302
↓ 4 callers
Function
trimGitUsage
(stderr string, exitCode int)
internal/tool/code_search.go:240
↓ 4 callers
Function
unquoteGitPath
(path: string)
extensions/vscode/src/extension/services/gitMap.ts:130
↓ 4 callers
Method
updateManualForm
(key string, msg tea.KeyPressMsg)
cmd/opencodereview/provider_tui.go:1469
↓ 4 callers
Function
useSectionTitleStyle
()
pages/src/hooks/useResponsiveStyle.ts:15
↓ 4 callers
Method
valid
valid reports whether c is one of the fixed attempt error classes.
internal/llm/retry_report.go:38
↓ 4 callers
Method
valid
valid reports whether c is one of the fixed item failure classes.
internal/session/manifest.go:67
↓ 4 callers
Function
validateRepoLinks
(links, probe)
scripts/github-actions/check-plugin-contract.js:276
↓ 4 callers
Function
validateTimeoutSec
validateTimeoutSec converts a config-file timeout (in seconds) to time.Duration. Returns 0 for zero input (use default). Rejects negative values and o
internal/llm/resolver.go:221
↓ 4 callers
Function
wantMeta
(t *testing.T, got capturedRequest, want llm.RequestMeta)
internal/llmloop/retry_identity_test.go:84
↓ 4 callers
Method
warn
warn reports the first capture failure on stderr; later failures stay silent so a degraded sink cannot spam every subsequent record.
internal/session/raw_writer.go:101
↓ 4 callers
Function
writeCommit
writeCommit writes content to name, stages it, and commits with msg.
internal/diff/git_resolve_test.go:41
↓ 4 callers
Function
writeOutError
writeOutError surfaces deferred write errors from writers that record them (lazyFileWriter); plain writers such as os.Stdout report nil.
cmd/opencodereview/shared.go:585
↓ 3 callers
Method
CallTool
CallTool invokes a tool on the MCP server and returns the text result.
internal/mcp/client.go:158
↓ 3 callers
Method
Close
()
internal/mcp/client.go:176
↓ 3 callers
Method
CollectPendingComments
CollectPendingComments awaits any async comment-processing workers and returns the aggregated comments from the collector. Safe to call once per sessi
internal/llmloop/loop.go:259
↓ 3 callers
Method
CompletionsWithCtx
CompletionsWithCtx sends a Responses API request and maps the result back to the shared ChatResponse shape. The deferred finalizeRequest is this clie
internal/llm/responses_client.go:94
↓ 3 callers
Function
ComputeLineDiff
ComputeLineDiff returns a line-level diff between oldLines and newLines. Uses Myers-style LCS to find common subsequences, then emits context/added/de
internal/suggestdiff/diff.go:27
↓ 3 callers
Function
ContentLogging
ContentLogging returns true when content logging is enabled via OCR_CONTENT_LOGGING.
internal/telemetry/provider.go:78
↓ 3 callers
Function
EffortNames
EffortNames returns the accepted values for shell completion and error messages.
internal/config/template/effort.go:25
↓ 3 callers
Method
FinalManifest
FinalManifest returns the frozen manifest stored for this run, or nil when the run produced none (legacy/scan, or a construction failure).
internal/session/history.go:213
↓ 3 callers
Method
Get
Get returns the diff text for path.
internal/tool/file_read_diff.go:27
↓ 3 callers
Function
ListSessions
ListSessions returns lightweight summaries for all sessions in a repo subdir.
internal/viewer/store.go:113
↓ 3 callers
Function
LoadReviewResumeState
LoadReviewResumeState replays a review session, dropping records it cannot parse. Review reuse is gated on the parent manifest rather than on these li
internal/session/resume.go:107
↓ 3 callers
Method
MergeBase
MergeBase returns the computed merge-base commit hash for range mode.
internal/diff/git.go:165
↓ 3 callers
Method
Name
Name returns the tool's identifier name.
internal/tool/definitions.go:62
← previous
next →
601–700 of 4,917, ranked by callers