Repository Analysis

anomalyco/opencode

The open source coding agent.

0.6 Likely human-written View on GitHub
0.6
Adjusted Score
0.6
Raw Score
100%
Time Factor
2026-05-30
Last Push
167,230
Stars
TypeScript
Language
581,379
Lines of Code
2727
Files
288
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 3HIGH 2MEDIUM 9LOW 274

Pattern Findings

288 matches across 11 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers162 hits · 171 pts
SeverityFileLineSnippet
LOWscript/upgrade-opentui.ts184function findStaleLockfileEntriesInText(txt: string) {
LOWscript/github/close-prs.ts369function requireNonNegativeInteger(name: string, value: string | undefined) {
LOW…es/effect-drizzle-sqlite/src/internal/drizzle-utils.ts25export function getViewSelectedFieldsRuntime(view: SQLiteViewBase) {
LOW…ages/effect-drizzle-sqlite/src/up-migrations/sqlite.ts39export function prepareSQLiteMigrationBackfill(
LOW…ages/effect-drizzle-sqlite/src/up-migrations/sqlite.ts96export function buildSQLiteMigrationBackfillStatements(
LOWpackages/ui/src/pierre/selection-bridge.ts67export function restoreShadowTextSelection(root: ShadowRoot | undefined, range: Range | undefined) {
LOWpackages/ui/src/pierre/selection-bridge.ts82export function createLineNumberSelectionBridge() {
LOWpackages/ui/src/pierre/comment-hover.ts6export function createHoverCommentUtility(props: {
LOWpackages/ui/src/v2/components/segmented-control-v2.tsx27function useSegmentedControlContext() {
LOWpackages/ui/src/components/line-comment-annotations.tsx572export function createLineCommentHoverRenderer(props: {
LOWpackages/ui/src/components/file.tsx545function createLocalVirtualStrategy(host: () => HTMLDivElement | undefined, enabled: () => boolean): VirtualStrategy {
LOWpackages/ui/src/components/file.tsx579function createSharedVirtualStrategy(host: () => HTMLDivElement | undefined, enabled: () => boolean): VirtualStrategy {
LOWpackages/ui/src/components/dropdown-menu.tsx173function DropdownMenuItemDescription(props: ParentProps<DropdownMenuItemDescriptionProps>) {
LOWpackages/ui/src/components/dropdown-menu.tsx189function DropdownMenuItemIndicator(props: ParentProps<DropdownMenuItemIndicatorProps>) {
LOWpackages/ui/src/components/context-menu.tsx173function ContextMenuItemDescription(props: ParentProps<ContextMenuItemDescriptionProps>) {
LOWpackages/ui/src/theme/resolve.ts516function generateNeutralAlphaScale(neutralScale: HexColor[], isDark: boolean): HexColor[] {
LOW…ub-copilot/chat/map-openai-compatible-finish-reason.ts3export function mapOpenAICompatibleFinishReason(
LOW…lot/chat/convert-to-openai-compatible-chat-messages.ts13export function convertToOpenAICompatibleChatMessages(prompt: LanguageModelV3Prompt): OpenAICompatibleChatPrompt {
LOW…opilot/responses/map-openai-responses-finish-reason.ts3export function mapOpenAIResponseFinishReason({
LOW…copilot/responses/convert-to-openai-responses-input.ts21export async function convertToOpenAIResponsesInput({
LOW…b-copilot/responses/openai-responses-language-model.ts1580function isResponseOutputItemDoneChunk(
LOW…b-copilot/responses/openai-responses-language-model.ts1586function isResponseOutputItemDoneReasoningChunk(chunk: z.infer<typeof openaiResponsesChunkSchema>): chunk is z.infer<
LOW…b-copilot/responses/openai-responses-language-model.ts1606function isResponseFunctionCallArgumentsDeltaChunk(
LOW…b-copilot/responses/openai-responses-language-model.ts1611function isResponseImageGenerationCallPartialImageChunk(
LOW…b-copilot/responses/openai-responses-language-model.ts1617function isResponseCodeInterpreterCallCodeDeltaChunk(
LOW…b-copilot/responses/openai-responses-language-model.ts1623function isResponseCodeInterpreterCallCodeDoneChunk(
LOW…b-copilot/responses/openai-responses-language-model.ts1629function isResponseOutputItemAddedChunk(
LOW…b-copilot/responses/openai-responses-language-model.ts1635function isResponseOutputItemAddedReasoningChunk(chunk: z.infer<typeof openaiResponsesChunkSchema>): chunk is z.infer<
LOW…b-copilot/responses/openai-responses-language-model.ts1643function isResponseAnnotationAddedChunk(
LOW…b-copilot/responses/openai-responses-language-model.ts1649function isResponseReasoningSummaryPartAddedChunk(
LOW…b-copilot/responses/openai-responses-language-model.ts1655function isResponseReasoningSummaryTextDeltaChunk(
LOWpackages/app/e2e/smoke/session-timeline.spec.ts374async function expectSessionTimelineReady(
LOWpackages/app/src/context/comments.tsx78function createCommentSessionState(store: Store<CommentStore>, setStore: SetStoreFunction<CommentStore>) {
LOWpackages/app/src/context/comments.tsx164export function createCommentSessionForTest(comments: Record<string, LineComment[]> = {}) {
LOWpackages/app/src/context/terminal.tsx86export function getWorkspaceTerminalCacheKey(dir: string, scope?: string) {
LOWpackages/app/src/context/terminal.tsx111export function getLegacyTerminalStorageKeys(dir: string, legacySessionID?: string) {
LOWpackages/app/src/context/terminal.tsx156function createWorkspaceTerminalSession(
LOWpackages/app/src/context/model-variant.ts21export function getConfiguredAgentVariant(input: { agent: Agent | undefined; model: Model | undefined }) {
LOWpackages/app/src/context/command.tsx105export function upsertCommandRegistration(registrations: CommandRegistration[], entry: CommandRegistration) {
LOW…ckages/app/src/context/global-sync/session-prefetch.ts12export function shouldSkipSessionPrefetch(input: { message: boolean; info?: Meta; chunk: number; now?: number }) {
LOW…ckages/app/src/context/global-sync/session-prefetch.ts34export function getSessionPrefetchPromise(directory: string, sessionID: string) {
LOW…ckages/app/src/context/global-sync/session-prefetch.ts38export function clearSessionPrefetchInflight() {
LOW…ckages/app/src/context/global-sync/session-prefetch.ts91export function clearSessionPrefetchDirectory(directory: string) {
LOWpackages/app/src/context/global-sync/event-reducer.ts64export function cleanupDroppedSessionCaches(
LOWpackages/app/src/context/global-sync/session-load.ts3export async function loadRootSessionsWithFallback(input: RootLoadArgs) {
LOWpackages/app/src/context/global-sync/session-cache.ts47export function pickSessionCacheEvictions(input: {
LOWpackages/app/src/utils/server-errors.ts51function isProviderModelNotFoundErrorLike(error: unknown): error is ProviderModelNotFoundError {
LOWpackages/app/src/utils/server-errors.ts57export function parseReadableConfigInvalidError(errorInput: ConfigInvalidError, translator?: Translator) {
LOWpackages/app/src/utils/server-errors.ts75function parseReadableProviderModelNotFoundError(errorInput: ProviderModelNotFoundError, translator?: Translator) {
LOWpackages/app/src/components/titlebar-session-events.ts12export function readSessionTabsRemovedDetail(event: Event): SessionTabsRemovedDetail | undefined {
LOWpackages/app/src/components/prompt-input/history.ts25export function canNavigateHistoryAtCursor(direction: "up" | "down", text: string, cursor: number, inHistory = false) {
LOWpackages/app/src/components/prompt-input/history.ts55export function clonePromptHistoryComments(comments: PromptHistoryComment[]) {
LOWpackages/app/src/components/prompt-input/history.ts62export function normalizePromptHistoryEntry(entry: PromptHistoryStoredEntry): PromptHistoryEntry {
LOW…s/app/src/components/session/session-context-format.ts3export function createSessionContextFormatter(locale: string) {
LOW…pp/src/components/session/session-context-breakdown.ts70export function estimateSessionContextBreakdown(args: {
LOWpackages/app/src/pages/session.tsx90function createSessionHistoryLoader(input: SessionHistoryWindowInput) {
LOWpackages/app/src/pages/layout/inline-editor.tsx5export function createInlineEditorController() {
LOWpackages/app/src/pages/session/message-timeline.tsx596 function scheduleMeasuredBottomAnchor() {
LOW…p/src/pages/session/composer/session-composer-state.ts26export function createSessionComposerState(options?: { closeMs?: number | (() => number) }) {
LOWpackages/web/src/components/icons/index.tsx18export function IconAdjustmentsHorizontal(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
102 more matches not shown…
Over-Commented Block76 hits · 76 pts
SeverityFileLineSnippet
LOWpatches/install-korean-ime-fix.sh1#!/usr/bin/env bash
LOWpackages/ui/src/context/marked.tsx21 // "terminal.titleForeground": "#adadb1",
LOWpackages/ui/src/components/thinking-heading.stories.tsx41// Custom properties driven by sliders:
LOWpackages/llm/test/provider/bedrock-converse.test.ts561})
LOWpackages/llm/example/tutorial.ts21const model = OpenAI.configure({
LOWpackages/llm/src/cache-policy.ts1// Apply an `LLMRequest.cache` policy by injecting `CacheHint`s onto the parts
LOWpackages/llm/src/protocols/openai-responses.ts581
LOWpackages/llm/src/protocols/gemini.ts141const mediaData = ProviderShared.mediaBytes
LOWpackages/llm/src/protocols/gemini.ts281// =============================================================================
LOWpackages/llm/src/protocols/openai-chat.ts281// =============================================================================
LOWpackages/web/src/components/share/content-diff.tsx201// @@ -1,21 +1,25 @@
LOWpackages/web/src/components/share/content-diff.tsx221// +normalized content with consistent spacing
LOWpackages/opencode/test/provider/gitlab-duo.test.ts1export {}
LOWpackages/opencode/test/provider/gitlab-duo.test.ts21// JSON.stringify({
LOWpackages/opencode/test/provider/gitlab-duo.test.ts41// await using tmp = await tmpdir({
LOWpackages/opencode/test/provider/gitlab-duo.test.ts61// Env.set("GITLAB_TOKEN", "test-token")
LOWpackages/opencode/test/provider/gitlab-duo.test.ts81// },
LOWpackages/opencode/test/provider/gitlab-duo.test.ts101// },
LOWpackages/opencode/test/provider/gitlab-duo.test.ts121// const authPath2 = path.join(Global.Path.data, "auth.json")
LOWpackages/opencode/test/provider/gitlab-duo.test.ts141// },
LOWpackages/opencode/test/provider/gitlab-duo.test.ts161// )
LOWpackages/opencode/test/provider/gitlab-duo.test.ts181// path.join(dir, "opencode.json"),
LOWpackages/opencode/test/provider/gitlab-duo.test.ts201// const providers = await list()
LOWpackages/opencode/test/provider/gitlab-duo.test.ts221// Env.set("GITLAB_TOKEN", "test-token")
LOWpackages/opencode/test/provider/gitlab-duo.test.ts241// gitlab: {
LOWpackages/opencode/test/provider/gitlab-duo.test.ts261// expect(providers[ProviderID.gitlab]).toBeDefined()
LOWpackages/opencode/test/provider/gitlab-duo.test.ts281// init: async () => {
LOWpackages/opencode/test/provider/gitlab-duo.test.ts301// },
LOWpackages/opencode/test/provider/gitlab-duo.test.ts321// cost: { input: 0, output: 0, cache: { read: 0, write: 0 } },
LOWpackages/opencode/test/provider/gitlab-duo.test.ts341// },
LOWpackages/opencode/test/provider/gitlab-duo.test.ts361// const language = await getLanguage(model)
LOWpackages/opencode/test/provider/gitlab-duo.test.ts381// const gitlab = providers[ProviderID.gitlab]
LOWpackages/opencode/test/provider/gitlab-duo.test.ts401// Env.set("GITLAB_TOKEN", "test-token")
LOW…opencode/test/server/httpapi-event-diagnostics.test.ts1// Diagnostic suite for /event SSE delivery.
LOW…kages/opencode/test/cli/tui/prompt-submit-race.test.ts1import { describe, expect, test } from "bun:test"
LOWpackages/opencode/test/cli/smokes/read-only.test.ts1// Tier-A smoke tests for read-only commands. Each test asserts only that the
LOW…kages/opencode/test/cli/run/scrollback.surface.test.ts401 } finally {
LOW…kages/opencode/test/cli/run/scrollback.surface.test.ts421// is false, and a filetype is set — it relies on the next
LOWpackages/opencode/test/cli/help/help-snapshots.test.ts1// Help-text snapshots for every CLI command + key subcommand. Catches
LOWpackages/opencode/test/cli/help/help-snapshots.test.ts21//
LOWpackages/opencode/test/lib/snapshot.ts1// Shared normalization helpers for cross-OS-stable snapshot tests.
LOWpackages/opencode/test/lib/cli-process.ts1// Subprocess test harness for the opencode CLI. Spawns the real binary against
LOWpackages/opencode/test/lib/cli-process.ts141 // Closes stdin. ACP exits cleanly on stdin EOF; the scope finalizer also
LOWpackages/opencode/test/lib/cli-process.ts201 // ignore; ChildProcess.make defaults to pipe, so we set it explicitly.
LOWpackages/opencode/test/tool/question.test.ts101 // header: "This Header is Definitely More Than Thirty Characters Long",
LOWpackages/opencode/test/tool/question.test.ts121 // options: [
LOWpackages/opencode/test/session/compaction.test.ts441 Effect.gen(function* () {
LOWpackages/opencode/src/plugin/xai.ts581 let refreshPromise: Promise<RefreshResult> | undefined
LOWpackages/opencode/src/cli/cmd/run.ts1// CLI entry point for `opencode run`.
LOWpackages/opencode/src/cli/cmd/run/question.shared.ts1// Pure state machine for the question UI.
LOWpackages/opencode/src/cli/cmd/run/tool.ts1// Per-tool display rules shared across `opencode run` output paths.
LOWpackages/opencode/src/cli/cmd/run/demo.ts1// Demo mode for testing direct interactive mode without a real SDK.
LOWpackages/opencode/src/cli/cmd/run/footer.ts1// RunFooter -- the mutable control surface for direct interactive mode.
LOWpackages/opencode/src/cli/cmd/run/footer.permission.tsx1// Permission UI body for the direct-mode footer.
LOWpackages/opencode/src/cli/cmd/run/stream.transport.ts1// Global event subscription and prompt turn coordination.
LOWpackages/opencode/src/cli/cmd/run/footer.question.tsx1// Question UI body for the direct-mode footer.
LOWpackages/opencode/src/cli/cmd/run/runtime.ts1// Top-level orchestrator for `run --interactive`.
LOWpackages/opencode/src/cli/cmd/run/types.ts1// Shared type vocabulary for the direct interactive mode (`run --interactive`).
LOWpackages/opencode/src/cli/cmd/run/permission.shared.ts1// Pure state machine for the permission UI.
LOWpackages/opencode/src/cli/cmd/run/footer.view.tsx1// Top-level footer layout for direct interactive mode.
16 more matches not shown…
Fake / Example Data32 hits · 34 pts
SeverityFileLineSnippet
LOW…ages/ui/src/components/timeline-playground.stories.tsx26// Lorem ipsum content
LOW…ages/ui/src/components/timeline-playground.stories.tsx29 "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna a
LOW…ages/ui/src/components/timeline-playground.stories.tsx29 "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna a
LOWpackages/opencode/test/config/config.test.ts561 email: "user@example.com",
LOWpackages/opencode/test/config/config.test.ts571 email: "user@example.com",
LOWpackages/opencode/test/cli/run/prompt.shared.test.ts140 expect(mentionTriggerIndex("foo@bar.com")).toBeUndefined()
LOWpackages/opencode/test/account/service.test.ts179 email: "user@example.com",
LOWpackages/opencode/test/account/service.test.ts220 email: "user@example.com",
LOWpackages/opencode/test/account/service.test.ts264 email: "user@example.com",
LOWpackages/opencode/test/account/service.test.ts328 email: "user@example.com",
LOWpackages/opencode/test/account/service.test.ts373 ? json(req, { id: "user-1", email: "user@example.com" })
LOWpackages/opencode/test/account/service.test.ts384 expect(res.email).toBe("user@example.com")
LOWpackages/opencode/test/account/service.test.ts391 email: "user@example.com",
LOWpackages/opencode/test/share/share-next.test.ts79 email: "user@example.com",
LOWpackages/console/app/src/i18n/da.ts746 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/de.ts753 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/ar.ts740 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/it.ts749 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/es.ts752 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/br.ts753 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/tr.ts753 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/en.ts742 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/uk.ts711 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/zh.ts723 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/zht.ts722 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/fr.ts760 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/th.ts743 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/ru.ts757 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/no.ts747 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/pl.ts750 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/ko.ts740 "enterprise.form.company.placeholder": "Acme Inc",
LOWpackages/console/app/src/i18n/ja.ts749 "enterprise.form.company.placeholder": "Acme Inc",
Hallucination Indicators3 hits · 30 pts
SeverityFileLineSnippet
CRITICALpackages/core/src/session-message.ts150 error: SessionEvent.Step.Failed.data.fields.error.pipe(Schema.optional),
CRITICAL…/src/cli/cmd/tui/component/dialog-workspace-create.tsx86 await input.sdk.client.experimental.workspace.syncList().catch(() => undefined)
CRITICAL…/src/cli/cmd/tui/component/dialog-workspace-create.tsx107 result = await input.sdk.client.experimental.workspace.warp({
Decorative Section Separators7 hits · 26 pts
SeverityFileLineSnippet
MEDIUMpatches/install-korean-ime-fix.sh41# ── 1. Clone or update fork ────────────────────────────────────────────
MEDIUMpatches/install-korean-ime-fix.sh52# ── 2. Verify the IME fix is present in source ────────────────────────
MEDIUMpatches/install-korean-ime-fix.sh73# ── 3. Install dependencies ────────────────────────────────────────────
MEDIUMpatches/install-korean-ime-fix.sh78# ── 4. Build (current platform only) ──────────────────────────────────
MEDIUMpatches/install-korean-ime-fix.sh83# ── 5. Install binary ──────────────────────────────────────────────────
MEDIUMpackages/opencode/test/session/compaction.test.ts450 // ─── Bug reproduction tests ───────────────────────────────────────────
MEDIUMpackages/opencode/src/session/message-v2.ts389// ── Prompt input schemas ─────────────────────────────────────────────────────
Cross-Language Confusion (JS/TS)2 hits · 10 pts
SeverityFileLineSnippet
HIGHpackages/opencode/src/cli/ui.ts32 print(...message)
HIGHpackages/opencode/src/cli/cmd/models.ts52 print(providerID, args.verbose)
AI Slop Vocabulary1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMpackages/opencode/test/tool/question.test.ts101 // header: "This Header is Definitely More Than Thirty Characters Long",
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippet
MEDIUM.github/publish-python-sdk.yml2# This file is intentionally in the wrong dir, will move and add later....
Verbosity Indicators2 hits · 3 pts
SeverityFileLineSnippet
LOW.github/workflows/pr-standards.yml86 // Step 1: Check title format
LOW.github/workflows/pr-standards.yml111 // Step 2: Check for linked issue (skip for docs/refactor/feat PRs)
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippet
LOWpatches/install-korean-ime-fix.sh10# Usage:
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippet
LOWpackages/opencode/src/mcp/oauth-callback.ts76function handleRequest(req: import("http").IncomingMessage, res: import("http").ServerResponse) {