Repository Analysis

google-gemini/gemini-cli

An open-source AI agent that brings the power of Gemini directly into your terminal.

1.1 Likely human-written View on GitHub
1.1
Adjusted Score
1.1
Raw Score
100%
Time Factor
2026-05-30
Last Push
104,729
Stars
TypeScript
Language
720,030
Lines of Code
2487
Files
513
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 19HIGH 7MEDIUM 24LOW 463

Pattern Findings

513 matches across 13 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers391 hits · 388 pts
SeverityFileLineSnippet
LOWevals/skill_extraction.eval.ts181function createWorkflowComparisonSessions(withScratchpad: boolean): {
LOWevals/skill_extraction.eval.ts327async function runExtractionAndReadState(
LOWevals/skill_extraction.eval.ts559async function writeScratchpadStatsReport(
LOWevals/skill_extraction.eval.ts599function expectSuccessfulExtractionRun(run: ExtractionRunSnapshot): void {
LOWevals/skill_extraction.eval.ts656function parseScratchpadStatsTrials(): number {
LOWevals/auto_memory_modes.eval.ts328async function expectSeedSessionEligible(
LOWintegration-tests/run_shell_command.test.ts54function getDisallowedFileReadCommand(testFile: string): {
LOWmemory-tests/memory-usage.test.ts366async function generateSharedLargeChatData(tempDir: string) {
LOWscripts/generate-keybindings-doc.ts113function getMergedPlatformBindings(
LOWscripts/lint.js245export function runSensitiveKeywordLinter() {
LOWscripts/lint.js397export function runGithubActionsPinningLinter() {
LOWscripts/generate-settings-schema.ts220function buildObjectDefinitionSchema(
LOWscripts/generate-settings-schema.ts252function buildObjectCollectionSchema(
LOWscripts/get-release-version.js124function detectRollbackAndGetBaseline({ args, npmDistTag } = {}) {
LOWscripts/get-release-version.js238function getAndVerifyTags({ npmDistTag, args } = {}) {
LOWpackages/test-utils/src/test-rig.ts68export function createToolCallErrorMessage(
LOWpackages/core/src/ide/ide-connection-utils.ts112export async function getConnectionConfigFromFile(
LOWpackages/core/src/ide/process-utils.ts165async function getIdeProcessInfoForWindows(): Promise<{
LOWpackages/core/src/test-utils/mockWorkspaceContext.ts16export function createMockWorkspaceContext(
LOWpackages/core/src/test-utils/mock-message-bus.ts110export function getMockMessageBusInstance(
LOWpackages/core/src/tools/mcp-tool.ts498function transformResourceLinkBlock(block: McpResourceLinkBlock): Part {
LOWpackages/core/src/tools/mcp-tool.ts510function transformMcpContentToParts(sdkResponse: Part[]): Part[] {
LOWpackages/core/src/tools/mcp-tool.ts549function getStringifiedResultForDisplay(rawResponse: Part[]): string {
LOWpackages/core/src/tools/mcp-client.ts827export function addMCPStatusChangeListener(
LOWpackages/core/src/tools/mcp-client.ts836export function removeMCPStatusChangeListener(
LOWpackages/core/src/tools/mcp-client.ts884function extractWWWAuthenticateHeader(errorString: string): string | null {
LOWpackages/core/src/tools/mcp-client.ts984function createTransportRequestInit(
LOWpackages/core/src/tools/mcp-client.ts1037function createDynamicOAuthTokenProvider(
LOWpackages/core/src/tools/mcp-client.ts1671function createSSETransportWithAuth(
LOWpackages/core/src/tools/edit.ts135async function calculateExactReplacement(
LOWpackages/core/src/tools/edit.ts174async function calculateFlexibleReplacement(
LOWpackages/core/src/tools/edit.ts234async function calculateRegexReplacement(
LOWpackages/core/src/tools/edit.ts1244async function calculateFuzzyReplacement(
LOWpackages/core/src/tools/tools.ts124export function isBackgroundExecutionData(
LOWpackages/core/src/tools/omissionPlaceholderDetector.ts94export function detectOmissionPlaceholders(text: string): string[] {
LOWpackages/core/src/tools/modifiable-tool.ts56export function isModifiableDeclarativeTool(
LOWpackages/core/src/tools/memoryTool.ts76export function getCurrentGeminiMdFilename(): string {
LOWpackages/core/src/tools/memoryTool.ts94export function getProjectMemoryIndexFilePath(storage: Storage): string {
LOW…e/src/tools/definitions/dynamic-declaration-helpers.ts165export function getExitPlanModeDeclaration(): FunctionDeclaration {
LOW…e/src/tools/definitions/dynamic-declaration-helpers.ts186export function getActivateSkillDeclaration(
LOW…e/src/tools/definitions/dynamic-declaration-helpers.ts220export function getUpdateTopicDeclaration(): FunctionDeclaration {
LOWpackages/core/src/tools/definitions/coreTools.ts261export function getExitPlanModeDefinition(): ToolDefinition {
LOWpackages/core/src/tools/definitions/coreTools.ts268export function getActivateSkillDefinition(
LOWpackages/core/src/context/truncation.ts81export function normalizeFunctionResponse(
LOWpackages/core/src/context/chatCompressionService.ts102export function modelStringToModelConfigAlias(model: string): string {
LOWpackages/core/src/context/config/schema.ts9export function getContextManagementConfigSchema(
LOWpackages/core/src/context/config/configLoader.ts76export async function loadContextManagementConfig(
LOWpackages/core/src/context/graph/toGraph.ts81function isCodeExecutionResultPart(
LOWpackages/core/src/context/utils/snapshotGenerator.ts90export function findLatestSnapshotBaseline(
LOWpackages/core/src/context/testing/contextTestUtils.ts289export function setupContextComponentTest(
LOW…/core/src/context/processors/stateSnapshotProcessor.ts46export function createStateSnapshotProcessor(
LOW…ore/src/context/processors/blobDegradationProcessor.ts24export function createBlobDegradationProcessor(
LOW…/src/context/processors/stateSnapshotAsyncProcessor.ts39export function createStateSnapshotAsyncProcessor(
LOW…re/src/context/processors/nodeDistillationProcessor.ts32export function createNodeDistillationProcessor(
LOW…es/core/src/context/processors/toolMaskingProcessor.ts81export function createToolMaskingProcessor(
LOW…core/src/context/processors/nodeTruncationProcessor.ts26export function createNodeTruncationProcessor(
LOW…core/src/context/processors/rollingSummaryProcessor.ts43export function createRollingSummaryProcessor(
LOW…e/src/context/processors/historyTruncationProcessor.ts32export function createHistoryTruncationProcessor(
LOWpackages/core/src/core/contentGenerator.ts130export async function createContentGeneratorConfig(
LOWpackages/core/src/core/geminiChat.ts133export function isValidNonThoughtTextPart(part: Part): boolean {
331 more matches not shown…
Hallucination Indicators19 hits · 190 pts
SeverityFileLineSnippet
CRITICALpackages/core/src/code_assist/server.ts575 return error.response.data.error.details.some(
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1473 const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) =>
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1508 const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) =>
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1536 const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) =>
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1569 const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) =>
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1600 const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) =>
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1636 const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) =>
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1697 const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) =>
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1710 const titleWritesDelayed = mocks.mockStdout.write.mock.calls.filter(
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1764 const titleWritesMid = mocks.mockStdout.write.mock.calls.filter(
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1776 const titleWritesEnd = mocks.mockStdout.write.mock.calls.filter(
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1823 const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) =>
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1893 const titleWritesAfterOutput = mocks.mockStdout.write.mock.calls.filter(
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1907 const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) =>
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1942 const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) =>
CRITICALpackages/cli/src/ui/AppContainer.test.tsx1979 const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) =>
CRITICALpackages/cli/src/ui/AppContainer.test.tsx2015 const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) =>
CRITICALpackages/cli/src/ui/AppContainer.test.tsx3196 const clearTerminalCalls = mocks.mockStdout.write.mock.calls.filter(
CRITICAL.github/workflows/unassign-inactive-assignees.yml191 const prAuthor = event.source.issue.user.login.toLowerCase();
Verbosity Indicators26 hits · 50 pts
SeverityFileLineSnippet
LOW.gcp/release-docker.yml2 # Step 1: Install root dependencies (includes workspaces)
LOW.gcp/release-docker.yml8 # Step 2: Authenticate for Docker (so we can push images to the artifact registry)
LOW.gcp/release-docker.yml14 # Step 3: Build workspace packages
LOW.gcp/release-docker.yml20 # Step 4: Determine Docker Image Tag
LOW.gcp/release-docker.yml38 # Step 5: Build sandbox container image
LOW.gcp/release-docker.yml51 # Step 8: Publish sandbox container image
LOW.gcp/development-worker.yml6 # Step 1: Install root dependencies
LOW.gcp/development-worker.yml12 # Step 2: Authenticate for Docker
LOW.gcp/development-worker.yml18 # Step 3: Build workspace packages
LOW.gcp/development-worker.yml24 # Step 4: Build Development Image
LOWintegration-tests/file-system-interactive.test.ts37 // Step 1: Read the file
LOWintegration-tests/file-system-interactive.test.ts45 // Step 2: Write the file
LOWpackages/core/src/context/agentHistoryProvider.ts42 // Step 1: Normalize newest messages.
LOWpackages/core/src/context/agentHistoryProvider.ts49 // Step 2: Check if truncation is needed based on the token threshold (High Watermark)
LOWpackages/core/src/context/agentHistoryProvider.ts54 // Step 3: Split into keep/truncate boundaries
LOW…core/src/context/pipeline/contextWorkingBuffer.test.ts271 // Step 1: Initial state
LOW…core/src/context/pipeline/contextWorkingBuffer.test.ts295 // Step 2: Mutate p2 into m2
LOW…core/src/context/pipeline/contextWorkingBuffer.test.ts309 // Step 3: Upstream adds new nodes (p4, p5)
LOWpackages/core/src/mcp/mcp-oauth-provider.test.ts40 // Step 1: Save client information
LOWpackages/core/src/mcp/mcp-oauth-provider.test.ts47 // Step 2: Save code verifier
LOWpackages/core/src/mcp/mcp-oauth-provider.test.ts50 // Step 3: Set up callback server
LOWpackages/core/src/mcp/mcp-oauth-provider.test.ts62 // Step 4: Redirect to authorization
LOWpackages/core/src/mcp/mcp-oauth-provider.test.ts66 // Step 5: Save tokens after exchange
LOW…s/vscode-ide-companion/scripts/check-vscode-release.js11 // Step 1: Find the commit hash of the last release
LOW…s/vscode-ide-companion/scripts/check-vscode-release.js46 // Step 2: Check for new commits
LOW…s/vscode-ide-companion/scripts/check-vscode-release.js53 // Step 3: Check for dependency changes
AI Slop Vocabulary14 hits · 41 pts
SeverityFileLineSnippet
MEDIUMevals/snapshot_fidelity.eval.ts127 // Use a self-consistency of 3 runs to get a robust majority vote
MEDIUMintegration-tests/json-output.test.ts143 // come up with a more robust solution.
MEDIUMintegration-tests/hooks-system.test.ts1643 // This makes the test more robust by creating multiple start/stop cycles
MEDIUMpackages/core/src/tools/edit.ts1264 .map((l) => l.trimEnd()); // Trim end of search lines to be more robust
MEDIUMpackages/core/src/utils/memoryImportProcessor.test.ts382 // This test verifies the robust findCodeRegions implementation
MEDIUMpackages/core/src/utils/memoryDiscovery.ts28// TODO: Integrate with a more robust server-side logger if available/appropriate.
MEDIUMpackages/core/src/utils/atCommandUtils.ts200 // We rely on validatePath and Config.validatePathAccess for robust checking
MEDIUMpackages/core/src/utils/memoryDiscovery.test.ts92 // Use maxRetries option for robust cleanup without race conditions
MEDIUMpackages/core/src/utils/bfsFileSearch.ts15// TODO: Integrate with a more robust server-side logger.
MEDIUMpackages/core/src/utils/filesearch/fileSearch.test.ts739 // Perform a more specific search that should leverage the broad search's cached results
MEDIUMpackages/core/src/sandbox/windows/GeminiSandbox.cs474 // Ensure we use the 8.3 long-name equivalent for robust security checks per guidelines
MEDIUM…ages/core/src/sandbox/windows/WindowsSandboxManager.ts326 // Track both versions for inheritance checks to be robust against symlinks.
MEDIUMpackages/cli/src/ui/utils/commandUtils.ts256// Copies a string snippet to the clipboard with robust OSC-52 support.
MEDIUMpackages/cli/src/utils/skillUtils.ts109 // Reuse existing robust git cloning utility from extension manager.
Over-Commented Block31 hits · 31 pts
SeverityFileLineSnippet
LOWintegration-tests/clipboard-linux.test.ts81 );
LOWdocs/reference/policy-engine.md301# (Optional) The name of an MCP server. Can be combined with toolName
LOWdocs/reference/policy-engine.md321# it effectively matches from the start of the command.
LOWscripts/build_package.js1/**
LOWscripts/sandbox_command.js1/**
LOWscripts/start.js1/**
LOWscripts/send_gemini_request.sh1#!/bin/bash
LOWscripts/build.js1/**
LOWscripts/clean.js1/**
LOWscripts/generate-git-commit-info.js1/**
LOWscripts/build_vscode_companion.js1/**
LOWscripts/build_sandbox.js1/**
LOWscripts/copy_files.js1#!/usr/bin/env node
LOWscripts/harvest_api_reliability.sh1#!/bin/bash
LOWscripts/copy_bundle_assets.js1/**
LOWpackages/core/src/utils/schemaValidator.ts21 // See: https://ajv.js.org/options.html#strict-mode-options
LOWpackages/core/src/hooks/hookTranslator.ts221
LOWpackages/core/src/services/shellExecutionService.ts81 return `${BASH_SHOPT_GUARD} ${command}`;
LOWpackages/core/src/services/modelConfigService.ts21 // In many cases the model (or model config alias) is sufficient to fully
LOWpackages/core/src/policy/config.ts381 // Priority bands (tiers):
LOWpackages/core/src/policy/policies/read-only.toml1# Priority system for policy rules:
LOWpackages/core/src/policy/policies/yolo.toml1# Priority system for policy rules:
LOWpackages/core/src/policy/policies/yolo.toml21# 4.2: MCP servers with trust=true (persistent trusted servers)
LOWpackages/core/src/policy/policies/plan.toml1# Priority system for policy rules:
LOWpackages/core/src/policy/policies/plan.toml21# 4.2: MCP servers with trust=true (persistent trusted servers)
LOWpackages/core/src/policy/policies/write.toml1# Priority system for policy rules:
LOWpackages/cli/src/ui/components/InboxDialog.tsx921 <Text color={theme.text.secondary}>No items in inbox.</Text>
LOWpackages/cli/src/ui/components/InboxDialog.tsx981 // terminals. Every visible row — skill items, patch items, memory-patch
LOWpackages/cli/src/ui/components/InputPrompt.tsx821 // Record paste time to prevent accidental auto-submission
LOWpackages/cli/src/ui/hooks/useGeminiStream.ts1101 // we should maximize the amount of output sent to <Static />.
LOWpackages/cli/src/config/settings.ts601const USER_GCP_PROJECT = '_GEMINI_USER_GCP_PROJECT';
Decorative Section Separators7 hits · 21 pts
SeverityFileLineSnippet
MEDIUMscripts/send_gemini_request.sh2# -----------------------------------------------------------------------------
MEDIUMscripts/send_gemini_request.sh4# -----------------------------------------------------------------------------
MEDIUMscripts/send_gemini_request.sh28# -----------------------------------------------------------------------------
MEDIUMscripts/harvest_api_reliability.sh4# -------------------------------
MEDIUMpackages/test-utils/src/perf-test-harness.ts489// ─── Baseline management ─────────────────────────────────────────────
MEDIUMpackages/test-utils/src/perf-test-harness.ts538// ─── Helpers ─────────────────────────────────────────────────────────
MEDIUM…core/src/agents/browser/browserAgentInvocation.test.ts270 // ─── Structured SubagentProgress emission tests ───────────────────────
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippet
HIGHdocs/cli/custom-commands.md0please summarize the findings for the pattern `{{args}}`. search results: !{grep -r {{args}} .}
HIGHdocs/extensions/writing-extensions.md0please summarize the findings for the pattern `{{args}}`. search results: !{grep -r {{args}} .}
HIGH…ns/examples/custom-commands/commands/fs/grep-code.toml0please summarize the findings for the pattern `{{args}}`. search results: !{grep -r {{args}} .}
Magic Placeholder Names2 hits · 10 pts
SeverityFileLineSnippet
HIGHREADME.md190export GEMINI_API_KEY="YOUR_API_KEY"
HIGHREADME.md206export GOOGLE_API_KEY="YOUR_API_KEY"
Synthetic Comment Markers2 hits · 10 pts
SeverityFileLineSnippet
HIGH.github/workflows/gemini-cli-bot-brain.yml317 gh pr create --draft --title "🤖 Gemini Bot Productivity Optimizations" --body "Automated changes generated
HIGH.github/workflows/gemini-cli-bot-brain.yml325 gh pr create --draft --title "🤖 Gemini Bot Productivity Optimizations" --body "Automated changes generat
Fake / Example Data8 hits · 10 pts
SeverityFileLineSnippet
LOW…s/test-utils/assets/test-servers/google-workspace.json502 "description": "A simple search term (e.g., \"Budget Q3\"), a Google Drive URL, or a full query string (e.g.
LOWpackages/cli/examples/scrollable-list-demo.tsx29 .map(() => 'lorem ipsum '.repeat((index % 3) + 1).trim())
LOW…kages/cli/src/ui/components/shared/text-buffer.test.ts2183 const longText = `not only five centuries, but also the leap into electronic typesetting, remaining essentially un
LOW…kages/cli/src/ui/components/shared/text-buffer.test.ts2186It is a long established fact that a reader will be distracted by the readable content of a page when looking at its lay
LOW…kages/cli/src/ui/components/shared/text-buffer.test.ts2189Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature
LOW…s/cli/src/ui/components/shared/ScrollableList.test.tsx39 .map(() => 'lorem ipsum '.repeat((index % 3) + 1).trim())
LOWpackages/cli/src/ui/hooks/useHistoryManager.test.ts275 const email = 'user@example.com';
LOWpackages/cli/src/ui/hooks/useHistoryManager.test.ts292 const email = 'user@example.com';
Self-Referential Comments3 hits · 9 pts
SeverityFileLineSnippet
MEDIUMscripts/review.sh67 # Create a detached worktree from origin/main
MEDIUM.github/workflows/test-build-binary.yml85 # Create the P12 file
MEDIUM.github/workflows/test-build-binary.yml88 # Create a temporary keychain
Redundant / Tautological Comments5 hits · 8 pts
SeverityFileLineSnippet
LOWscripts/create_alias.sh24# Check if the alias already exists
LOWscripts/review.sh55 # Check if it's actually a registered worktree
LOW.github/workflows/eval-pr.yml77 # Check if comment already exists to avoid spamming
LOW.github/workflows/eval-pr.yml147 # Check if user is a maintainer
LOW.github/workflows/release-patch-3-release.yml255 # Check if this was a version consistency failure
Example Usage Blocks2 hits · 3 pts
SeverityFileLineSnippet
LOWscripts/send_gemini_request.sh18# Usage:
LOWscripts/harvest_api_reliability.sh9# Usage: