Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/alibaba/open-code-review
/ functions
Functions
4,075 in github.com/alibaba/open-code-review
⨍
Functions
4,075
◇
Types & classes
386
↓ 16 callers
Method
displayModels
()
cmd/opencodereview/provider_tui.go:2548
↓ 16 callers
Method
executeToolCall
executeToolCall dispatches a single tool call from the LLM response and records the result in session history. code_comment handling includes optional
internal/llmloop/loop.go:444
↓ 16 callers
Function
okAttempt
()
internal/llm/retry_report_test.go:34
↓ 16 callers
Function
parseScanFlags
parseScanFlags provides test compatibility: parses args through a fresh cobra command instance and returns the resulting scanOptions.
cmd/opencodereview/compat_test.go:38
↓ 16 callers
Function
runGitTest
runGitTest runs a git command in dir and fails the test on error.
internal/diff/git_test.go:19
↓ 15 callers
Function
IsEnabled
IsEnabled returns true when telemetry has been initialized with exporters.
internal/telemetry/provider.go:73
↓ 15 callers
Function
SessionFilePath
SessionFilePath returns the JSONL path for a persisted session.
internal/session/resume.go:81
↓ 15 callers
Function
build
(comments, **extra)
examples/gerrit_ci/post_review_test.py:43
↓ 15 callers
Method
currentProvider
()
cmd/opencodereview/provider_tui.go:383
↓ 15 callers
Function
getHeadCommit
(t *testing.T, dir string)
internal/tool/code_search_test.go:132
↓ 15 callers
Function
http_error
Build an HTTPError suitable for mocking urlopen.
examples/gitlab_ci/post_review_test.py:79
↓ 15 callers
Function
loadBackgroundFile
(path string)
cmd/opencodereview/background_file.go:49
↓ 15 callers
Function
newAgentForTest
(t *testing.T, tpl template.ScanTemplate)
internal/scan/agent_test.go:18
↓ 15 callers
Function
stripANSI
stripANSI removes ANSI escape sequences from a string so tests can assert against plain text content.
cmd/opencodereview/provider_tui_test.go:2609
↓ 15 callers
Function
truncate
(s string, maxLen int)
internal/config/rules/system_rules_test.go:232
↓ 14 callers
Function
NewCommentWorkerPool
NewCommentWorkerPool creates a pool with the given concurrency limit. workerCount <= 0 defaults to 8.
internal/llmloop/pool.go:52
↓ 14 callers
Method
RegisterSelected
RegisterSelected records an item in the selected set (the coverage denominator). It must be called once per item during the pre-dispatch pass, after f
internal/session/manifest.go:495
↓ 14 callers
Function
ResolveEndpointWithOptions
ResolveEndpointWithOptions resolves an endpoint by first honoring an explicit provider selection. Otherwise it processes config, environment, then she
internal/llm/resolver.go:83
↓ 14 callers
Method
SetError
SetError records an error for this task record, writes an llm_error entry to the JSONL stream, and increments the session-level LLM failure counter.
internal/session/history.go:463
↓ 14 callers
Function
anthropicClient
(url string, c *RetryCollector, extra map[string]string)
internal/llm/retry_observer_test.go:71
↓ 14 callers
Function
mockManifest
(state session.TerminalState)
cmd/opencodereview/emit_run_result_test.go:56
↓ 14 callers
Function
modelIdxForName
(t *testing.T, m providerTUIModel, name string)
cmd/opencodereview/provider_tui_test.go:1568
↓ 14 callers
Function
reviewItemFingerprint
(mode string, d model.Diff)
internal/agent/agent.go:819
↓ 14 callers
Function
rightKey
()
cmd/opencodereview/provider_tui_test.go:30
↓ 14 callers
Function
writeTestFile
(t *testing.T, dir, name, content string)
internal/tool/file_read_test.go:17
↓ 13 callers
Function
CountTokens
(text string)
internal/llm/client.go:334
↓ 13 callers
Function
LoadResumeState
LoadResumeState replays a previous session JSONL into a fingerprint index. A record that cannot be parsed fails the load: with nothing to arbitrate co
internal/session/resume.go:97
↓ 13 callers
Method
ValidateOptions
ValidateOptions verifies that this session can be resumed in the requested review mode at all. It deliberately does not compare the ref text the user
internal/session/resume.go:274
↓ 13 callers
Function
collectCustomProviders
(cfg *Config)
cmd/opencodereview/provider_tui.go:221
↓ 13 callers
Method
set
(key: string, value: string)
extensions/vscode/src/extension/services/ConfigService.ts:88
↓ 13 callers
Function
useTranslation
()
pages/src/i18n/context.tsx:66
↓ 13 callers
Function
writeResolverConfig
(t *testing.T, cfg configFile)
internal/llm/resolver_test.go:276
↓ 12 callers
Method
GetDiff
GetDiff returns all changes as parsed model.Diff structs.
internal/diff/git.go:173
↓ 12 callers
Method
Manifest
Manifest returns the run's coverage builder, or nil for legacy/scan sessions that did not opt in via SessionOptions.Operation. Callers must be nil-saf
internal/session/history.go:187
↓ 12 callers
Function
NormalizeAuthHeader
NormalizeAuthHeader normalizes an auth header value to a canonical form. It returns an error for unrecognized values.
internal/llm/resolver.go:639
↓ 12 callers
Method
Output
Output executes a git command and returns stdout only.
internal/gitcmd/runner.go:60
↓ 12 callers
Method
Read
Read returns the full content of a file path (relative to RepoDir), resolved according to the active review mode. - Workspace: reads directly from the
internal/tool/filereader.go:71
↓ 12 callers
Function
cloneProviderEntry
cloneProviderEntry deep-copies a ProviderEntry so callers (rollback paths, map cloning) can safely mutate the returned value without aliasing the orig
cmd/opencodereview/provider_tui.go:1184
↓ 12 callers
Function
errAttempt
(class ErrorClass, phase FailurePhase, status int)
internal/llm/retry_report_test.go:30
↓ 12 callers
Function
log
(msg)
scripts/github-actions/post-review-comments.js:88
↓ 12 callers
Function
log
(msg)
examples/gitlab_ci/post_review.py:54
↓ 12 callers
Function
modelTUIIdxForName
(t *testing.T, m modelTUIModel, name string)
cmd/opencodereview/provider_tui_funcs_test.go:1072
↓ 12 callers
Function
mustUnmarshal
mustUnmarshal is a test helper that unmarshals SARIF output and fails the test on error, so malformed output produces a clear failure instead of a nil
cmd/opencodereview/sarif_test.go:23
↓ 12 callers
Function
newModelTUI
newModelTUI builds a model-only TUI for tests. It has no config path or existing config, so add/delete/persist operations are unavailable — use newMod
cmd/opencodereview/provider_tui.go:2491
↓ 12 callers
Function
resolveLocale
(raw: string)
extensions/vscode/src/shared/i18n.ts:330
↓ 12 callers
Function
writeFile
(t *testing.T, root, rel string, content []byte)
internal/scan/provider_test.go:105
↓ 11 callers
Method
Await
Await blocks until all submitted work has completed and returns aggregated results from every Submit call so far. A panic in submitted work is recove
internal/llmloop/pool.go:129
↓ 11 callers
Method
CompletionTokenLimit
CompletionTokenLimit returns the output cap for LLM requests. Runtime prompt-limit overrides must not silently expand the model's output budget.
internal/config/template/template.go:54
↓ 11 callers
Method
ResolveDetail
(path string)
internal/config/rules/system_rules.go:123
↓ 11 callers
Function
SetAttr
SetAttr sets a single attribute on a span.
internal/telemetry/span.go:66
↓ 11 callers
Method
SetResponse
SetResponse records the LLM response in the most recent TaskRecord of the given type. It uses actual token usage from the API response when available,
internal/session/history.go:407
↓ 11 callers
Method
Warnings
()
cmd/opencodereview/shared.go:326
↓ 11 callers
Method
applyResumeLine
applyResumeLine folds one record into the index. It reports an unparseable line to the caller, which decides whether that is fatal.
internal/session/resume.go:150
↓ 11 callers
Function
cm
(path, content string)
internal/tool/comment_collector_test.go:12
↓ 11 callers
Function
generateUUID
()
internal/session/persist.go:63
↓ 11 callers
Function
http_error
(code, body=b"", reason="error")
examples/gerrit_ci/post_review_test.py:271
↓ 11 callers
Function
mustJSON
--- helpers ---
internal/session/resume_test.go:736
↓ 11 callers
Function
officialConfigModelTUI
(t *testing.T, configPath string, extraModels []string)
cmd/opencodereview/provider_tui_funcs_test.go:987
↓ 11 callers
Function
outputSARIF
outputSARIF writes a SARIF v2.1.0 document to stdout. The document always contains a single run with the 8 built-in category rules, one result per Llm
cmd/opencodereview/sarif.go:131
↓ 11 callers
Method
post
(msg: HostToWebview)
extensions/vscode/src/extension/providers/SidebarProvider.ts:56
↓ 11 callers
Function
renderTemplate
(w http.ResponseWriter, name string, data any)
internal/viewer/server.go:299
↓ 11 callers
Function
retryReportFixture
retryReportFixture is the report used by most rendering assertions: one request recovered after two errors, one request that never succeeded, and a to
cmd/opencodereview/retry_report_render_test.go:22
↓ 11 callers
Function
useResponsive
()
pages/src/hooks/useResponsive.ts:12
↓ 10 callers
Function
LoadDefault
LoadDefault parses the embedded system_rules.json and resolves rule file references.
internal/config/rules/system_rules.go:90
↓ 10 callers
Function
NewFileRead
(fr *FileReader)
internal/tool/file_read.go:19
↓ 10 callers
Function
NewManifestBuilder
NewManifestBuilder creates a builder for a run identified by runID (the canonical session ID) and operation ("review" or "scan").
internal/session/manifest.go:351
↓ 10 callers
Function
NewProvider
NewProvider creates a Provider that enumerates the repository at repoDir. If paths is non-empty each element must be a repo-relative path (file or dir
internal/scan/provider.go:54
↓ 10 callers
Function
NewWorkspaceProvider
NewWorkspaceProvider creates a Provider for workspace mode (current uncommitted changes).
internal/diff/git.go:87
↓ 10 callers
Method
RecordReviewItemFailed
RecordReviewItemFailed persists an incomplete file-level checkpoint.
internal/session/history.go:295
↓ 10 callers
Method
Restore
Restore re-enables stdout. Safe to call multiple times.
cmd/opencodereview/shared.go:307
↓ 10 callers
Function
SessionTaskKey
SessionTaskKey derives the prompt-cache affinity key for one task conversation within a session. Prompt caches match on prefixes, and OCR's task types
internal/llm/sessionkey.go:51
↓ 10 callers
Method
ToolCalls
()
cmd/opencodereview/shared.go:331
↓ 10 callers
Method
beginAPIKeyReplace
beginAPIKeyReplace switches from the fixed-length mask placeholder to edit mode so the next keystroke or paste fully replaces the saved key. While edi
cmd/opencodereview/provider_tui.go:867
↓ 10 callers
Method
buildGrepArgs
(searchText string, caseSensitive bool, usePerlRegexp bool, noIndex bool, pathspec []string)
internal/tool/code_search.go:58
↓ 10 callers
Function
defaultConfigPath
Default config file location: ~/.opencodereview/config.json
cmd/opencodereview/config_cmd.go:91
↓ 10 callers
Function
expandBraces
expandBraces turns "{a,b,c}" style patterns into individual strings. e.g. "*.go.{java,kotlin}" → ["*.go.java", "*.go.kotlin"]. If no braces exist, ret
internal/config/rules/system_rules.go:172
↓ 10 callers
Function
gitCommitFile
gitCommitFile writes a file and commits it, returning after the commit lands.
cmd/opencodereview/delegate_exec_test.go:41
↓ 10 callers
Function
initTestRepo
(t *testing.T)
internal/scan/provider_test.go:84
↓ 10 callers
Function
loadCommonContext
loadCommonContext validates the working directory, loads the embedded template, raises MaxToolRequestTimes when maxTools exceeds the default, resolves
cmd/opencodereview/shared.go:72
↓ 10 callers
Function
makeDiff
()
internal/diff/relocation_test.go:44
↓ 10 callers
Function
matchConsecutive
matchConsecutive scans sideLines for a consecutive run matching all targetLines.
internal/diff/resolver.go:151
↓ 10 callers
Function
newTestClient
(name string, tools []*mcp.Tool)
internal/mcp/provider_test.go:14
↓ 10 callers
Function
readWorkspaceFileForDiff
(repoDir, relPath string)
internal/diff/workspace_file.go:14
↓ 10 callers
Function
resolveUsage
resolveUsage parses raw JSON bytes into a map and extracts token usage by probing configured paths sequentially. Returns nil if no total_tokens found.
internal/llm/usage_resolver.go:76
↓ 10 callers
Function
silenceStdout
silenceStdout redirects os.Stdout to /dev/null for the duration of fn so the delegate commands' Printf output does not clutter test logs.
cmd/opencodereview/delegate_exec_test.go:56
↓ 10 callers
Function
taskDoneResponse
()
internal/llmloop/loop_test.go:62
↓ 10 callers
Method
whyExcluded
whyExcluded applies the filter algorithm as shouldReview but returns the specific reason a file is excluded.
internal/agent/preview.go:34
↓ 10 callers
Function
writeTempFile
writeTempFile writes content to a temporary file and returns its path.
cmd/opencodereview/background_file_test.go:15
↓ 10 callers
Function
yKey
()
cmd/opencodereview/provider_tui_test.go:1142
↓ 9 callers
Method
CompletionsWithCtx
CompletionsWithCtx sends a chat completion request with context support. The deferred finalizeRequest is this client's boundary for the retry report;
internal/llm/client.go:794
↓ 9 callers
Function
Dynamic
Dynamic creates a Tool with the given name for dynamically discovered tools (e.g. MCP).
internal/tool/definitions.go:51
↓ 9 callers
Method
Enumerate
Enumerate returns one ScanItem per reviewable file. Binaries are emitted with empty Content + IsBinary=true so previews can show them as excluded.
internal/scan/provider.go:80
↓ 9 callers
Function
Event
Event emits a structured event as a span with immediate end.
internal/telemetry/events.go:23
↓ 9 callers
Function
NewCommitProvider
NewCommitProvider creates a Provider for commit mode: show changes introduced by a single commit.
internal/diff/git.go:77
↓ 9 callers
Function
NewFileFind
(fr *FileReader)
internal/tool/file_find.go:28
↓ 9 callers
Function
NewLLMClient
--- Factory --- NewLLMClient creates the appropriate client based on the resolved endpoint protocol. protocol dispatch (canonical names from protocol.
internal/llm/client.go:268
↓ 9 callers
Function
NormalizeProtocol
NormalizeProtocol canonicalizes protocol names. It is case-insensitive and trims whitespace. Empty string is returned as-is (the caller decides the de
internal/llm/protocol.go:37
↓ 9 callers
Function
ParseDiffText
ParseDiffText splits the unified diff text into per-file Diff structs. ref, if non-empty, is a git ref used to read new-file content via git show inst
internal/diff/parser.go:33
↓ 9 callers
Method
ResolveInput
ResolveInput freezes this run's commit endpoints by asking git, following the input-mode matrix: - range: base = merge-base(from,to); head = the
internal/diff/git.go:124
↓ 9 callers
Method
SetRunFailure
SetRunFailure records why the whole run stopped. It rejects an invalid class (so an unclassifiable stop is never silently downgraded) and a change of
internal/session/manifest.go:415
← previous
next →
101–200 of 4,075, ranked by callers