Repository Analysis

steipete/CodexBar

Show usage stats for OpenAI Codex and Claude Code, without having to login.

1.7 Likely human-written View on GitHub
1.7
Adjusted Score
1.7
Raw Score
100%
Time Factor
2026-05-30
Last Push
13,910
Stars
Swift
Language
263,464
Lines of Code
1121
Files
267
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 37MEDIUM 5LOW 225

Pattern Findings

267 matches across 9 categories. Click a row to expand file-level details.

Cross-File Repetition37 hits · 185 pts
SeverityFileLineSnippet
HIGH…s/CodexBarTests/ClaudeOAuthCredentialsStoreTests.swift0{ "claudeaioauth": { "accesstoken": "\(accesstoken)", "expiresat": \(millis), "scopes": ["user:profile"]\(refreshfield)
HIGH…ests/ClaudeOAuthCredentialsStoreSecurityCLITests.swift0{ "claudeaioauth": { "accesstoken": "\(accesstoken)", "expiresat": \(millis), "scopes": ["user:profile"]\(refreshfield)
HIGH…OAuthCredentialsStoreTemporaryKeychainCacheTests.swift0{ "claudeaioauth": { "accesstoken": "\(accesstoken)", "expiresat": \(millis), "scopes": ["user:profile"]\(refreshfield)
HIGH…arTests/ClaudeOAuthDelegatedRefreshRecoveryTests.swift0{ "claudeaioauth": { "accesstoken": "\(accesstoken)", "expiresat": \(millis), "scopes": ["user:profile"]\(refreshfield)
HIGH…sts/ClaudeOAuthCredentialsStorePromptPolicyTests.swift0{ "claudeaioauth": { "accesstoken": "\(accesstoken)", "expiresat": \(millis), "scopes": ["user:profile"]\(refreshfield)
HIGHTests/CodexBarTests/DeepSeekUsageCostParserTests.swift0{ "code": 0, "msg": "", "data": { "biz_code": 0, "biz_msg": "", "biz_data": [ { "total": [], "days": [], "currency": "cn
HIGHTests/CodexBarTests/DeepSeekUsageCostParserTests.swift0{ "code": 0, "msg": "", "data": { "biz_code": 0, "biz_msg": "", "biz_data": [ { "total": [], "days": [], "currency": "cn
HIGHTests/CodexBarTests/DeepSeekUsageCostParserTests.swift0{ "code": 0, "msg": "", "data": { "biz_code": 0, "biz_msg": "", "biz_data": [ { "total": [], "days": [], "currency": "cn
HIGHTests/CodexBarTests/DeepSeekUsageCostParserTests.swift0{ "code": 0, "msg": "", "data": { "biz_code": 0, "biz_msg": "", "biz_data": [ { "total": [], "days": [], "currency": "cn
HIGHTests/CodexBarTests/StepFunUsageFetcherTests.swift0{ "accesstoken": {"raw": "new-access"}, "refreshtoken": {"raw": "new-refresh"} }
HIGHTests/CodexBarTests/StepFunUsageFetcherTests.swift0{ "accesstoken": {"raw": "new-access"}, "refreshtoken": {"raw": "new-refresh"} }
HIGHTests/CodexBarTests/StepFunUsageFetcherTests.swift0{ "accesstoken": {"raw": "new-access"}, "refreshtoken": {"raw": "new-refresh"} }
HIGHTests/CodexBarTests/StepFunUsageFetcherTests.swift0{ "accesstoken": {"raw": "new-access"}, "refreshtoken": {"raw": "new-refresh"} }
HIGHTests/CodexBarTests/ClaudeUsageTests.swift0{ "five_hour": { "utilization": 7, "resets_at": "2025-12-23t16:00:00.000z" }, "seven_day": { "utilization": 21, "resets_
HIGHTests/CodexBarTests/ClaudeUsageTests.swift0{ "five_hour": { "utilization": 7, "resets_at": "2025-12-23t16:00:00.000z" }, "seven_day": { "utilization": 21, "resets_
HIGH…arTests/ClaudeOAuthDelegatedRefreshRecoveryTests.swift0{ "five_hour": { "utilization": 7, "resets_at": "2025-12-23t16:00:00.000z" }, "seven_day": { "utilization": 21, "resets_
HIGHTests/CodexBarTests/MiniMaxProviderTests.swift0{ "base_resp": { "status_code": 0 }, "current_subscribe_title": "max", "model_remains": [ { "current_interval_total_coun
HIGHTests/CodexBarTests/MiniMaxAPITokenFetchTests.swift0{ "base_resp": { "status_code": 0 }, "current_subscribe_title": "max", "model_remains": [ { "current_interval_total_coun
HIGHTests/CodexBarTests/MiniMaxAPITokenFetchTests.swift0{ "base_resp": { "status_code": 0 }, "current_subscribe_title": "max", "model_remains": [ { "current_interval_total_coun
HIGHTests/CodexBarTests/DeepSeekUsageFetcherTests.swift0{ "is_available": true, "balance_infos": [ { "currency": "usd", "total_balance": "50.00", "granted_balance": "10.00", "t
HIGHTests/CodexBarTests/DeepSeekUsageFetcherTests.swift0{ "is_available": true, "balance_infos": [ { "currency": "usd", "total_balance": "50.00", "granted_balance": "10.00", "t
HIGHTests/CodexBarTests/DeepSeekUsageFetcherTests.swift0{ "is_available": true, "balance_infos": [ { "currency": "usd", "total_balance": "50.00", "granted_balance": "10.00", "t
HIGHTests/CodexBarTests/DeepSeekUsageFetcherTests.swift0{ "is_available": true, "balance_infos": [ { "currency": "usd", "total_balance": "50.00", "granted_balance": "10.00", "t
HIGHTests/CodexBarTests/FactoryStatusProbeFetchTests.swift0{ "organization": { "id": "org_1", "name": "acme", "subscription": { "factorytier": "team", "orbsubscription": { "plan":
HIGHTests/CodexBarTests/FactoryStatusProbeFetchTests.swift0{ "organization": { "id": "org_1", "name": "acme", "subscription": { "factorytier": "team", "orbsubscription": { "plan":
HIGHTests/CodexBarTests/FactoryStatusProbeFetchTests.swift0{ "organization": { "id": "org_1", "name": "acme", "subscription": { "factorytier": "team", "orbsubscription": { "plan":
HIGHTests/CodexBarTests/FactoryStatusProbeFetchTests.swift0{ "organization": { "id": "org_1", "name": "acme", "subscription": { "factorytier": "team", "orbsubscription": { "plan":
HIGHTests/CodexBarTests/FactoryStatusProbeFetchTests.swift0{ "organization": { "id": "org_1", "name": "acme", "subscription": { "factorytier": "team", "orbsubscription": { "plan":
HIGHTests/CodexBarTests/FactoryStatusProbeFetchTests.swift0{ "organization": { "id": "org_1", "name": "acme", "subscription": { "factorytier": "team", "orbsubscription": { "plan":
HIGHTests/CodexBarTests/FactoryStatusProbeFetchTests.swift0{ "organization": { "id": "org_1", "name": "acme", "subscription": { "factorytier": "team", "orbsubscription": { "plan":
HIGHTests/CodexBarTests/JetBrainsStatusProbeTests.swift0<?xml version="1.0" encoding="utf-8"?> <application> <component name="aiassistantquotamanager2"> <option name="quotainfo
HIGHTests/CodexBarTests/JetBrainsStatusProbeTests.swift0<?xml version="1.0" encoding="utf-8"?> <application> <component name="aiassistantquotamanager2"> <option name="quotainfo
HIGHTestsLinux/JetBrainsParserLinuxTests.swift0<?xml version="1.0" encoding="utf-8"?> <application> <component name="aiassistantquotamanager2"> <option name="quotainfo
HIGHTests/CodexBarTests/JetBrainsStatusProbeTests.swift0<?xml version="1.0" encoding="utf-8"?> <application> <component name="aiassistantquotamanager2"> <option name="quotainfo
HIGHTests/CodexBarTests/JetBrainsStatusProbeTests.swift0<?xml version="1.0" encoding="utf-8"?> <application> <component name="aiassistantquotamanager2"> <option name="quotainfo
HIGHTestsLinux/JetBrainsParserLinuxTests.swift0<?xml version="1.0" encoding="utf-8"?> <application> <component name="aiassistantquotamanager2"> <option name="quotainfo
HIGHTestsLinux/JetBrainsParserLinuxTests.swift0<?xml version="1.0" encoding="utf-8"?> <application> <component name="aiassistantquotamanager2"> <option name="quotainfo
Fake / Example Data173 hits · 178 pts
SeverityFileLineSnippet
LOW…xBarTests/OpenAIDashboardFetcherCreditsWaitTests.swift124 signedInEmail: "user@example.com",
LOW…xBarTests/OpenAIDashboardFetcherCreditsWaitTests.swift136 signedInEmail: "user@example.com",
LOWTests/CodexBarTests/KiroStatusProbeTests.swift464 #expect(account.email == "user@example.com")
LOWTests/CodexBarTests/KiroStatusProbeTests.swift472 stdout: "user@example.com",
LOWTests/CodexBarTests/KiroStatusProbeTests.swift477 #expect(account.email == "user@example.com")
LOW…odexBarTests/ClaudeBaselineCharacterizationTests.swift231 accountEmail: "user@example.com",
LOW…odexBarTests/ClaudeBaselineCharacterizationTests.swift253 #expect(result.usage.identity?.accountEmail == "user@example.com")
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift262 email: "user@example.com",
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift270 email: "user@example.com",
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift297 #expect(baseProjection.visibleAccounts.first?.displayName == "user@example.com")
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift305 email: "user@example.com",
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift324 #expect(projection.activeVisibleAccountID == "user@example.com")
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift325 #expect(projection.liveVisibleAccountID == "user@example.com")
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift332 email: "user@example.com",
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift355 storedAccountRuntimeEmails: [stored.id: "user@example.com"])
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift371 storedAccountRuntimeEmails: [stored.id: "user@example.com"])
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift387 storedAccountRuntimeEmails: [stored.id: "user@example.com"])
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift408 email: "user@example.com",
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift431 #expect(projection.activeVisibleAccountID == "user@example.com")
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift432 #expect(projection.source(forVisibleAccountID: "user@example.com") == .liveSystem)
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift443 email: "user@example.com",
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift449 email: "user@example.com",
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift459 identity: .emailOnly(normalizedEmail: "user@example.com"))
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift473 #expect(Set(projection.visibleAccounts.map(\.email)) == Set(["user@example.com"]))
LOWTests/CodexBarTests/ProviderStorageFootprintTests.swift69 email: "user@example.com",
LOWTests/CodexBarTests/FactoryStatusProbeTests.swift33 accountEmail: "user@example.com",
LOW…odexBarTests/ManagedCodexAccountCoordinatorTests.swift21 identityReader: CoordinatorStubManagedCodexIdentityReader(email: "user@example.com"))
LOW…odexBarTests/ManagedCodexAccountCoordinatorTests.swift37 #expect(account.email == "user@example.com")
LOW…s/CodexBarTests/CodexCLIWindowNormalizationTests.swift133 account: AccountInfo(email: "user@example.com", plan: nil),
LOW…s/CodexBarTests/CodexCLIWindowNormalizationTests.swift154 accountEmail: "user@example.com",
LOWTests/CodexBarTests/CodexVisibleAccountTests.swift11 email: "user@example.com",
LOWTests/CodexBarTests/CodexVisibleAccountTests.swift22 email: "user@example.com",
LOWTests/CodexBarTests/CodexVisibleAccountTests.swift33 #expect(personal.menuDisplayName == "user@example.com")
LOWTests/CodexBarTests/MenuCardModelTests.swift47 account: AccountInfo(email: "user@example.com", plan: "pro"),
LOWTests/CodexBarTests/UsageStoreCoverageTests.swift60 signedInEmail: "user@example.com",
LOWTests/CodexBarTests/StepFunUsageFetcherTests.swift14 let env = ["STEPFUN_USERNAME": "user@example.com"]
LOWTests/CodexBarTests/StepFunUsageFetcherTests.swift15 #expect(StepFunSettingsReader.username(environment: env) == "user@example.com")
LOWTests/CodexBarTests/StepFunUsageFetcherTests.swift521 "STEPFUN_USERNAME": "user@example.com",
LOW…odexBarTests/StatusMenuHostedSubmenuRefreshTests.swift247 accountEmail: "user@example.com",
LOWTests/CodexBarTests/GrokAuthTests.swift15 "email": "user@example.com",
LOWTests/CodexBarTests/GrokAuthTests.swift31 #expect(creds.email == "user@example.com")
LOWTests/CodexBarTests/KiloOrganizationTests.swift9 { "id": "org_123", "name": "Acme Corp", "role": "owner" }
LOWTests/CodexBarTests/KiloOrganizationTests.swift14 #expect(org.name == "Acme Corp")
LOWTests/CodexBarTests/OpenAIDashboardParserTests.swift104 {"session":{"user":{"email":"user@example.com"}},"planType":"plus"}
LOWTests/CodexBarTests/OpenAIDashboardParserTests.swift118 {"session":{"user":{"email":"user@example.com"}},"planType":"prolite"}
LOWTests/CodexBarTests/OpenAIDashboardParserTests.swift192 "signedInEmail": "user@example.com",
LOWTests/CodexBarTests/OpenAIDashboardParserTests.swift208 signedInEmail: "user@example.com",
LOWTests/CodexBarTests/OpenAIDashboardParserTests.swift230 #expect(usage?.identity?.accountEmail == "user@example.com")
LOWTests/CodexBarTests/OpenAIDashboardParserTests.swift236 signedInEmail: "user@example.com",
LOWTests/CodexBarTests/CodexHistoryOwnershipTests.swift7 private let normalizedEmail = "user@example.com"
LOWTests/CodexBarTests/CLISnapshotTests.swift60 accountEmail: "user@example.com",
LOWTests/CodexBarTests/CLISnapshotTests.swift98 accountEmail: "user@example.com",
LOWTests/CodexBarTests/CLISnapshotTests.swift127 accountEmail: "user@example.com",
LOWTests/CodexBarTests/MiniMaxLogRedactorTests.swift62 #expect(redacted.contains("user@example.com") == false)
LOWTests/CodexBarTests/StatusProbeTests.swift93 #expect(snap.accountEmail == "user@example.com")
LOWTests/CodexBarTests/StatusProbeTests.swift229 #expect(snap.accountEmail == "user@example.com")
LOW…CodexBarTests/AntigravityRemoteUsageFetcherTests.swift38 idToken: GeminiAPITestHelpers.makeIDToken(email: "user@example.com"),
LOW…CodexBarTests/AntigravityRemoteUsageFetcherTests.swift39 email: "user@example.com",
LOW…CodexBarTests/AntigravityRemoteUsageFetcherTests.swift348 idToken: GeminiAPITestHelpers.makeIDToken(email: "user@example.com"),
LOW…CodexBarTests/AntigravityRemoteUsageFetcherTests.swift349 email: "user@example.com")
113 more matches not shown…
Over-Commented Block40 hits · 40 pts
SeverityFileLineSnippet
LOWTests/CodexBarTests/KiroStatusProbeTests.swift221
LOW…ts/CodexBarTests/CodexAccountReconciliationTests.swift41 defer {
LOWTests/CodexBarTests/LLMProxyUsageFetcherTests.swift61 #expect(parsed.totalRequests == 160)
LOWTests/CodexBarTests/T3ChatUsageFetcherTests.swift21 // 2026-05-21T12:23:36Z, the usage-window reset that must not drive overage reset display.
LOW…sts/CodexBarTests/CodexAccountScopedRefreshTests.swift41 defer { store._test_widgetSnapshotSaveOverride = nil }
LOWTests/CodexBarTests/OpenCodeGoUsageParserTests.swift441 #expect(usage.extraRateWindows?.count == 1)
LOWTests/CodexBarTests/UsageStoreCoverageTests.swift541 #expect(statusAttempts == 2)
LOWTests/CodexBarTests/MistralUsageParserTests.swift21 let snapshot = try MistralUsageFetcher.parseResponse(data: data, updatedAt: Date())
LOWTests/CodexBarTests/MistralUsageParserTests.swift41 // mistral-large-2411 input: 11121 * 0.0000017 = 0.0189057
LOW…xBarTests/TokenAccountEnvironmentPrecedenceTests.swift981 fileprivate static func expectSnapshotFieldsPreserved(before: UsageSnapshot, after: UsageSnapshot) {
LOWTests/CodexBarTests/OpenAIAPIUsageFetcherTests.swift101 #expect(snapshot.daily.count == 2)
LOWTests/CodexBarTests/OpenAIAPIUsageFetcherTests.swift321 #expect(usage.identity?.accountOrganization == "Project: proj_abc")
LOWTests/CodexBarTests/WidgetSnapshotTests.swift201 #expect(decoded.entries.first?.tokenUsage?.currencyCode == "USD")
LOWTests/CodexBarTests/OpenAIDashboardSparkTests.swift41 #expect(apiData.accountPlan == "pro")
LOWTests/CodexBarTests/CodebuffUsageFetcherTests.swift241 weeklyUsed: 100,
LOWTests/CodexBarTests/CursorEnterpriseUsageTests.swift41 }
LOWTests/CodexBarTests/StatusMenuTests.swift741 preferencesSelection: PreferencesSelection(),
LOW…/CodexBarTests/MenuCardModelCodexProjectionTests.swift681 hidePersonalInfo: false,
LOWTests/CodexBarTests/ManusProviderTests.swift261 "refreshInterval": "daily",
LOW…ts/CodexBarTests/ManagedCodexAccountServiceTests.swift101 let storedTeam = try #require(
LOW…ts/CodexBarTests/ManagedCodexAccountServiceTests.swift341 #expect(account.id == storedBob.id)
LOWTests/CodexBarTests/SyntheticProviderTests.swift181 #expect(usage.primary?.nextRegenPercent == nil)
LOWTests/CodexBarTests/OpenAIAPIMenuCardModelTests.swift161 #expect(ProviderDescriptorRegistry.descriptor(for: .openai).tokenCost.supportsTokenCost)
LOWTests/CodexBarTests/FactoryStatusProbeFetchTests.swift661 }
LOWTests/CodexBarTests/ClaudeOAuthTests.swift221 #expect(snap.primary.windowMinutes == nil)
LOWTests/CodexBarTests/CLIProviderSelectionTests.swift21 "|kiro|",
LOWTests/CodexBarTests/WindsurfStatusProbeTests.swift41 #expect(info.endTimestamp == 1_774_029_950_000)
LOWTests/CodexBarTests/CodexOAuthTests.swift621
LOWTests/CodexBarTests/ZaiProviderTests.swift501
LOWTests/CodexBarTests/ClaudePlanResolverTests.swift41 #expect(ClaudePlan.fromCompatibilityLoginMethod("Claude Enterprise") == .enterprise)
LOWTests/CodexBarTests/ClaudePlanResolverTests.swift61 #expect(!ClaudePlan.isSubscriptionLoginMethod("Claude Enterprise"))
LOWTests/CodexBarTests/AntigravityStatusProbeTests.swift1001 #expect(claudeRange.allSatisfy { $0.lowercased().contains("claude") })
LOWTests/CodexBarTests/AntigravityStatusProbeTests.swift1121 accountPlan: nil,
LOWTestsLinux/PlatformGatingTests.swift41 #expect(isExpectedError)
LOWTestsLinux/SettingsReaderQuoteUnwrapTrapTests.swift1import CodexBarCore
LOW…e/Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift1import Foundation
LOW…dexBarCore/Providers/MiniMax/MiniMaxServiceUsage.swift1//
LOW…dexBarCore/Providers/MiniMax/MiniMaxServiceUsage.swift81 }
LOW…odexBarCore/Providers/Factory/FactoryStatusProbe.swift341 /// Falls back to percent-scale (0.0-100.0) when allowance is unavailable.
LOW…arCore/OpenAIWeb/OpenAIDashboardWebsiteDataStore.swift1#if os(macOS)
Verbosity Indicators9 hits · 19 pts
SeverityFileLineSnippet
LOWTests/CodexBarTests/StatusMenuSwitcherClickTests.swift108 // Step 1: provider → Overview via the runtime click path.
LOWTests/CodexBarTests/StatusMenuSwitcherClickTests.swift113 // Step 2: Overview → provider via the runtime click path. Tag 2 is the second provider
LOWTests/CodexBarTests/StatusMenuSwitcherClickTests.swift120 // Step 3: provider → Overview again.
LOWTests/CodexBarTests/StatusMenuSwitcherClickTests.swift125 // Step 4: Overview → other provider. This is the click that previously got dropped.
LOW…arCore/Providers/Augment/AugmentSessionKeepalive.swift207 // Step 1: Ping the session endpoint to trigger cookie refresh
LOW…arCore/Providers/Augment/AugmentSessionKeepalive.swift211 // Step 2: Re-import cookies from browser
LOW…dexBarCore/Providers/StepFun/StepFunUsageFetcher.swift276 // Step 1: Get INGRESSCOOKIE by visiting the platform homepage
LOW…dexBarCore/Providers/StepFun/StepFunUsageFetcher.swift279 // Step 2: RegisterDevice → get anonymous token
LOW…dexBarCore/Providers/StepFun/StepFunUsageFetcher.swift282 // Step 3: SignInByPassword → get authenticated token
Self-Referential Comments3 hits · 9 pts
SeverityFileLineSnippet
MEDIUMScripts/setup_dev_signing.sh27# Create a temporary config file for the certificate
MEDIUMScripts/review_upstream.sh2# Create a review branch for upstream changes
MEDIUMScripts/review_upstream.sh127# Create a review log file
AI Slop Vocabulary2 hits · 6 pts
SeverityFileLineSnippet
MEDIUMSources/CodexBarCore/UsageFormatter.swift195 /// Uses Swift's modern FormatStyle API (iOS 15+/macOS 12+) for robust, locale-aware formatting.
MEDIUM…/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift275 // Use a more robust capture configuration than the standard `/status` scrape:
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippet
LOWScripts/setup_dev_signing.sh11# Check if we already have a CodexBar development certificate
Hyper-Verbose Identifiers1 hit · 1 pts
SeverityFileLineSnippet
LOWScripts/ci_swift_test_by_suite.py65def filtered_suites_for_environment(suites: list[str]) -> list[str]:
Unused Imports1 hit · 1 pts
SeverityFileLineSnippet
LOWScripts/ci_swift_test_by_suite.py4