MCPcopy Create free account

hub / github.com/alibaba/open-code-review / functions

Functions3,095 in github.com/alibaba/open-code-review

↓ 5 callersMethodplanEnabled
planEnabled / dedupEnabled / summaryEnabled report whether each optional phase will actually run: template must define it AND the corresponding --no-*
internal/scan/agent.go:75
↓ 5 callersMethodpost_seq
Drive post() over a sequence of per-call fake_urlopen outcomes. Each outcome is either the raw response body (bytes, returned) or an
examples/gerrit_ci/post_review_test.py:561
↓ 5 callersMethodread
(self)
examples/gitlab_ci/post_review_test.py:87
↓ 5 callersFunctionreadRuleFileSafe
readRuleFileSafe reads and validates a rule file. It enforces extension whitelist (.md / .txt / .markdown), a 512 KB size cap, and resolves symlinks b
internal/config/rules/system_rules.go:533
↓ 5 callersFunctionreviewItemFingerprint
(mode string, d model.Diff)
internal/agent/agent.go:563
↓ 5 callersFunctionrunConfigUnset
(key string)
cmd/opencodereview/config_cmd.go:133
↓ 5 callersFunctionsanitizeTerminal
(s string)
cmd/opencodereview/output.go:201
↓ 5 callersFunctionsleep
(ms)
scripts/github-actions/post-review-comments.js:1052
↓ 5 callersFunctionsplitPaths
(raw string)
cmd/opencodereview/scan_cmd.go:79
↓ 4 callersMethodAwaitKey
AwaitKey blocks until every unit submitted under key so far has completed. It never touches the pool-wide WaitGroup, so it is safe to call while other
internal/llmloop/pool.go:138
↓ 4 callersMethodBudgetExceeded
BudgetExceeded reports whether a token/tool-call budget gate stopped the run before all files were reviewed. The run still returns partial comments; t
cmd/opencodereview/shared.go:262
↓ 4 callersFunctionDefaultConfig
DefaultConfig returns a disabled default configuration.
internal/telemetry/config.go:29
↓ 4 callersMethodDiffs
()
cmd/opencodereview/shared.go:241
↓ 4 callersMethodHasInclude
HasInclude reports whether any include patterns are configured.
internal/config/rules/system_rules.go:201
↓ 4 callersFunctionIsReserved
IsReserved reports whether name matches any built-in tool name (including Unknown).
internal/tool/definitions.go:38
↓ 4 callersFunctionLoadAppConfig
LoadAppConfig loads config from path. Returns nil, nil if file does not exist.
cmd/opencodereview/config_cmd.go:334
↓ 4 callersFunctionLoadGitignorePatterns
LoadGitignorePatterns reads and parses .gitignore patterns from the given repository root. Returns nil if the file is missing or unreadable.
internal/diff/gitignore.go:14
↓ 4 callersFunctionParseExtraHeaders
ParseExtraHeaders parses a string of comma-separated key=value pairs into a dictionary. Values may be double-quoted to include commas, e.g. X-Forwarde
internal/llm/resolver.go:609
↓ 4 callersFunctionPrintTraceSummary
PrintTraceSummary prints a one-line summary of the review to stdout.
internal/telemetry/events.go:69
↓ 4 callersMethodProjectSummary
ProjectSummary is the markdown project-level summary produced by scan's PROJECT_SUMMARY_TASK. Empty for review mode and for scans that skipped / faile
cmd/opencodereview/shared.go:252
↓ 4 callersFunctionRecordFilesReviewed
(ctx context.Context, n int64)
internal/telemetry/metrics.go:84
↓ 4 callersFunctionRecordToolResult
RecordToolResult sets the outcome of a tool execution on the span.
internal/telemetry/span.go:90
↓ 4 callersMethodRecordWarning
RecordWarning adds a non-fatal warning.
internal/llmloop/loop.go:89
↓ 4 callersFunctionShutdown
Shutdown flushes and shuts down all initialized providers. It should be called before process exit to ensure buffered data is exported.
internal/telemetry/shutdown.go:12
↓ 4 callersMethodString
String renders a one-line human-readable estimate, matching scan.Estimate's format so diff and scan warnings read consistently. Money is intentionally
internal/agent/estimate.go:91
↓ 4 callersMethodSubmit
Submit runs f in a background goroutine bounded by the semaphore. When f completes its return value is collected internally.
internal/llmloop/pool.go:60
↓ 4 callersFunctionToToolDef
ToToolDef converts an MCP tool definition to an llm.ToolDef.
internal/mcp/provider.go:67
↓ 4 callersMethodTotalInputTokens
TotalInputTokens returns the accumulated input/prompt tokens from all LLM calls.
internal/llmloop/loop.go:63
↓ 4 callersFunctionUseTestSessions
UseTestSessions redirects session persistence to the "test-sessions" subdirectory so that test runs do not pollute the real sessions store. It must b
internal/session/testing.go:8
↓ 4 callersFunctionWithinBase
WithinBase reports whether target is base itself or contained under base.
internal/pathutil/path.go:19
↓ 4 callersMethodacquire
(ctx context.Context)
internal/gitcmd/runner.go:29
↓ 4 callersFunctionaddRepoFlag
(cmd *cobra.Command, target *string)
cmd/opencodereview/shared_flags.go:10
↓ 4 callersFunctionagentTaskDoneResponse
()
internal/agent/agent_test.go:35
↓ 4 callersFunctionapplyModelDeleteToEntry
(entry ProviderEntry, name string)
cmd/opencodereview/provider_tui.go:431
↓ 4 callersFunctionapplyOfficialProviderConfig
(configPath string, cfg *Config, result providerTUIResult)
cmd/opencodereview/provider_cmd.go:227
↓ 4 callersFunctionbatchPaths
(b [][]model.ScanItem)
internal/scan/batch_test.go:18
↓ 4 callersFunctionbuildAllowedHosts
buildAllowedHosts returns the default-deny allowlist used by the host guard. The set always includes the standard loopback names. If bindHost is a con
internal/viewer/hostguard.go:58
↓ 4 callersFunctionbuildPolicy
({ severityThreshold, categories } = {})
scripts/github-actions/post-review-comments.js:1398
↓ 4 callersFunctionclearCfgActiveModelIfDeleted
(cfg *Config, providerName, name string)
cmd/opencodereview/provider_tui.go:439
↓ 4 callersFunctioncmt
(path, content string)
internal/scan/dedup_test.go:10
↓ 4 callersFunctioncomputeRetryDelayMs
(error, attempt)
scripts/github-actions/post-review-comments.js:1079
↓ 4 callersMethodcustomProviderActiveModel
(cp customProviderListItem)
cmd/opencodereview/provider_tui.go:199
↓ 4 callersMethoddedupEnabled
()
internal/scan/agent.go:79
↓ 4 callersFunctiondefaultAuthHeader
(protocol string)
internal/llm/resolver.go:559
↓ 4 callersFunctionemitFailureUsage
emitFailureUsage writes a best-effort structured usage record to stderr when a review fails (INV-4): the outer caller must still see the cost of the f
cmd/opencodereview/output.go:365
↓ 4 callersFunctionensureMessagesSuffix
ensureMessagesSuffix appends /v1/messages to base URLs that lack a versioned path.
internal/llm/resolver.go:673
↓ 4 callersFunctionestimateCost
(items []model.ScanItem, planEnabled, dedupEnabled, summaryEnabled bool)
internal/scan/estimate.go:59
↓ 4 callersFunctionestimateDiffFileTokens
estimateDiffFileTokens projects the input+output token cost of reviewing a single diff (PLAN + MAIN_TASK rounds). It mirrors scan.estimateFileTokens b
internal/agent/estimate.go:52
↓ 4 callersMethodexecuteSubtask
executeSubtask runs the scan pipeline for one file: 1. Optional PLAN_TASK: produce a JSON checklist of focus areas. 2. MAIN_TASK: review the file with
internal/scan/agent.go:543
↓ 4 callersFunctionfencedBlock
(content, language = "")
scripts/github-actions/post-review-comments.js:1614
↓ 4 callersMethodfilterLargeDiffs
filterLargeDiffs drops diffs whose diff content alone consumes more than 80% of MaxTokens.
internal/agent/agent.go:840
↓ 4 callersMethodfilterLargeScans
filterLargeScans drops items whose content exceeds 80% of MaxTokens.
internal/scan/agent.go:328
↓ 4 callersMethodfindCustomIdx
(name string)
cmd/opencodereview/provider_tui.go:1289
↓ 4 callersFunctionformatPlanGuidance
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:854
↓ 4 callersFunctiongetShellEnv
()
extensions/vscode/src/extension/services/shellEnv.ts:26
↓ 4 callersFunctionhandleSession
(w http.ResponseWriter, r *http.Request, root, repo, sessionID string)
internal/viewer/handler.go:61
↓ 4 callersFunctionhandleSessions
(w http.ResponseWriter, r *http.Request, root, repo string)
internal/viewer/handler.go:32
↓ 4 callersFunctionhumanTokens
humanTokens formats a token count as e.g. "1.2M" / "850K" / "420".
internal/scan/estimate.go:111
↓ 4 callersFunctionhumanTokens
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:98
↓ 4 callersMethodisUserAddedOfficialModel
(name string)
cmd/opencodereview/provider_tui.go:464
↓ 4 callersFunctionitemList
(paths ...string)
internal/scan/batch_test.go:10
↓ 4 callersMethodmaybeRunDedup
maybeRunDedup, when the template has a DedupTask and the batch produced at least DedupMinComments comments, invokes the DEDUP_TASK LLM to merge near-d
internal/scan/agent.go:713
↓ 4 callersMethodmaybeRunProjectSummary
maybeRunProjectSummary runs the post-batch PROJECT_SUMMARY_TASK over the union of all collected comments. Best-effort: any error / empty input no-temp
internal/scan/agent.go:637
↓ 4 callersMethodmodelProviderName
()
cmd/opencodereview/provider_tui.go:394
↓ 4 callersFunctionnKey
()
cmd/opencodereview/provider_tui_test.go:1087
↓ 4 callersFunctionnewModelTUIConfig
(cfg modelTUIConfig)
cmd/opencodereview/provider_tui.go:2497
↓ 4 callersFunctionnormalizeLine
normalizeLine removes leading/trailing whitespace and strips any leading '+' or '-' diff marker.
internal/diff/resolver.go:232
↓ 4 callersFunctionoutputJSONWithWarnings
(comments []model.LlmComment, warnings []agent.AgentWarning, filesReviewed, inputTokens, outputTokens, totalT
cmd/opencodereview/output.go:272
↓ 4 callersFunctionoutputTextWithWarnings
(comments []model.LlmComment, warnings []agent.AgentWarning)
cmd/opencodereview/output.go:39
↓ 4 callersFunctionparseNameStatus
(output: string)
extensions/vscode/src/extension/services/gitMap.ts:158
↓ 4 callersFunctionparseNonNegInt
(val, defaultVal)
scripts/github-actions/post-review-comments.js:1061
↓ 4 callersFunctionpartitionMessages
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:123
↓ 4 callersFunctionpeekSession
peekSession reads the first record, all review_item records (for comment count), and the last record of a JSONL file.
internal/viewer/store.go:125
↓ 4 callersMethodpost
(msg: ConfigPanelHostToWebview)
extensions/vscode/src/extension/providers/ConfigPanelProvider.ts:58
↓ 4 callersFunctionprintVersion
()
cmd/opencodereview/version.go:24
↓ 4 callersMethodread
(self)
examples/gerrit_ci/post_review_test.py:514
↓ 4 callersFunctionreadAllPages
(tag, pageFn, log, maxPages = 50)
scripts/github-actions/post-review-comments.js:1227
↓ 4 callersMethodrelease
()
internal/gitcmd/runner.go:41
↓ 4 callersFunctionrenderListName
(name string, isCursor bool)
cmd/opencodereview/provider_tui.go:1946
↓ 4 callersFunctionresolveBackgroundFilePath
(repoDir, path string)
cmd/opencodereview/background_file.go:22
↓ 4 callersFunctionresolveRepoDir
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:272
↓ 4 callersMethodresolvedModel
resolvedModel returns the model to persist, falling back to the in-session pick for the provider being finalized when result.model is empty.
cmd/opencodereview/provider_tui.go:85
↓ 4 callersMethodrunGit
(ctx context.Context, args ...string)
internal/diff/git.go:394
↓ 4 callersFunctionrunLLMTest
()
cmd/opencodereview/llm_cmd.go:44
↓ 4 callersMethodselectedModel
()
cmd/opencodereview/provider_tui.go:2883
↓ 4 callersMethodselectedModelFromState
()
cmd/opencodereview/provider_tui.go:1819
↓ 4 callersFunctionsetupFileFindRepo
(t *testing.T)
internal/tool/file_find_test.go:89
↓ 4 callersMethodsummaryEnabled
()
internal/scan/agent.go:83
↓ 4 callersFunctiontaskDoneResponse
()
internal/llmloop/loop_test.go:54
↓ 4 callersFunctiontaskDoneResponseWithArguments
(arguments string)
internal/llmloop/loop_test.go:33
↓ 4 callersFunctionunquoteGitPath
(path: string)
extensions/vscode/src/extension/services/gitMap.ts:127
↓ 4 callersFunctionunsetCustomProvider
(configPath, name string)
cmd/opencodereview/config_cmd.go:187
↓ 4 callersFunctionunsetMCPServer
(configPath, name string)
cmd/opencodereview/config_cmd.go:210
↓ 4 callersFunctionuseSectionTitleStyle
()
pages/src/hooks/useResponsiveStyle.ts:12
↓ 4 callersFunctionuserAgent
(provider string)
internal/llm/client.go:26
↓ 4 callersFunctionvalidateTimeoutSec
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:146
↓ 3 callersMethodCallTool
CallTool invokes a tool on the MCP server and returns the text result.
internal/mcp/client.go:155
↓ 3 callersMethodCompletionsWithCtx
CompletionsWithCtx sends a Responses API request and maps the result back to the shared ChatResponse shape.
internal/llm/responses_client.go:74
↓ 3 callersFunctionComputeLineDiff
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:24
↓ 3 callersFunctionContentLogging
ContentLogging returns true when content logging is enabled via OCR_CONTENT_LOGGING.
internal/telemetry/provider.go:75
← previousnext →301–400 of 3,095, ranked by callers