Public report of llm4s/llm4s, published 21 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 21 October 2026, 10:14 UTC · Survey ID cd_43c883d3a7aa429aa9e28338d96d2d43

llm4s/llm4s

Measured 21 October 2026, 09:47 UTC, at code version 794ba0b

CAI score 59out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Down 18 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 172,458 lines of product code in 56 projects, tests not counted · Estimated rebuild effort: about 2.9 person-years · Weakest lens: Code Health, 52

Findings by how serious they are

222 critical 614 serious 156 minor

10 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
21 October 2026, 09:47 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that implements it, and today Watchdog is the only one that does.

The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

72of 76 dimensions measured by tools. The other 4 are advisory notes from an AI model, which explain the code but don't count towards the score.
967of 992 findings point to an exact file and line, so you can open each one in the code. The other 25 concern the repository as a whole, such as missing documentation.
76dimensions across 6 lenses, read from 172,458 lines of product code in 56 projects.
Chapters

Executive summary

llm4s/llm4s scores 59 out of 100 and is rated Adequate, while four of its six lenses score higher still: Architecture at 92 and Security and Compliance at 67, both rated Adequate, and Performance at 80 and Production Readiness at 76, both rated Strong. The project hasn't declared a stable release yet, so its lenses are rated against a lower bar than a released product's, while the score itself is worked out as for any repository.

The score is lower than those four because the weakest lens counts most, and here that is Code Health, which scores 52 and is rated Adequate. Its Nullable reference types dimension scores 2 out of 10, and until that reaches 4, Code Health can't be rated higher than Adequate. The first actions are to on Scala 3, add `-Yexplicit-nulls` to `scalacOptions` so `String` and `String | Null` mean different things, and type each Java API's result as nullable where it can return null; on Scala 2 (or as a first step), enable WartRemover's `Null` wart (`wartremoverErrors += Wart.Null`) or Scalafix's `DisableSyntax.noNulls = true` so the code holds absence in `Option` and to reconcile the README with reality: README claims LLM4S is a 'pre-1.0 release' while the evidence shows no such version and only v0.5.1 exists; CONTRIBUTING.md documents the environment variable `SCREAMING_SNAKE_CASE`, but no code, script or configuration file names it; README.md names `src/main/scala-3`, but no file or folder `src/main/scala-3` exists; README.md names `provider/model`, but no file or folder `provider/model` exists; README.md links to `RELEASE.md`, but `RELEASE.md` does not exist, and if Code Health rose to 70, the score would rise from 59 to about 64.

222 findings are critical: 219 in Static Analysis (SAST), two in Dependency Vulnerabilities and one in Knowledge Freshness.

Watchdog couldn't measure 10 dimensions in this code, among them Code Coverage, Test Reliability and Internal API Consistency, so they are left out of the score. The product code is 172,458 lines, which would take an estimated 2.9 person-years, around €430,000, to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Code Health 52 · counts for 46%Maturity 57 · counts for 25%Security and Compliance 67 · counts for 14%Production Readiness 76 · counts for 8%Performance 80 · counts for 4%Architecture 92 · counts for 2%

If Code Health rose from 52 to 70, the lowest score rated Strong, the score would rise from 59 to about 64.

Code composition: what the lines of code are
Product code 43%Tests 57%
New since the last survey: 377 findings

These 377 critical or serious findings weren't in the previous survey, on 5 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · Redaction.pythonValues (cyclomatic 144) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · Redaction.redactLeaves (cyclomatic 113) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · ToolLoop.implement (cyclomatic 62) modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala
  • Cyclomatic Complexity · Redaction.urlUserinfoPasswords (cyclomatic 44) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · Redaction.withSingularKeys (cyclomatic 42) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · Redaction.queryValue (cyclomatic 37) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · WorkspaceAgentInterfaceImpl.writeFile (cyclomatic 37) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala
  • Cyclomatic Complexity · Redaction.redactQuoted (cyclomatic 35) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · Redaction.redactEqualsPairs (cyclomatic 31) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · WebSocketCommandExecutor.stream (cyclomatic 31) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala
  • Cyclomatic Complexity · Redaction.escapedQuotedValues (cyclomatic 29) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · StreamableHTTPTransportImpl.readSSEResponse (cyclomatic 26) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala
  • Cyclomatic Complexity · CommandPolicy.parseOptions (cyclomatic 26) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala
  • Cyclomatic Complexity · Skill.fromFields (cyclomatic 25) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala
  • Cyclomatic Complexity · Frontmatter.flowList (cyclomatic 25) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala
  • Cyclomatic Complexity · Redaction.cookieValueEnd (cyclomatic 25) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · Redaction.quoteSafeParts (cyclomatic 24) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · Redaction.ampTailEdits (cyclomatic 23) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · CommandPolicy.cpDestinationRefusal (cyclomatic 23) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala
  • Cyclomatic Complexity · Frontmatter.quotedAt (cyclomatic 21) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala
  • Cyclomatic Complexity · Redaction.addedReadingEdits (cyclomatic 21) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · Redaction.escapedQueryParamValues (cyclomatic 21) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · CommandPolicy.sequenceRefusal (cyclomatic 21) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala
  • Cyclomatic Complexity · Frontmatter.fields (cyclomatic 20) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala
  • Cyclomatic Complexity · HostFileBackend.openWith (cyclomatic 19) modules/agent/src/main/scala/org/llm4s/agent/harness/HostFileBackend.scala
  • Cyclomatic Complexity · BedrockClient.runStream (cyclomatic 19) modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala
  • Cyclomatic Complexity · CommandPolicy.linkOperands (cyclomatic 19) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala
  • Cyclomatic Complexity · GitSandbox.driverOverrides (cyclomatic 19) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/GitSandbox.scala
  • Cyclomatic Complexity · WorkspaceAgentInterfaceImpl.fileSnapshot (cyclomatic 19) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala
  • Cyclomatic Complexity · HTTPTool.followRedirects (cyclomatic 18) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/http/HTTPTool.scala
  • Cyclomatic Complexity · Redaction.scanQuotedValue (cyclomatic 18) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · Redaction.endsString (cyclomatic 18) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · StreamableHTTPTransportImpl.handleResponse (cyclomatic 18) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala
  • Cyclomatic Complexity · OllamaClient.stream (cyclomatic 18) modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaClient.scala
  • Cyclomatic Complexity · SchemaMacros.checkImpl (cyclomatic 18) modules/schema-derivation/src/main/scala/org/llm4s/schema/SchemaMacros.scala
  • Cyclomatic Complexity · WorkspaceAgentInterfaceImpl.commitStaged (cyclomatic 18) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala
  • Cyclomatic Complexity · WorkspaceAgentInterfaceImpl.prepareCommandOrThrow (cyclomatic 18) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala
  • Cyclomatic Complexity · Kept.of (cyclomatic 17) modules/agent/src/main/scala/org/llm4s/agent/harness/HostFileBackend.scala
  • Cyclomatic Complexity · HarnessConfigLoader.read (cyclomatic 17) modules/agent/src/main/scala/org/llm4s/config/HarnessConfigLoader.scala
  • Cyclomatic Complexity · SQLiteMemoryStore.leafSql (cyclomatic 17) REDACTED
  • Cyclomatic Complexity · CommandPolicy.windowsFormRefusal (cyclomatic 17) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala
  • Cyclomatic Complexity · CommandPolicy.sortCandidates (cyclomatic 17) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala
  • Cyclomatic Complexity · Attempt.step (cyclomatic 16) modules/agent/src/main/scala/org/llm4s/agent/delegation/ChildRunner.scala
  • Cyclomatic Complexity · ReplayGuard.verifiable (cyclomatic 16) modules/agent/src/main/scala/org/llm4s/agent/graph/EffectReplay.scala
  • Cyclomatic Complexity · Dispatcher.drain (cyclomatic 16) modules/agent/src/main/scala/org/llm4s/agent/graph/EventHub.scala
  • Cyclomatic Complexity · AnthropicClient.addMessagesToParams (cyclomatic 16) modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala
  • Cyclomatic Complexity · Redaction.redactEscapedQuoted (cyclomatic 16) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · EnclosingQuotes.enclosingAt (cyclomatic 16) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cyclomatic Complexity · VertexAIClient.streamComplete (cyclomatic 16) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala
  • Cyclomatic Complexity · Stage.createLogicAndMaterializedValue (cyclomatic 16) modules/llm4s-pekko/src/main/scala/org/llm4s/pekko/BlockingSource.scala
  • Cyclomatic Complexity · VectorMemoryStore.leafSql (cyclomatic 16) REDACTED
  • Cyclomatic Complexity · CommandPolicy.indexedCandidates (cyclomatic 16) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala
  • Cognitive Complexity · Redaction.pythonValues (cognitive 251) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · Redaction.redactLeaves (cognitive 158) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · ToolLoop.implement (cognitive 157) modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala
  • Cognitive Complexity · HostFileBackend.openWith (cognitive 139) modules/agent/src/main/scala/org/llm4s/agent/harness/HostFileBackend.scala
  • Cognitive Complexity · Redaction.urlUserinfoPasswords (cognitive 135) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · HarnessConfigLoader.read (cognitive 118) modules/agent/src/main/scala/org/llm4s/config/HarnessConfigLoader.scala
  • Cognitive Complexity · Redaction.withSingularKeys (cognitive 94) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · Skill.fromFields (cognitive 69) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala
  • Cognitive Complexity · Redaction.redactEqualsPairs (cognitive 62) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · Redaction.queryValue (cognitive 57) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · JevResponse.parseAnswer (cognitive 55) modules/providers/jev/src/main/scala/org/llm4s/jev/JevResponse.scala
  • Cognitive Complexity · TypedAgent.bindUnder (cognitive 52) modules/agent/src/main/scala/org/llm4s/agent/delegation/TypedAgent.scala
  • Cognitive Complexity · JevResponse.parseScore (cognitive 51) modules/providers/jev/src/main/scala/org/llm4s/jev/JevResponse.scala
  • Cognitive Complexity · StreamableHTTPTransportImpl.readSSEResponse (cognitive 49) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala
  • Cognitive Complexity · OllamaClient.stream (cognitive 49) modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaClient.scala
  • Cognitive Complexity · Frontmatter.flowList (cognitive 47) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala
  • Cognitive Complexity · WebSocketCommandExecutor.stream (cognitive 47) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala
  • Cognitive Complexity · AgentBuilder.build (cognitive 45) modules/agent/src/main/scala/org/llm4s/agent/AgentBuilder.scala
  • Cognitive Complexity · Redaction.redactQuoted (cognitive 45) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · Redaction.escapedQuotedValues (cognitive 43) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · Redaction.scanQuotedValue (cognitive 41) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · Redaction.ampTailEdits (cognitive 40) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · WorkspaceAgentInterfaceImpl.writeFile (cognitive 40) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala
  • Cognitive Complexity · GraphRuntime.updateState (cognitive 38) modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala
  • Cognitive Complexity · Frontmatter.fields (cognitive 38) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala
  • Cognitive Complexity · CommandPolicy.parseOptions (cognitive 38) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala
  • Cognitive Complexity · CommandPolicy.sequenceRefusal (cognitive 38) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala
  • Cognitive Complexity · Redaction.quoteSafeParts (cognitive 37) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · JevRequest.validate (cognitive 37) modules/providers/jev/src/main/scala/org/llm4s/jev/JevRequest.scala
  • Cognitive Complexity · NamedProviderConfigValidator.validate (cognitive 36) modules/core/src/main/scala/org/llm4s/config/NamedProviderValidator.scala
  • Cognitive Complexity · HTTPTool.followRedirects (cognitive 35) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/http/HTTPTool.scala
  • Cognitive Complexity · ReplayGuard.verifiable (cognitive 35) modules/agent/src/main/scala/org/llm4s/agent/graph/EffectReplay.scala
  • Cognitive Complexity · DocumentText.read (cognitive 35) modules/agent/src/main/scala/org/llm4s/agent/harness/RunDocuments.scala
  • Cognitive Complexity · Redaction.escapedQueryParamValues (cognitive 35) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · Redaction.cookieValueEnd (cognitive 34) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · CommandPolicy.cpDestinationRefusal (cognitive 34) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala
  • Cognitive Complexity · JSONTool.processJSON (cognitive 33) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/core/JSONTool.scala
  • Cognitive Complexity · WorkspaceAgentInterfaceImpl.fileSnapshot (cognitive 32) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala
  • Cognitive Complexity · JevConfig.validate (cognitive 31) modules/providers/jev/src/main/scala/org/llm4s/jev/JevConfig.scala
  • Cognitive Complexity · ProcessRegistry.spawn (cognitive 31) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/ProcessRegistry.scala
  • Cognitive Complexity · Redaction.addedReadingEdits (cognitive 30) modules/core/src/main/scala/org/llm4s/util/Redaction.scala
  • Cognitive Complexity · Frontmatter.quotedAt (cognitive 29) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala
  • Cognitive Complexity · ClientBuilds.openAiCompatibleConfig (cognitive 28) modules/java-api/src/main/scala/org/llm4s/javaapi/ClientBuilds.scala
  • Cognitive Complexity · ClientBuilds.azureOpenAiConfig (cognitive 28) modules/java-api/src/main/scala/org/llm4s/javaapi/ClientBuilds.scala
  • Cognitive Complexity · CompiledGraph.restoreTask (cognitive 26) modules/agent/src/main/scala/org/llm4s/agent/graph/CompiledGraph.scala
  • Cognitive Complexity · StreamableHTTPTransportImpl.handleResponse (cognitive 25) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala
  • Cognitive Complexity · CommandPolicy.linkOperands (cognitive 25) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala
  • Cognitive Complexity · ListDirectoryTool.listDirectory (cognitive 24) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/filesystem/ListDirectoryTool.scala

Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 107 findings

These 107 critical or serious findings were in the previous survey, on 5 October 2026, and are gone from this one. The first 100 are listed here.

  • Cyclomatic Complexity · Agent.runStep (cyclomatic 30) modules/agent/src/main/scala/org/llm4s/agent/Agent.scala
  • Cyclomatic Complexity · SQLiteMemoryStore.filterToSql (cyclomatic 28) REDACTED
  • Cyclomatic Complexity · AgentStreamingExecutor.runWithStrategyInternal (cyclomatic 25) modules/agent/src/main/scala/org/llm4s/agent/AgentStreamingExecutor.scala
  • Cyclomatic Complexity · RunnerMain.handleExecuteCommand (cyclomatic 24) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/RunnerMain.scala
  • Cyclomatic Complexity · StreamableHTTPTransportImpl.parseSSEResponse (cyclomatic 22) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala
  • Cyclomatic Complexity · WorkspaceAgentInterfaceImpl.executeCommand (cyclomatic 21) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala
  • Cyclomatic Complexity · Agent.run (cyclomatic 20) modules/agent/src/main/scala/org/llm4s/agent/Agent.scala
  • Cyclomatic Complexity · StreamableHTTPTransportImpl.sendRequest (cyclomatic 17) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala
  • Cyclomatic Complexity · CompiledGraph.decodeWrite (cyclomatic 16) modules/agent/src/main/scala/org/llm4s/agent/graph/CompiledGraph.scala
  • Cognitive Complexity · Agent.runStep (cognitive 86) modules/agent/src/main/scala/org/llm4s/agent/Agent.scala
  • Cognitive Complexity · RunnerMain.handleExecuteCommand (cognitive 58) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/RunnerMain.scala
  • Cognitive Complexity · AgentStreamingExecutor.runWithStrategyInternal (cognitive 45) modules/agent/src/main/scala/org/llm4s/agent/AgentStreamingExecutor.scala
  • Cognitive Complexity · HTTPTool.makeRequest (cognitive 35) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/http/HTTPTool.scala
  • Cognitive Complexity · StreamableHTTPTransportImpl.parseSSEResponse (cognitive 35) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala
  • Cognitive Complexity · AsyncHybridSearcher.searchWithWeightedScore (cognitive 34) modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala
  • Cognitive Complexity · Agent.run (cognitive 29) modules/agent/src/main/scala/org/llm4s/agent/Agent.scala
  • Cognitive Complexity · RAG.build (cognitive 28) modules/rag/src/main/scala/org/llm4s/rag/RAG.scala
  • Cognitive Complexity · StreamableHTTPTransportImpl.sendRequest (cognitive 27) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala
  • Cognitive Complexity · WorkspaceAgentInterfaceImpl.executeCommand (cognitive 24) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala
  • Cognitive Complexity · WorkspaceTools.createDefaultWorkspaceTools (cognitive 21) modules/workspace/workspaceClient/src/main/scala/org/llm4s/toolapi/WorkspaceTools.scala
  • Cognitive Complexity · EmbeddingsConfigLoader.buildEmbeddingsConfig (cognitive 20) modules/core/src/main/scala/org/llm4s/config/EmbeddingsConfigLoader.scala
  • Cognitive Complexity · AgentTraceFormatter.formatStateAsMarkdown (cognitive 19) modules/agent/src/main/scala/org/llm4s/agent/AgentTraceFormatter.scala
  • Cognitive Complexity · HybridSearcher.searchWithWeightedScore (cognitive 19) modules/rag/src/main/scala/org/llm4s/vectorstore/HybridSearcher.scala
  • Cognitive Complexity · AgentStreamingExecutor.runWithEventsInternal (cognitive 17) modules/agent/src/main/scala/org/llm4s/agent/AgentStreamingExecutor.scala
  • Cognitive Complexity · ToolRegistry.runWithRetry (cognitive 17) modules/core/src/main/scala/org/llm4s/toolapi/ToolRegistry.scala
  • Cognitive Complexity · GraphRuntime.resume (cognitive 16) modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala
  • Cognitive Complexity · Plan.getParallelBatches (cognitive 16) modules/agent/src/main/scala/org/llm4s/agent/orchestration/DAG.scala
  • Cognitive Complexity · CachingLLMClient.complete (cognitive 16) modules/core/src/main/scala/org/llm4s/llmconnect/caching/CachingLLMClient.scala
  • Cognitive Complexity · SQLiteMemoryStore.filterToSql (cognitive 16) REDACTED
  • Cognitive Complexity · ContainerisedWorkspace.sendCommand (cognitive 16) modules/workspace/workspaceClient/src/main/scala/org/llm4s/workspace/ContainerisedWorkspace.scala
  • God Classes · ClassTooLong: WorkspaceAgentInterfaceImpl modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala
  • Code Duplication · Near-duplicate member pair (40 shared lines) modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala
  • Code Duplication · Edited copy of a member (25 corresponding lines) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/GraphJsonParser.scala
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) modules/rag/src/main/scala/org/llm4s/rag/evaluation/TestDataset.scala
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) modules/anthropic/src/main/scala/org/llm4s/llmconnect/config/AnthropicConfig.scala
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) modules/gemini/src/main/scala/org/llm4s/llmconnect/config/GeminiConfig.scala
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala
  • Code Duplication · Duplicated block (39–57 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala
  • Code Duplication · Duplicated block (44–56 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala
  • Code Duplication · Duplicated block (43–45 lines × 2) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala
  • Code Duplication · Duplicated block (40–44 lines × 2) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala
  • Code Duplication · Duplicated block (40 lines × 2) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala
  • Code Duplication · Duplicated block (25–37 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala
  • Code Duplication · Duplicated block (27–30 lines × 2) REDACTED
  • Code Duplication · Duplicated block (20–26 lines × 2) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/OpenAIImageClient.scala
  • Code Duplication · Duplicated block (25–26 lines × 2) REDACTED
  • Code Duplication · Duplicated block (16–24 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala
  • Code Duplication · Duplicated block (21–23 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala
  • Code Duplication · Duplicated block (19 lines × 2) modules/agent/src/main/scala/org/llm4s/agent/AgentStreamingExecutor.scala
  • Code Duplication · Duplicated block (16–18 lines × 2) modules/agent/src/main/scala/org/llm4s/agent/Agent.scala
  • Code Duplication · Duplicated block (14–18 lines × 2) modules/openai/src/main/scala/org/llm4s/llmconnect/provider/OpenAIEmbeddingProvider.scala
  • Code Duplication · Duplicated block (16 lines × 2) modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala
  • Code Duplication · Duplicated block (16 lines × 2) modules/openai/src/main/scala/org/llm4s/llmconnect/provider/OpenAIEmbeddingProvider.scala
  • Code Duplication · Duplicated block (16 lines × 2) modules/workspace/workspaceClient/src/main/scala/org/llm4s/toolapi/WorkspaceTools.scala
  • Code Duplication · Duplicated block (15 lines × 2) REDACTED
  • Code Duplication · Duplicated block (15 lines × 2) modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaEmbeddingProvider.scala
  • Code Duplication · Duplicated block (15 lines × 2) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/RunnerMain.scala
  • Code Duplication · Duplicated block (14 lines × 3) modules/workspace/workspaceClient/src/main/scala/org/llm4s/toolapi/WorkspaceTools.scala
  • Code Duplication · Duplicated block (13 lines × 3) modules/agent/src/main/scala/org/llm4s/agent/Agent.scala
  • Code Duplication · Duplicated block (13 lines × 3) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/RunnerMain.scala
  • Code Duplication · Duplicated block (13 lines × 2) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala
  • Code Duplication · Duplicated block (12–13 lines × 2) modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala
  • Code Duplication · Duplicated block (12–13 lines × 2) REDACTED
  • Code Duplication · Duplicated block (12 lines × 2) REDACTED
  • Code Duplication · Duplicated block (12 lines × 2) modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala
  • Code Duplication · Duplicated block (11 lines × 2) modules/agent/src/main/scala/org/llm4s/agent/Agent.scala
  • Code Duplication · Duplicated block (10 lines × 3) modules/agent/src/main/scala/org/llm4s/agent/Agent.scala
  • Code Duplication · Duplicated block (10 lines × 2) modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala
  • Code Duplication · Duplicated block (9 lines × 4) modules/anthropic/src/main/scala/org/llm4s/llmconnect/config/AnthropicConfig.scala
  • Code Duplication · Duplicated block (8–9 lines × 4) modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala
  • Code Duplication · Duplicated block (9 lines × 2) modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/GroundingGuardrail.scala
  • Code Duplication · Duplicated block (9 lines × 2) modules/gemini/src/main/scala/org/llm4s/config/GeminiModelLister.scala
  • Code Duplication · Duplicated block (8 lines × 3) REDACTED
  • Code Duplication · Duplicated block (8 lines × 2) modules/agent/src/main/scala/org/llm4s/agent/ToolProcessor.scala
  • Code Duplication · Duplicated block (8 lines × 2) REDACTED
  • Code Duplication · Duplicated block (7 lines × 3) modules/agent/src/main/scala/org/llm4s/agent/orchestration/Policies.scala
  • Code Duplication · Duplicated block (7 lines × 3) REDACTED
  • Code Duplication · Duplicated block (7 lines × 3) REDACTED
  • Code Duplication · Duplicated block (6 lines × 5) REDACTED
  • Code Duplication · Duplicated block (5 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala
  • Code Duplication · Duplicated block (11 lines × 2) modules/agent/src/main/scala/org/llm4s/agent/Agent.scala
  • Code Duplication · Duplicated block (5 lines × 4) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala
  • Code Duplication · Duplicated block (5 lines × 4) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala
  • Code Duplication · Duplicated block (5 lines × 4) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala
  • Code Duplication · Duplicated block (5 lines × 3) modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/AnswerRelevancy.scala
  • Code Duplication · Duplicated block (6 lines × 2) modules/agent/src/main/scala/org/llm4s/agent/AgentStreamingExecutor.scala
  • Code Duplication · Duplicated block (5 lines × 2) modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala
  • Code Duplication · Duplicated block (45–46 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala
  • Code Duplication · Duplicated block (41–42 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/streaming/StreamingAgentExample.scala
  • Code Duplication · Duplicated block (13 lines × 3) modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala
  • Code Duplication · Duplicated block (10 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/agent/AsyncToolAgentExample.scala
  • Code Duplication · Duplicated block (10 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/cookbook/HallucinationDetector.scala
  • Code Duplication · Duplicated block (9 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/agent/ConversationPersistenceExample.scala
  • Code Duplication · Duplicated block (7 lines × 6) modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala
  • Code Duplication · Duplicated block (7 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/agent/MultiStepAgentExample.scala
Rebuild cost: about €430,000 · Estimate
Cost to rebuild€140,000 to €710,000, for 2,366 to 7,506 hours of work, about 2.9 person-years for 1 to 6 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 59. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 172,458 lines of product code

How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
On Scala 3, add `-Yexplicit-nulls` to `scalacOptions` so `String` and `String | Null` mean different things, and type each Java API's result as nullable where it can return null; on Scala 2 (or as a first step), enable WartRemover's `Null` wart (`wartremoverErrors += Wart.Null`) or Scalafix's `DisableSyntax.noNulls = true` so the code holds absence in `Option`.
Then pay the assertions down rather than adding to them: each `.nn` is a null the compiler could not rule out — wrap the Java value in `Option(…)` at the boundary, pattern-match on `null` once there, or change the API so the null cannot arrive; an `unsafeNulls` import switches the checking off for everything after it.
Raises the score by about 5 points · Medium effort · Nullable reference types
2
Reconcile the README with reality: README claims LLM4S is a 'pre-1.0 release' while the evidence shows no such version and only v0.5.1 exists; CONTRIBUTING.md documents the environment variable `SCREAMING_SNAKE_CASE`, but no code, script or configuration file names it; README.md names `src/main/scala-3`, but no file or folder `src/main/scala-3` exists; README.md names `provider/model`, but no file or folder `provider/model` exists; README.md links to `RELEASE.md`, but `RELEASE.md` does not exist.
Raises the score by about 4 points · Medium effort · Documentation accuracy
3
Interpolated log message defeats structured logging
Raises the score by about 4 points · Medium effort · Structured logging

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €430,000 to build again, about 2.9 person-years of work. Its weakest lens is Code Health, at 52 (Adequate). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
On Scala 3, add `-Yexplicit-nulls` to `scalacOptions` so `String` and `String | Null` mean different things, and type each Java API's result as nullable where it can return null; on Scala 2 (or as a first step), enable WartRemover's `Null` wart (`wartremoverErrors += Wart.Null`) or Scalafix's `DisableSyntax.noNulls = true` so the code holds absence in `Option`. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.

arch agent agent core core agent->core agentMemory agentMemory agentMemory->agent memory memory agentMemory->memory agentTestkit agentTestkit agentTestkit->agent anthropic anthropic anthropic->core bedrock bedrock bedrock->core configPolicy configPolicy configPolicy->anthropic configPolicy->bedrock configPolicy->core gemini gemini configPolicy->gemini ollama ollama configPolicy->ollama openai openai configPolicy->openai openaiCompatible openaiCompatible configPolicy->openaiCompatible media media core->media deployService deployService deployService->anthropic deployService->core deployService->gemini deployService->ollama deployService->openai deployService->openaiCompatible docs docs docs->agent docs->agentMemory docs->agentTestkit docs->anthropic docs->bedrock docs->core docs->gemini javaApi javaApi docs->javaApi knowledgegraph knowledgegraph docs->knowledgegraph docs->media docs->memory docs->ollama docs->openai docs->openaiCompatible rag rag docs->rag workspaceClient workspaceClient docs->workspaceClient workspaceShared workspaceShared docs->workspaceShared gemini->core javaApi->agent javaApi->anthropic javaApi->core javaApi->gemini javaApi->ollama javaApi->openai javaApi->openaiCompatible knowledgegraph->core memory->core ollama->core openai->core openai->openaiCompatible openaiCompatible->core rag->core rag->knowledgegraph rag->media workspaceClient->agent workspaceClient->core workspaceClient->workspaceShared __more__ +36 more projects

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

461 modules, with 1216 dependencies between them. 13 loops run through 93 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 421 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 agent.harness.Frontmatter2 types.ProviderModelTypes3 error4 metrics5 org.llm4s6 agent.graph.toolloop7 http8 model9 toolapi10 trace11 agent.graph.toolloop.ToolLoop12 llmconnect.provider13 llmconnect14 agent.harness15 config16 llmconnect.spi17 llmconnect.config18 llmconnect.model19 agent.graph.tool20 samples.dashboard.providersetup21 speech22 agent.graph.middleware23 agent.guardrails24 agent.guardrails.ValidationMode25 agent.graph26 agent.memory27 rag.evaluation28 samples.chat.tui29 agent.delegation.ChildRunner30 samples.dashboard.repro.ProviderChatRenderReproApp31 vectorstore32 agent.delegation33 rag34 rag.benchmark35 agent36 agent.testkit37 javaapi38 samples.basic39 samples.cookbook40 samples.harness
1 agent.harness.Frontmatter
2 types.ProviderModelTypes
3 error1
4 metrics2
5 org.llm4s2
6 agent.graph.toolloop6416541312
7 http113
8 model462
9 toolapi1211
10 trace111219
11 agent.graph.toolloop.ToolLoop3311321131131
12 llmconnect.provider16204936829414096344831
13 llmconnect112511111112
14 agent.harness762912132431325
15 config419332112125119
16 llmconnect.spi31311214
17 llmconnect.config141111
18 llmconnect.model214122
19 agent.graph.tool431361
20 samples.dashboard.providersetup42222231
21 speech321
22 agent.graph.middleware14616188
23 agent.guardrails3113
24 agent.guardrails.ValidationMode3
25 agent.graph11319127131
26 agent.memory14132
27 rag.evaluation13113131
28 samples.chat.tui1141211821
29 agent.delegation.ChildRunner11111933
30 samples.dashboard.repro.ProviderChatRenderReproApp11
31 vectorstore116246
32 agent.delegation37222215151418111
33 rag11123116
34 rag.benchmark2513134
35 agent21462215313014
36 agent.testkit231221921
37 javaapi12274136111614
38 samples.basic41334121
39 samples.cookbook111721161151514
40 samples.harness182651321117
Uses a module listed above itPart of a loopThe module itself
1 agent.harness.Frontmatter2 types.ProviderModelTypes3 error4 metrics5 org.llm4s6 agent.graph.toolloop7 http8 model9 toolapi10 trace11 agent.graph.toolloop.ToolLoop12 llmconnect.provider13 llmconnect14 agent.harness15 config16 llmconnect.spi17 llmconnect.config18 llmconnect.model19 agent.graph.tool20 samples.dashboard.providersetup21 speech22 agent.graph.middleware23 agent.guardrails24 agent.guardrails.ValidationMode25 agent.graph26 agent.memory27 rag.evaluation28 samples.chat.tui29 agent.delegation.ChildRunner30 samples.dashboard.repro.ProviderChatRenderReproApp31 vectorstore32 agent.delegation33 rag34 rag.benchmark35 agent36 agent.testkit37 javaapi38 samples.basic39 samples.cookbook40 samples.harnessagent.harness.Frontmatter1types.ProviderModelTypes2error3metrics4org.llm4s5agent.graph.toolloop6http7model8toolapi9trace10agent.graph.toolloop.ToolLoop11llmconnect.provider12llmconnect13agent.harness14config15llmconnect.spi16llmconnect.config17llmconnect.model18agent.graph.tool19samples.dashboard.providersetup20speech21agent.graph.middleware22agent.guardrails23agent.guardrails.ValidationMode24agent.graph25agent.memory26rag.evaluation27samples.chat.tui28agent.delegation.ChildRunner29samples.dashboard.repro.ProviderChatRenderReproApp30vectorstore31agent.delegation32rag33rag.benchmark34agent35agent.testkit36javaapi37samples.basic38samples.cookbook39samples.harness4012264165413121134621211111219331132113113116204936829414096344831112511111112762912132431325419332112125119313112141411112141224313614222223132114616188311331131912713114132131131311141211821111119331111624637222215151418111111231162513134214622153130142312219211227413611161441334121111721161151514182651321117+421 more modules (most-connected shown)

At a glance — Code Health · 52% · Adequate · gated by X4, X5 ·

At a glance — Architecture · 92% · Adequate · gated by D26 ·

At a glance — Maturity · 57% · Adequate · gated by M4 ·

At a glance — Readiness · 76% · Strong ·

At a glance — Security · 67% · Adequate · gated by D29 ·

At a glance — Performance · 80% · Strong ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection222High / Critical
A02:2025 — Security Misconfiguration12Medium
A03:2025 — Software Supply Chain Failures4High / Critical

Roadmap

First, enforce strict null safety by enabling explicit null checks in the Scala compiler and replacing unsafe null assertions with proper Option handling at Java boundaries. Second, correct documentation drift by aligning the README and contributing guides with the actual project structure and versioning. Third, replace interpolated log messages with structured logging to improve observability. Finally, address the identified quality issues in the Architecture Decision Records, beginning with the files related to 2026.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
On Scala 3, add `-Yexplicit-nulls` to `scalacOptions` so `String` and `String | Null` mean different things, and type each Java API's result as nullable where it can return null; on Scala 2 (or as a first step), enable WartRemover's `Null` wart (`wartremoverErrors += Wart.Null`) or Scalafix's `DisableSyntax.noNulls = true` so the code holds absence in `Option`. Then pay the assertions down rather than adding to them: each `.nn` is a null the compiler could not rule out — wrap the Java value in `Option(…)` at the boundary, pattern-match on `null` once there, or change the API so the null cannot arrive; an `unsafeNulls` import switches the checking off for everything after it.+4.6 ptsMediumNullable reference types
Reconcile the README with reality: README claims LLM4S is a 'pre-1.0 release' while the evidence shows no such version and only v0.5.1 exists; CONTRIBUTING.md documents the environment variable `SCREAMING_SNAKE_CASE`, but no code, script or configuration file names it; README.md names `src/main/scala-3`, but no file or folder `src/main/scala-3` exists; README.md names `provider/model`, but no file or folder `provider/model` exists; README.md links to `RELEASE.md`, but `RELEASE.md` does not exist.+4.5 ptsMediumDocumentation accuracy
Interpolated log message defeats structured logging+4.5 ptsMediumStructured logging
Resolve the 1 The body is a step-by-step guide for preparing for ESoC with LLM4S but… finding(s) in ADR Quality — start with 2026.md.+2.1 ptsLowADR Quality
Resolve the 1 The body is a step-by-step guide on how to prepare for LFX2026 with… finding(s) in ADR Quality — start with 2026.md.+2.1 ptsLowADR Quality
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with GraphRAG.scala.+1.7 ptsLowKnowledge Freshness
Secure the server's transport: serve TLS itself (akka/pekko-http `ConnectionContext.httpsServer(sslContext)` with `newServerAt(…).enableHttps(…)`, an http4s server builder's `withTLS(…)`, Play's `https.port`), or run it behind a TLS-terminating proxy and trust it (`X-Forwarded-Proto`; Play `play.http.forwarded.trustedProxies`); send `Strict-Transport-Security` once it is HTTPS-only (http4s `HSTS(…)`, Play `RedirectHttpsFilter`).+1.8 ptsMediumWeb-Security Posture
Bring the 10 bodies over 60 down to 60 or less in Cognitive Complexity — start with Redaction.pythonValues (cognitive 251), TraceModelJson.parseSpan (cognitive 164), Redaction.redactLeaves (cognitive 158).+1.8 ptsHighCognitive Complexity

File quality

Per-file score 0–10 — a quality signature. Of 206 files carrying findings, judged against the Preview bar: 1% slop · 8% mixed · 91% near-clean.

FileScoreBandWorst signal
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.1SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedIaC & Container Security: Medium IaC: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.8MixedDependency Vulnerabilities: High CVE: REDACTED
modules/core/src/main/scala/org/llm4s/config/Llm4sConfig.scala6.7MixedExplicit Debt: TodoComment
modules/core/src/main/scala/org/llm4s/util/Redaction.scala7.0Near-cleanCyclomatic Complexity: Redaction.pythonValues (cyclomatic 144)
modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala7.0Near-cleanCyclomatic Complexity: ToolLoop.implement (cyclomatic 62)

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 222

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 614

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 156

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 10

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 72 of 76 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 76 dimensions across the health lenses
D1D2D3D4D5D6D7D9D12D13D14D15D16D17D19D20D21D26D28D29D30D31D34D35D36D37D40D41D43D44AX10AX2AX3AX4AX6AX8GD1IC1M1M2M3M4P1P10P2P3P4P5P6PF1PF2PF3S1X1X12X13X14X15X16X17X18X19X20X21X22X23X24X25X26X27X28X29X3X30X4X5

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 967 of 992 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a15ddb-ab9d-7038-bf90-6fa37db10597.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT READ here — but this repository measures it: a Codecov configuration (codecov.yml, target 90%) and a coverage step in CI (`codecov/codecov-action`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.scala, .java, .kt), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (`addSbtPlugin("org.scoverage" % "sbt-scoverage" % "<version>")` in `project/plugins.sbt`, then `sbt clean coverage test coverageReport`, or JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (`addSbtPlugin("org.scoverage" % "sbt-scoverage" % "<version>")` in `project/plugins.sbt`, then `sbt clean coverage test coverageReport`, or JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.scala, .java, .kt) and this repository declares an sbt build (repository root, 1185 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares an sbt build (build.sbt), but the licence verdict published here was taken over its gem dependencies. Nothing was read about its sbt dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (modules/kotlin-api/build.gradle.kts), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteSchema.scala`, `modules/agent-memory/src/main/scala/org/llm4s/agent/harness/memory/MemoryEvents.scala`, `modules/agent/src/main/scala/org/llm4s/agent/AgentTracing.scala`, `modules/agent/src/main/scala/org/llm4s/agent/RunScope.scala`, `modules/agent/src/main/scala/org/llm4s/agent/delegation/DelegatedSuspension.scala`, … (+40 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository's container is Spring (Scala), whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'java.sql.Connection' is imported (REDACTED:6), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'java.sql.Connection' is imported (REDACTED:6), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'java.sql.Connection' is imported (REDACTED:6), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 314 further occurrence(s) are not listed individually; the score already reflects all 354.
  • X4 Structured logging — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 429 further occurrence(s) are not listed individually; the score already reflects all 469.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
  • D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (4): D19, D20, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity5.6 / 10Adequate✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: Documented → Verified → Prevented · effective 5.6 / 10 · rule-coverage 100% · ceiling Prevented

77 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Redaction.pythonValues at 144. A further 1 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being ModelMetadata.supports at 16 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: modules/core/src/main/scala/org/llm4s/model/ModelMetadata.scala (ModelMetadata.supports at 16). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

Redaction.pythonValues (cyclomatic 144)modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1046
Redaction.redactLeaves (cyclomatic 113)modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3460
ToolLoop.implement (cyclomatic 62)modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:1275
Redaction.urlUserinfoPasswords (cyclomatic 44)modules/core/src/main/scala/org/llm4s/util/Redaction.scala:778
Redaction.withSingularKeys (cyclomatic 42)modules/core/src/main/scala/org/llm4s/util/Redaction.scala:905

+ 72 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with Redaction.pythonValues (cyclomatic 144), Redaction.redactLeaves (cyclomatic 113), ToolLoop.implement (cyclomatic 62). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cyclomatic Complexity from 5.6 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity5.0 / 10Adequate✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: Documented → Verified → Prevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Prevented

204 method(s) exceeded the cognitive complexity threshold of 15; the worst was Redaction.pythonValues at 251.

Redaction.pythonValues (cognitive 251)modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1046
TraceModelJson.parseSpan (cognitive 164)modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:314
Redaction.redactLeaves (cognitive 158)modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3460
ToolLoop.implement (cognitive 157)modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:1275
HostFileBackend.openWith (cognitive 139)modules/agent/src/main/scala/org/llm4s/agent/harness/HostFileBackend.scala:758

+ 199 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 10 bodies over 60 down to 60 or less in Cognitive Complexity — start with Redaction.pythonValues (cognitive 251), TraceModelJson.parseSpan (cognitive 164), Redaction.redactLeaves (cognitive 158). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 10 together lifts Cognitive Complexity from 5.0 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes9.3 / 10Stronggated by 44 serious findings✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.3 / 10 · rule-coverage 100% · ceiling Prevented

44 god class(es) detected.

FileTooLong: util/Redaction.scala · ×19modules/core/src/main/scala/org/llm4s/util/Redaction.scala
TooManyMethods: Redaction · ×18modules/core/src/main/scala/org/llm4s/util/Redaction.scala:40
MethodTooLong: Redaction.isRegexSpace · ×7modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2862

What to do

  1. Resolve the 19 FileTooLong finding(s) in God Classes — start with Redaction.scala, GraphRuntime.scala, CheckpointerContract.scala. — One of this dimension's main actionable groups (19 warning-level).
  2. Resolve the 18 TooManyMethods finding(s) in God Classes — start with GraphRuntime.scala (2), ToolLoop.scala (2), Redaction.scala. — One of this dimension's main actionable groups (18 warning-level).
  3. Resolve the 7 MethodTooLong finding(s) in God Classes — start with Redaction.scala (2), BedrockClient.scala (2), WebSocketCommandExecutor.scala. — One of this dimension's main actionable groups (7 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication9.4 / 10Stronggated by 220 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Verified

209 duplicated block group(s) detected. A further 11 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 51 of the 220 are in trees this repository does not ship — vendored, example/demo, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (5 lines × 2) · ×20modules/core/src/main/scala/org/llm4s/toolapi/ToolRegistry.scala:114
Duplicated block (6 lines × 2) · ×16modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:781
Duplicated block (9 lines × 2) · ×15modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:175
Duplicated block (8 lines × 2) · ×11modules/llm4s-zio/src/main/scala/org/llm4s/zio/AgentZ.scala:187
Duplicated block (10 lines × 2) · ×9modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:128

+ 89 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 20 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with GeminiClient.scala (2), RegexSafetyManager.scala (2), ToolRegistry.scala. — One of this dimension's main actionable groups (20 warning-level).
  2. Resolve the 16 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with PostgresCheckpointer.scala (3), RegexSafetyManager.scala (2), AnthropicClient.scala. — One of this dimension's main actionable groups (16 warning-level).
  3. Resolve the 15 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with TraceModelJson.scala (2), PostgresCheckpointer.scala, AnthropicConfig.scala. — One of this dimension's main actionable groups (15 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling9.0 / 10Stronggated by 7 serious findings✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 100% · ceiling Prevented

56 production modules (Gradle+npm+sbt), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; a dependsOn spread (deps: _*) and a project whose directory a helper computes are not visible there; 8 module(s) off the main sequence, with abstractness counted on 47 of the 56 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: core · ×7
Off the main sequence: workspaceShared

What to do

  1. Resolve the 7 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (7 warning-level).
  2. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.

D6 · Cohesion (LCOM4)10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 173 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Prevented

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

What to do

  1. Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d7_recommendation.md.

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

15659 test methods: 15478 unit, 165 integration, 16 BDD, 0 e2e. The Scala suite contributes 15659 test case(s) across 1090 file(s) in a test source set declaring at least one — every `test("…")`, `it("…")`, `property("…")` and `"…" in {…}` registration and every JUnit `@Test`, which is how munit, ScalaTest, utest, ZIO Test and specs2 declare a case; a case registered under a computed name is not counted, so this is a floor. Its tier split is INFERRED from paths and file names, except sbt's src/it source set, which the build declares.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D12 · Dependency Hygiene9.8 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Verified

5 outdated direct gem(s), 0 pinning defect(s). 10 declaration(s) graded against rubygems.org, 9 of them against a version resolved in a committed Gemfile.lock. 1 declaration(s) carry a requirement that EXCLUDES the current release; that is a deliberate constraint (a supported-version ceiling or a held-back CI pin) and is counted, not charged. Whether any of these gems is DEPRECATED or YANKED is not graded — rubygems.org publishes no deprecation marker, and a yank removes a version rather than flagging it. Whether any is UNMAINTAINED is not graded either: no registry publishes a maintenance status, and release age does not stand in for one. Whether any is UNUSED is a source question, not a registry one. Known CVEs in this dependency graph are D30's question, read from the manifest there.

Outdated: bigdecimal · ×5

✓ On the Gold path — maintain.

Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 36 shipped gem(s) use a banned license. Licences were resolved from rubygems.org over the 36 gem(s) a consumer installs — this repository's runtime declarations closed transitively over its committed Gemfile.lock. Development-group and `add_development_dependency` gems are excluded: they are not distributed with this repository. ★ COVERAGE OF THIS VERDICT: it grades this repository's gem dependencies and nothing else. The repository also declares an sbt build (build.sbt), and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.8 / 10Stronggated by 38 serious findings✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: modules/core/src/main/scala/org/llm4s/util/Redaction.scala (24×144=3456); modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala (29×62=1798); modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala (44×25=1100) Repeated repair below the complexity floor: modules/agent-testkit/src/main/scala/org/llm4s/agent/testkit/CheckpointerContract.scala (10 of 18 changes were fixes); modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala (10 of 14 changes were fixes); modules/workspace/workspaceShared/src/main/scala/org/llm4s/shared/WorkspaceSandboxConfig.scala (5 of 8 changes were fixes)

Hotspot: modules/core/src/main/scala/org/llm4s/util/Redaction.scala · ×27modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1046
Repeated repair: modules/agent-testkit/src/main/scala/org/llm4s/agent/testkit/CheckpointerContract.scala · ×11modules/agent-testkit/src/main/scala/org/llm4s/agent/testkit/CheckpointerContract.scala:2101

What to do

  1. Resolve the 27 Hotspot finding(s) in Churn × Complexity Hotspots — start with Redaction.scala, ToolLoop.scala, GraphRuntime.scala. — One of this dimension's main actionable groups (27 warning-level).
  2. Resolve the 11 Repeated repair finding(s) in Churn × Complexity Hotspots — start with CheckpointerContract.scala, SqliteCheckpointer.scala, WorkspaceSandboxConfig.scala. — One of this dimension's main actionable groups (11 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor9.5 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: Documented → Verified → Prevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Documented

28 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is modules/image/src/main/scala/org/llm4s/imageprocessing/provider/LocalImageProcessor.scala. Counted over 603 of the 819 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1 · ×2
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt10.0 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

1 deducted task-comment markers across 172458 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoCommentmodules/core/src/main/scala/org/llm4s/config/Llm4sConfig.scala:330

What to do

  1. Resolve the 1 TodoComment finding(s) in Explicit Debt — start with Llm4sConfig.scala. — One of this dimension's main actionable groups (1 warning-level).
  2. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation QualityExemplary◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Documented

The repository's root README (LLM4S - Large Language Models for Scala) is excellent: it opens with a star history graphic and momentum table, then an overview of the project, and links to every visible document in its outline. The deploy/README provides a staged-deployment template with live endpoints and a runnable example, while docs/README.md is itself a complete documentation directory (Getting Started through Reference) that is also fully outlined. All four modules READMEs are focused on their own directories rather than the repository as a whole, so they each show only what they document. The documentation is comprehensive for its module-level READMEs (observability, ollama, openai-compatible, openai, provider-testkit, rag, schema-derivation), covering installation, a detailed providers table with defaults and shared credentials, configuration examples, and an outline of each section. The architecture/design docs are separately documented at 216 markdown files, but the READMEs alone are clear, complete, and well-structured for their deployment tiers. (9 of 25 sampled documents could not be assessed: 1 of 3 evaluation groups failed.)

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR QualityAdequate◐ Sampled · advisory

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

Maturity: Documented → Verified → Prevented · effective Adequate / 10 · rule-coverage 100% · ceiling Documented

Evaluated 4 ADR(s) individually; mean quality 5.1/10 (mixed — many ADRs miss context or consequences). 2 flagged with a specific gap.

The body is a step-by-step guide for preparing for ESoC with LLM4S but does not state the context/problem driving the decision or give any consequences/trade-offs of joining the community and following these stepsEuropean Summer of Code/Project Ideas/2026.md
The body is a step-by-step guide on how to prepare for LFX2026 with LLM4S (application + 13 stepwise instructions), but no context/problem and no consequences/trade-offs are statedLFX Mentorship/Project Ideas/2026.md

What to do

  1. Resolve the 1 The body is a step-by-step guide for preparing for ESoC with LLM4S but… finding(s) in ADR Quality — start with 2026.md. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 The body is a step-by-step guide on how to prepare for LFX2026 with… finding(s) in ADR Quality — start with 2026.md. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D26 · Project Cohesion3.3 / 10Weak✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 3.3 / 10 · rule-coverage 100% · ceiling Documented

1 of 3 build units (Bundler, Gradle, sbt) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)0.0 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

222 finding(s): 0 critical, 219 high, 3 medium, 0 low. 157 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 126 file(s) — `docs/_includes/event-card.html`, `modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteSchema.scala`, `modules/agent-testkit/src/main/scala/org/llm4s/agent/testkit/CheckpointerContract.scala`, `modules/agent-testkit/src/main/scala/org/llm4s/agent/testkit/FileBackendContract.scala`, `modules/agent-testkit/src/main/scala/org/llm4s/agent/testkit/ReplayContract.scala`, … (+121 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 3 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 5 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 47 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (41), REDACTED (3), REDACTED. — One of this dimension's main actionable groups (47 issue-level).
  2. Resolve the 10 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (3), REDACTED. — One of this dimension's main actionable groups (10 issue-level).
  3. No action in Static Analysis (SAST) — all 157 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (157 issue-level, 0 of them charged here).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities8.8 / 10Adequategated by 2 critical findings✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.

Maturity: Documented → Verified → Prevented · effective 8.8 / 10 · rule-coverage 100% · ceiling Documented

2 finding(s): 0 critical, 2 high, 0 medium, 0 low.

REDACTED

What to do

  1. Resolve the 2 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D31 · IaC & Container Security8.9 / 10Strong✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (Dockerfile/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 8.9 / 10 · rule-coverage 100% · ceiling Documented

12 finding(s): 0 critical, 0 high, 10 medium, 2 low.

REDACTED
REDACTED

What to do

  1. Resolve the 10 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (9), REDACTED. — One of this dimension's main actionable groups (10 warning-level).
  2. Resolve the 2 Low IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 recommendation-level).

Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness9.4 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Documented

33 of 603 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is modules/rag/src/main/scala/org/llm4s/knowledgegraph/graphrag/GraphRAG.scala. Counted over 603 of the 819 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledgemodules/rag/src/main/scala/org/llm4s/knowledgegraph/graphrag/GraphRAG.scala:1
Orphaned file · ×32modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQAPipeline.scala:1
Further orphaned files (smaller)

What to do

  1. Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with GraphRAG.scala. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 32 Orphaned file finding(s) in Knowledge Freshness — start with GraphQAPipeline.scala, MCPTypes.scala, GraphQueryTranslator.scala. — One of this dimension's main actionable groups (32 recommendation-level).
  3. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: Documented → Verified → Prevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Documented

2/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D40 · Network Egress Confinement6.0 / 10Adequate✓ Tool-verified

What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.

Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Documented

0/2 network-egress controls present (network policy, egress restriction).

No network policy

What to do

  1. Resolve the 1 No network policy finding(s) in Network Egress Confinement. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d40_recommendation.md · top locations in Appendix A, every location in findings.md.

D41 · Kernel & Syscall Confinement8.0 / 10Strong✓ Tool-verified

What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.

Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Documented

1/1 workload(s) run every container under a seccomp profile; 0/1 declare an AppArmor/SELinux profile.

What to do

  1. Improve Kernel & Syscall Confinement — currently 8.0/10. — 1/1 workload(s) run every container under a seccomp profile; 0/1 declare an AppArmor/SELinux profile.

Detailed fixes: d41_recommendation.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 22 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition9.5 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX2 · Stateful singletons10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.

Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's Scala: methods whose whole body is still `???` or a "not implemented" throw where nothing overrides them, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

IC1 · Incompleteness & stubs10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Scala: methods whose body is `???` or only throws a "not implemented" error, methods that take inputs and return a constant or do nothing, dead `if (false)` branches, and skeleton classes most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

M1 · Documentation (README)8.5 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Add a README to the 3 of 4 project(s) that lack one — worth up to 1.5 pts.
M2 · Architecture documentation7.0 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

What to do

  • Grow the ADR log (currently 4) — reach 8 to raise the maturity tier; document significant decisions as they're made.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy0.0 / 10Critical◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • README claims LLM4S is a 'pre-1.0 release' while the evidence shows no such version and only v0.5.1 exists — searched for: `v0.5.1`, `pre-1.0`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest and configuration files (package.json and other *.json, *.csproj, *.props, *.sln/*.slnx, *.yml, *.toml, *.config, tool configs such as eslint.config.js, Dockerfile); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong. — README.md:86
  • CONTRIBUTING.md documents the environment variable `SCREAMING_SNAKE_CASE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — CONTRIBUTING.md:147
  • README.md names `src/main/scala-3`, but no file or folder `src/main/scala-3` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:326
  • README.md names `provider/model`, but no file or folder `provider/model` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:551
  • README.md links to `RELEASE.md`, but `RELEASE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:631
  • README.md links to `docs/image_assets/gsoc_assets/gsoc_2025/talks/gsoc_lighting_talks_2025/slides/Anshuman_Awasthi_LLM4S_Support_image_voice_and_other_LLM_modalites.pdf`, but `docs/image_assets/gsoc_assets/gsoc_2025/talks/gsoc_lighting_talks_2025/slides/Anshuman_Awasthi_LLM4S_Support_image_voice_and_other_LLM_modalites.pdf` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:726
  • README.md links to `docs/image_assets/gsoc_assets/gsoc_2025/talks/gsoc_lighting_talks_2025/slides/Anshuman_Awasthi_LLM4S_Support_image_voice_and_other_LLM_modalites.pptx`, but `docs/image_assets/gsoc_assets/gsoc_2025/talks/gsoc_lighting_talks_2025/slides/Anshuman_Awasthi_LLM4S_Support_image_voice_and_other_LLM_modalites.pptx` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:726
  • deploy/README.md documents the environment variable `JAVA_OPTS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — deploy/README.md:46
  • docs/PRODUCTION_DEPLOYMENT.md links to `getting-started/configuration#api-keys`, but `docs/getting-started/configuration` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/PRODUCTION_DEPLOYMENT.md:35
  • docs/PRODUCTION_DEPLOYMENT.md links to `reference/configuration-boundary`, but `docs/reference/configuration-boundary` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/PRODUCTION_DEPLOYMENT.md:737
  • docs/README.md links to `/scaladoc/`, but `scaladoc` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:48
  • docs/events.md links to `/community/#llm4s-dev-hours`, but `community` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/events.md:34
  • docs/index.md links to `/getting-started/installation`, but `getting-started/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:20
  • docs/index.md links to `/guide/image-generation`, but `guide/image-generation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:85
  • docs/index.md links to `/guide/speech`, but `guide/speech` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:85
  • docs/index.md links to `/guide/agents/`, but `guide/agents` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:103
  • docs/index.md links to `/guide/agents/guardrails`, but `guide/agents/guardrails` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:111
  • docs/index.md links to `/guide/agents/memory`, but `guide/agents/memory` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:119
  • docs/index.md links to `/advanced/`, but `advanced` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:137
  • docs/index.md links to `/getting-started/configuration#named-provider-sections`, but `getting-started/configuration` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:186
  • docs/index.md links to `/reference/v1-scope#scala-and-jdk-support`, but `reference/v1-scope` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:329
  • docs/index.md links to `/events/`, but `events` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:347
  • docs/index.md links to `/reference/roadmap`, but `reference/roadmap` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:376
  • docs/index.md links to `/guide/`, but `guide` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/index.md:382
  • docs/llm4s-g8-starter-kit.md names `src/test/scala/MainSpec.scala`, but no file or folder `src/test/scala/MainSpec.scala` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/llm4s-g8-starter-kit.md:127
  • docs/workspace-agent-protocol.md links to `reference/workspace-sandbox#command-policy`, but `docs/reference/workspace-sandbox` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/workspace-agent-protocol.md:278
  • docs/advanced/index.md links to `/reference/roadmap`, but `reference/roadmap` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/advanced/index.md:14
  • docs/advanced/index.md links to `/getting-started/installation`, but `getting-started/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/advanced/index.md:56
  • docs/advanced/index.md links to `/guide/`, but `guide` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/advanced/index.md:58
  • docs/advanced/index.md links to `/scaladoc/`, but `scaladoc` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/advanced/index.md:65
  • docs/api/index.md links to `/scaladoc/`, but `scaladoc` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/api/index.md:16
  • docs/api/index.md links to `../llm4s-api-spec`, but `docs/llm4s-api-spec` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/api/index.md:22
  • docs/api/index.md links to `../tool-calling-api-design`, but `docs/tool-calling-api-design` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/api/index.md:23
  • docs/api/index.md links to `../workspace-agent-protocol`, but `docs/workspace-agent-protocol` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/api/index.md:24
  • docs/api/index.md links to `../getting-started/configuration#api-keys`, but `docs/getting-started/configuration` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/api/index.md:84
  • docs/api/index.md links to `/guide/`, but `guide` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/api/index.md:180
  • docs/community/index.md links to `/reference/contributing`, but `reference/contributing` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/community/index.md:36
  • docs/community/index.md links to `/getting-started/installation`, but `getting-started/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/community/index.md:112
  • docs/community/index.md links to `/guide/`, but `guide` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/community/index.md:113
  • docs/community/index.md links to `/api/`, but `api` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/community/index.md:115

What to do

  • Reconcile the README with reality: README claims LLM4S is a 'pre-1.0 release' while the evidence shows no such version and only v0.5.1 exists; CONTRIBUTING.md documents the environment variable `SCREAMING_SNAKE_CASE`, but no code, script or configuration file names it; README.md names `src/main/scala-3`, but no file or folder `src/main/scala-3` exists; README.md names `provider/model`, but no file or folder `provider/model` exists; README.md links to `RELEASE.md`, but `RELEASE.md` does not exist.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning6.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

  • 38/43 types (88%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.

What to do

  • Keep implementation types off the public surface (Java: package-private (no modifier), or leave its package out of `module-info` exports; Kotlin: `internal`) so internals can change without breaking consumers.
P2 · Observability10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

P3 · Security & performance tooling10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

What to do

  • Dependabot is configured but does not watch `npm`, `gradle`, `bundler` — add those `package-ecosystem` entries to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

P5 · DR & Backup4.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
  • Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

PF1 · Benchmark discipline9.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

  • A JMH/Jetpack Benchmark suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured. — modules/benchmarks/src/main/scala/org/llm4s/benchmarks/ToolRegistryBenchmark.scala

What to do

  • Run JMH with the GC profiler (`-prof gc`, or addProfiler(GCProfiler.class)) so allocation rate regressions are visible, not just time.
PF2 · Allocation hygiene6.2 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.

Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.

What to do

  • Raise allocation-aware density on the hot paths — currently 55 use(s) across 164,370 production line(s) (~0.3/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
  • Java: on hot paths, work through buffer views (ByteBuffer/LongBuffer slices, MemorySegment) instead of copies, avoid boxing with primitive collections (fastutil, Eclipse Collections, HPPC, Trove), presize collections and StringBuilders, and pool expensive buffers (Netty's pooled allocator, commons-pool).
  • Kotlin: on hot paths, use primitive arrays (IntArray, LongArray …) and @JvmInline value classes instead of boxed values, primitive collections (androidx.collection, fastutil) instead of boxed ones, and presize collections and StringBuilders.
  • Scala: on hot paths, make small wrappers value classes (extends AnyVal), @specialized generic code over primitives, use primitive collections, and presize builders.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

S1 · Web-Security Posture6.0 / 10Adequate✓ Tool-verified

Other · Security — Read from this repository's Scala source and the Java beside it: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves HTTP itself (modules/deploy-service/src/main/scala/org/llm4s/deploy/DeployService.scala:34 — `cask.Main`), so its Scala source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Scala spelling appears in production source, not proven on every route. A Play application is credited the security headers Play's default `SecurityHeadersFilter` sends unless its build or configuration switches that filter off, and its cookies the HttpOnly flag Play sets by default.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • This repository runs an HTTP server and nothing in its Scala source or committed configuration secures the transport: no HTTPS served (akka/pekko-http `ConnectionContext.httpsServer`/`enableHttps`, an http4s builder's `withTLS`, Jetty's `SslContextFactory`, zio-http's `SSLConfig`, Play's `https.port`), no `Strict-Transport-Security` header, HSTS middleware or Play `RedirectHttpsFilter`, no `X-Forwarded-Proto` read or Play `play.http.forwarded.trustedProxies` for a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: modules/deploy-service/src/main/scala/org/llm4s/deploy/DeployService.scala:34 — `cask.Main`.
  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Scala server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: modules/deploy-service/src/main/scala/org/llm4s/deploy/DeployService.scala:34 — `cask.Main`.

What to do

  • Secure the server's transport: serve TLS itself (akka/pekko-http `ConnectionContext.httpsServer(sslContext)` with `newServerAt(…).enableHttps(…)`, an http4s server builder's `withTLS(…)`, Play's `https.port`), or run it behind a TLS-terminating proxy and trust it (`X-Forwarded-Proto`; Play `play.http.forwarded.trustedProxies`); send `Strict-Transport-Security` once it is HTTPS-only (http4s `HSTS(…)`, Play `RedirectHttpsFilter`).
  • Set security response headers on what the server sends — keep Play's `SecurityHeadersFilter` enabled, wrap akka/pekko-http routes in `respondWithHeaders(RawHeader("X-Content-Type-Options", "nosniff"), …)`, or add an http4s middleware that sets `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
X1 · Async correctness7.2 / 10Strong✓ Tool-verified

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

  • The `Future` this starts is not kept anywhere, and `scala.concurrent.Future` never reports a failure on its own: `Future { … }` catches any non-fatal exception its body throws and stores it as the future's `Failure` — not rethrown, not printed, not passed to the `ExecutionContext`'s `reportFailure` — so once nobody holds the future the error is gone, and nothing can wait for the work to finish either. Keep the future and compose it into what the caller returns (`for`/`flatMap`, `Future.sequence`), or, for genuine fire-and-forget, attach a handler that reports the failure — `Future { … }.failed.foreach(error => log.error("…", error))` or `.onComplete { case Failure(e) => report(e); case _ => }` — or catch and report inside the body itself. — modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala:218

What to do

  • Future started here is not kept
X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream4.0 / 10Weak✓ Tool-verified

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

  • The JDK pipes both `stdout` and `stderr` of a child started this way — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and here `process.getErrorStream` (stderr) is read while the child's end is awaited, but nothing in this scope ever reads `process.getInputStream` (stdout). The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds to stdout (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the `waitFor` or end of stream this code waits on never comes. Nothing fails loudly: the thread hangs and the stuck child holds its resources until something kills it. Read both streams (a thread or `Future` per stream), merge them with `redirectErrorStream(true)` before `start()`, discard the unwanted one with `redirectError(ProcessBuilder.Redirect.DISCARD)` (or `redirectOutput`), or use `scala.sys.process`, which pumps both. (×2) — modules/workspace/workspaceClient/src/main/scala/org/llm4s/workspace/ContainerisedWorkspace.scala:342, modules/workspace/workspaceClient/src/main/scala/org/llm4s/workspace/ContainerisedWorkspace.scala:354

What to do

  • Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

X18 · Disposal-pattern correctness3.8 / 10Weak✓ Tool-verified

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

  • `Files.list(…)` opens something that has to be given back — a file descriptor, a socket, a directory handle — and its only use reads `.iterator` through it and drops it, so this expression both creates the value and is the last place that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it: `Too many open files` under load, and on Windows a file that cannot be replaced or deleted while it is held. Open it with `scala.util.Using.resource(Files.list(…)) { r => … }`, which releases it on every path including a throw, or hold it and call `.close()` in a `finally`. — modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/filesystem/ListDirectoryTool.scala:141
  • `scala.io.Source.fromFile(…)` opens something that has to be given back — a file descriptor, a socket, a directory handle — and its only use reads `.getLines` through it and drops it, so this expression both creates the value and is the last place that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it: `Too many open files` under load, and on Windows a file that cannot be replaced or deleted while it is held. Open it with `scala.util.Using.resource(scala.io.Source.fromFile(…)) { r => … }`, which releases it on every path including a throw, or hold it and call `.close()` in a `finally`. (×2) — modules/rag/src/main/scala/org/llm4s/rag/benchmark/DatasetManager.scala:83, modules/rag/src/main/scala/org/llm4s/rag/benchmark/DatasetManager.scala:244
  • `Files.walk(…)` opens something that has to be given back — a file descriptor, a socket, a directory handle — and its only use reads `.iterator` through it and drops it, so this expression both creates the value and is the last place that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it: `Too many open files` under load, and on Windows a file that cannot be replaced or deleted while it is held. Open it with `scala.util.Using.resource(Files.walk(…)) { r => … }`, which releases it on every path including a throw, or hold it and call `.close()` in a `finally`. — modules/rag/src/main/scala/org/llm4s/rag/benchmark/DatasetManager.scala:213

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.

Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation7.8 / 10Strong✓ Tool-verified

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

  • `debug` at line 150 is called with an argument built by `json.obj.keySet.mkString("…")` (line 150), whose cost grows with the collection it walks. Scala evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: the logger takes a built `String` (SLF4J, Akka/Pekko `LoggingAdapter`, `context.log`), and there is no `isDebugEnabled`/`isTraceEnabled` test and no debug flag. — modules/agent/src/main/scala/org/llm4s/assistant/SessionManager.scala:150

What to do

  • In Scala, put the construction behind the logger's own check (`if (log.isDebugEnabled)`), or log through a logger that takes the message by name or by macro and so builds it only when the level is on — scala-logging's `LazyLogging`/`StrictLogging` (`logger.debug(s"rows: ${rows.mkString(", ")}")` expands to that check), log4s or log4cats. Interpolating into an `s"…"` is not the fix on SLF4J or Akka's `LoggingAdapter`: their `debug` takes a `String`, so the interpolation and every `mkString` inside it run before the call is entered.
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for` comprehension or `foreach` leaves the mutable collection it is walking alone — an `ArrayBuffer` or `ListBuffer` counts its changes and its iterator checks the count, an `ArrayDeque` (and `mutable.Queue`/`mutable.Stack`) is walked by index up to its starting length, and a `java.util` collection walked through `asScala` is fail-fast, so a body that adds to or removes from the very collection the loop is walking makes a later step throw `ConcurrentModificationException` (`IndexOutOfBoundsException` for a deque) and the remaining elements are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X4 · Structured logging2.2 / 10Weak✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `warn` at line 81 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/AgentTracing.scala:81
  • `warn` at line 127 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/AgentTracing.scala:127
  • `warn` at line 139 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/AgentTracing.scala:139
  • `warn` at line 147 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/AgentTracing.scala:147
  • `warn` at line 156 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/AgentTracing.scala:156
  • `warn` at line 58 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/AgentRun.scala:58
  • `warn` at line 167 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/AgentRun.scala:167
  • `warn` at line 151 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/Agent.scala:151
  • `warn` at line 346 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/delegation/TypedAgent.scala:346
  • `warn` at line 40 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/TracingSubscriber.scala:40
  • `warn` at line 45 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/TracingSubscriber.scala:45
  • `debug` at line 1217 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:1217
  • `warn` at line 1226 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:1226
  • `warn` at line 1257 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:1257
  • `debug` at line 1275 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:1275
  • `warn` at line 1733 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:1733
  • `warn` at line 2050 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:2050
  • `warn` at line 2056 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:2056
  • `warn` at line 2687 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:2687
  • `warn` at line 2747 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:2747
  • `warn` at line 2752 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:2752
  • `warn` at line 3004 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3004
  • `warn` at line 3076 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3076
  • `warn` at line 3156 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3156
  • `warn` at line 3167 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3167
  • `warn` at line 3194 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3194
  • `warn` at line 3215 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3215
  • `warn` at line 3310 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3310
  • `debug` at line 3384 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3384
  • `debug` at line 31 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/graph/EventType.scala:31
  • `warn` at line 89 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/guardrails/builtin/SecretLeakGuardrail.scala:89
  • `warn` at line 75 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/guardrails/builtin/PIIDetector.scala:75
  • `warn` at line 92 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/GroundingGuardrail.scala:92
  • `warn` at line 104 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/ContextRelevanceGuardrail.scala:104
  • `info` at line 101 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/core/src/main/scala/org/llm4s/config/SharedCredentials.scala:101
  • `debug` at line 88 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/core/src/main/scala/org/llm4s/context/TokenWindow.scala:88
  • `debug` at line 103 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/core/src/main/scala/org/llm4s/context/TokenWindow.scala:103
  • `info` at line 112 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/core/src/main/scala/org/llm4s/context/TokenWindow.scala:112
  • `debug` at line 138 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/core/src/main/scala/org/llm4s/context/TokenWindow.scala:138
  • `info` at line 152 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix. — modules/core/src/main/scala/org/llm4s/context/TokenWindow.scala:152

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether Scala's null is held to the type system and not undermined by assertions — a file compiled with `-Yexplicit-nulls` is one where `String` excludes null and `String | Null` admits it, a file under WartRemover's `Null` wart or Scalafix's `DisableSyntax.noNulls` is one whose code cannot write `null` and must say `Option`, and each `.nn`, `import scala.language.unsafeNulls` or null-lint suppression is the author overruling that.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • No build over this repository's 767 Scala product file(s) passes `-Yexplicit-nulls`, enables WartRemover's `Null` wart or runs Scalafix's `DisableSyntax.noNulls`, so every reference type admits null and nothing reports a `null` written into the code or returned from a Java API — the first one to reach a method call is a `NullPointerException`. `Option` by convention is a habit no tool here holds the code to.

What to do

  • On Scala 3, add `-Yexplicit-nulls` to `scalacOptions` so `String` and `String | Null` mean different things, and type each Java API's result as nullable where it can return null; on Scala 2 (or as a first step), enable WartRemover's `Null` wart (`wartremoverErrors += Wart.Null`) or Scalafix's `DisableSyntax.noNulls = true` so the code holds absence in `Option`. Then pay the assertions down rather than adding to them: each `.nn` is a null the compiler could not rule out — wrap the Java value in `Option(…)` at the boundary, pattern-match on `null` once there, or change the API so the null cannot arrive; an `unsafeNulls` import switches the checking off for everything after it.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health52%Adequate — gated by X4, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture92%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity57%Adequate — gated by M4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness76%StrongSolid.
Security67%Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance80%StrongStrongest area.
Unscored — 2 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 16 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 7 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Not assessed: this repository stores data through 'java.sql.Connection' (REDACTED:6) but declares no persisted model this check reads (Slick table columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
  • C4 Data Retention — Not assessed: this repository stores data through 'java.sql.Connection' (REDACTED:6) but declares no persisted model this check reads (Slick table columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
  • C5 Data-Subject Rights — Not assessed: this repository stores data through 'java.sql.Connection' (REDACTED:6) but declares no persisted model this check reads (Slick table columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
Not included — 40 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~228576 lines of test source are present (.scala, .java, .kt) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .scala suite was found but not re-run
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — none of 4 ADRs are conformance-checkable — unverifiable.
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.scala), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 45 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — applicable but not scored (3 signals for this style, 2 needed — the count is met but a required primary signal is absent): 10 strongly-typed id(s); 1061 value object(s); 33 domain event(s); its domain events are published by services or handlers — no domain entity raises one; no aggregate is declared and no domain structure surrounds the state-guarding types: not claimed as DDD
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JVM, Python source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`addSbtPlugin("org.scoverage" % "sbt-scoverage" % "<version>")` in `project/plugins.sbt`, then `sbt clean coverage test coverageReport`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X2 Cancellation propagation — no C# was loaded; this repository's Scala, Java, Python and Kotlin were read, and no request in it can be cancelled by a caller (Ktor, OkHttp's newCall or a URL stream, from a suspend function) — a Scala request takes no token: a Future cannot be cancelled, and cats-effect, ZIO and Monix interrupt the fiber that made the request from outside the call, not through a parameter; a Java request off Android takes no token: it is cancelled through the handle it returns (Future.cancel, Call.cancel, a Disposable), ambiently (io.grpc.Context) or by interrupting its thread, not through a parameter; a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Kotlin request outside a suspend function has no caller's cancellation to honour
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 222 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 132 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 22 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×1
  • Orphaned knowledge modules/rag/src/main/scala/org/llm4s/knowledgegraph/graphrag/GraphRAG.scala:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Serious — 614 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×27
  • Hotspot: modules/core/src/main/scala/org/llm4s/util/Redaction.scala modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1046 — modules/core/src/main/scala/org/llm4s/util/Redaction.scala changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 144 in Redaction.pythonValues at line 1046. 23 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/core/src/main/scala/org/llm4s/util/Redaction.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:1275 — modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in ToolLoop.implement at line 1275. 4 of those changes were fix/bug commits, and the other 25 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3228 — modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Run.loop at line 3228. 19 of those changes were fix/bug commits, and the other 25 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:272 — modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in AnthropicClient.streamComplete at line 272. 4 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:830 — modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in WorkspaceAgentInterfaceImpl.writeFile at line 830. 10 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupRuntime.scala modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupRuntime.scala:192 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupRuntime.scala changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in ProviderSetupRuntime.buildOverrideSession at line 192. 1 of those changes was a fix/bug commit, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupRuntime.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:264 — modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in StreamableHTTPTransportImpl.readSSEResponse at line 264. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/agent/src/main/scala/org/llm4s/agent/graph/EventHub.scala modules/agent/src/main/scala/org/llm4s/agent/graph/EventHub.scala:1180 — modules/agent/src/main/scala/org/llm4s/agent/graph/EventHub.scala changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Dispatcher.drain at line 1180. 10 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/agent/src/main/scala/org/llm4s/agent/graph/EventHub.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaClient.scala modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaClient.scala:191 — modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaClient.scala changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in OllamaClient.stream at line 191. 3 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaClient.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/agent/src/main/scala/org/llm4s/agent/delegation/ChildRunner.scala modules/agent/src/main/scala/org/llm4s/agent/delegation/ChildRunner.scala:362 — modules/agent/src/main/scala/org/llm4s/agent/delegation/ChildRunner.scala changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Attempt.step at line 362. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/agent/src/main/scala/org/llm4s/agent/delegation/ChildRunner.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:144 — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in VertexAIClient.streamComplete at line 144. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/rag/src/main/scala/org/llm4s/rag/RAG.scala modules/rag/src/main/scala/org/llm4s/rag/RAG.scala:331 — modules/rag/src/main/scala/org/llm4s/rag/RAG.scala changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in RAG.sync at line 331. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/rag/src/main/scala/org/llm4s/rag/RAG.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1387 — modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in CommandPolicy.sortCandidates at line 1387. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/samples/src/main/scala/org/llm4s/samples/chat/tui/ChatTuiConfig.scala modules/samples/src/main/scala/org/llm4s/samples/chat/tui/ChatTuiConfig.scala:104 — modules/samples/src/main/scala/org/llm4s/samples/chat/tui/ChatTuiConfig.scala changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in ChatTuiConfig.buildProvider at line 104. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/samples/src/main/scala/org/llm4s/samples/chat/tui/ChatTuiConfig.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/http/HTTPTool.scala modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/http/HTTPTool.scala:318 — modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/http/HTTPTool.scala changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in HTTPTool.followRedirects at line 318. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/http/HTTPTool.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala:257 — modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in BedrockClient.runStream at line 257. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala:165 — modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in LangfuseTracing.traceSingleEvent at line 165. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/observability/src/main/scala/org/llm4s/trace/TraceCollector.scala modules/observability/src/main/scala/org/llm4s/trace/TraceCollector.scala:94 — modules/observability/src/main/scala/org/llm4s/trace/TraceCollector.scala changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in TraceCollectorTracing.eventToSpan at line 94. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/observability/src/main/scala/org/llm4s/trace/TraceCollector.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/core/src/main/scala/org/llm4s/config/NamedProviderConfigNormalizer.scala modules/core/src/main/scala/org/llm4s/config/NamedProviderConfigNormalizer.scala:23 — modules/core/src/main/scala/org/llm4s/config/NamedProviderConfigNormalizer.scala changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in NamedProviderConfigNormalizer.normalize at line 23. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/core/src/main/scala/org/llm4s/config/NamedProviderConfigNormalizer.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/llm4s-pekko/src/main/scala/org/llm4s/pekko/BlockingSource.scala modules/llm4s-pekko/src/main/scala/org/llm4s/pekko/BlockingSource.scala:112 — modules/llm4s-pekko/src/main/scala/org/llm4s/pekko/BlockingSource.scala changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Stage.createLogicAndMaterializedValue at line 112. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/llm4s-pekko/src/main/scala/org/llm4s/pekko/BlockingSource.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StableDiffusionClient.scala modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StableDiffusionClient.scala:143 — modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StableDiffusionClient.scala changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in StableDiffusionClient.editImage at line 143. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StableDiffusionClient.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/core/src/main/scala/org/llm4s/trace/ConsoleTracing.scala modules/core/src/main/scala/org/llm4s/trace/ConsoleTracing.scala:61 — modules/core/src/main/scala/org/llm4s/trace/ConsoleTracing.scala changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in ConsoleTracing.traceEvent at line 61. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/core/src/main/scala/org/llm4s/trace/ConsoleTracing.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/samples/src/main/scala/org/llm4s/samples/metrics/PrometheusMetricsExample.scala modules/samples/src/main/scala/org/llm4s/samples/metrics/PrometheusMetricsExample.scala:89 — modules/samples/src/main/scala/org/llm4s/samples/metrics/PrometheusMetricsExample.scala changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in PrometheusMetricsExample.main at line 89. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/samples/src/main/scala/org/llm4s/samples/metrics/PrometheusMetricsExample.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala:157 — modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in WebSocketCommandExecutor.stream at line 157. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/trace-opentelemetry/src/main/scala/org/llm4s/trace/OpenTelemetryTracing.scala modules/trace-opentelemetry/src/main/scala/org/llm4s/trace/OpenTelemetryTracing.scala:118 — modules/trace-opentelemetry/src/main/scala/org/llm4s/trace/OpenTelemetryTracing.scala changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in OpenTelemetryTracing.mapEventToAttributes at line 118. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/trace-opentelemetry/src/main/scala/org/llm4s/trace/OpenTelemetryTracing.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×20
  • Duplicated block (5 lines × 2) modules/core/src/main/scala/org/llm4s/toolapi/ToolRegistry.scala:114 — modules/core/src/main/scala/org/llm4s/toolapi/ToolRegistry.scala:114-119 | modules/mcp/src/main/scala/org/llm4s/mcp/MCPToolRegistry.scala:93-97 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/core/src/main/scala/org/llm4s/toolapi/ToolRegistry.scala:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2903 — modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2903-2910 | modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2944-2948 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2903` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:394 — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:394-405 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:371-375 — before extracting anything, compare `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala` and `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 279 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:394` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:511 — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:511-517 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:460-464 — before extracting anything, compare `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala` and `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 279 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) modules/image/src/main/scala/org/llm4s/imageprocessing/provider/LocalImageProcessor.scala:54 — modules/image/src/main/scala/org/llm4s/imageprocessing/provider/LocalImageProcessor.scala:54-58 | modules/image/src/main/scala/org/llm4s/imageprocessing/provider/LocalImageProcessor.scala:86-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/LocalImageProcessor.scala:54` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:153 — modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:153-157 | REDACTED:104-108 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:153` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala:447 — modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala:447-451 | modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala:459-463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala:447` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1664 — modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1664-1668 | modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:2006-2010 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1664` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/RunnerMain.scala:258 — modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/RunnerMain.scala:258-266 | modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/RunnerMain.scala:309-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/RunnerMain.scala:258` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala:134 — modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala:134-138 | modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceRegexSafetyManager.scala:82-86 — before extracting anything, compare `modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala` and `modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceRegexSafetyManager.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala:145 — modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala:145-149 | modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceRegexSafetyManager.scala:93-97 — before extracting anything, compare `modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala` and `modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceRegexSafetyManager.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala:145` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) modules/mcp/src/main/scala/org/llm4s/mcp/MCPServer.scala:598 — modules/mcp/src/main/scala/org/llm4s/mcp/MCPServer.scala:598-602 | modules/samples/src/main/scala/org/llm4s/samples/mcp/DemonstrationMCPServer.scala:411-418 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/mcp/src/main/scala/org/llm4s/mcp/MCPServer.scala:598` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) REDACTED:693 — REDACTED:693-697 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:599-603 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:501 — modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:501-505 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:593-597 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:133 — modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:133-137 | modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:136-140 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphRanking.scala:141 — modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphRanking.scala:141-145 | modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphRanking.scala:211-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:88 — modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:88-92 | modules/samples/src/main/scala/org/llm4s/samples/agent/LongConversationExample.scala:59-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/mcp/AuthenticatedMCPServerSample.scala:74 — modules/samples/src/main/scala/org/llm4s/samples/mcp/AuthenticatedMCPServerSample.scala:74-78 | modules/samples/src/main/scala/org/llm4s/samples/mcp/AuthenticatedMCPServerSample.scala:87-91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/memory/BasicMemoryExample.scala:144 — modules/samples/src/main/scala/org/llm4s/samples/memory/BasicMemoryExample.scala:144-148 | modules/samples/src/main/scala/org/llm4s/samples/memory/BasicMemoryExample.scala:152-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/memory/BasicMemoryExample.scala:144` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/streaming/EventCollectionExample.scala:35 — modules/samples/src/main/scala/org/llm4s/samples/streaming/EventCollectionExample.scala:35-43 | modules/samples/src/main/scala/org/llm4s/samples/streaming/StreamingAgentExample.scala:21-25 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D3 · God Classes · FileTooLong · ×19
  • FileTooLong: util/Redaction.scala modules/core/src/main/scala/org/llm4s/util/Redaction.scala — FileTooLong — 2104 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1604 over it, 4.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: graph/GraphRuntime.scala modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala — FileTooLong — 1891 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1391 over it, 3.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: testkit/CheckpointerContract.scala modules/agent-testkit/src/main/scala/org/llm4s/agent/testkit/CheckpointerContract.scala — FileTooLong — 1869 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1369 over it, 3.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: toolloop/ToolLoop.scala modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala — FileTooLong — 1578 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1078 over it, 3.16× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: runner/WorkspaceAgentInterfaceImpl.scala modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala — FileTooLong — 1270 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: WorkspaceAgentInterfaceImpl (37-2052). The bar is 500 significant lines; this is 770 over it, 2.54× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: runner/CommandPolicy.scala modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala — FileTooLong — 1242 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 742 over it, 2.48× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: rag/RAG.scala modules/rag/src/main/scala/org/llm4s/rag/RAG.scala — FileTooLong — 963 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 463 over it, 1.93× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: harness/HostFileBackend.scala modules/agent/src/main/scala/org/llm4s/agent/harness/HostFileBackend.scala — FileTooLong — 898 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 398 over it, 1.80× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: graph/CompiledGraph.scala modules/agent/src/main/scala/org/llm4s/agent/graph/CompiledGraph.scala — FileTooLong — 838 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 338 over it, 1.68× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mcp/MCPTransport.scala modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala — FileTooLong — 809 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 309 over it, 1.62× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: graph/EventHub.scala modules/agent/src/main/scala/org/llm4s/agent/graph/EventHub.scala — FileTooLong — 659 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 159 over it, 1.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: provider/AnthropicClient.scala modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala — FileTooLong — 633 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 133 over it, 1.27× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: sqlite/SqliteCheckpointer.scala modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala — FileTooLong — 632 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 132 over it, 1.26× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: provider/OpenAIClient.scala modules/openai/src/main/scala/org/llm4s/llmconnect/provider/OpenAIClient.scala — FileTooLong — 631 significant lines (blank, comment-only and punctuation-only lines excluded), about 64% of them inside a single declaration: OpenAIClient (117-772). The bar is 500 significant lines; this is 131 over it, 1.26× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: graphrag/GraphRAG.scala modules/rag/src/main/scala/org/llm4s/knowledgegraph/graphrag/GraphRAG.scala — FileTooLong — 622 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 122 over it, 1.24× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: provider/BedrockClient.scala modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala — FileTooLong — 610 significant lines (blank, comment-only and punctuation-only lines excluded), about 67% of them inside a single declaration: BedrockClient (122-721). The bar is 500 significant lines; this is 110 over it, 1.22× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: memory/PostgresMemoryStore.scala modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala — FileTooLong — 535 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: PostgresMemoryStore (16-616). The bar is 500 significant lines; this is 35 over it, 1.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: postgres/PostgresCheckpointer.scala modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala — FileTooLong — 520 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 20 over it, 1.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: delegation/TypedAgent.scala modules/agent/src/main/scala/org/llm4s/agent/delegation/TypedAgent.scala — FileTooLong — 503 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3 over it, 1.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D3 · God Classes · TooManyMethods · ×18
  • TooManyMethods: Redaction modules/core/src/main/scala/org/llm4s/util/Redaction.scala:40 — TooManyMethods — 98 methods. The bar is 30 methods; this is 68 over it, 3.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GraphRuntime modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:224 — TooManyMethods — 85 methods. The bar is 30 methods; this is 55 over it, 2.83× the bar. This type is on a published API surface — a MiMa binary-compatibility gate (build.sbt) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: CommandPolicy modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:97 — TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CompiledGraph modules/agent/src/main/scala/org/llm4s/agent/graph/CompiledGraph.scala:42 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. This type is on a published API surface — a MiMa binary-compatibility gate (build.sbt) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: RAG modules/rag/src/main/scala/org/llm4s/rag/RAG.scala:61 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. This type is on a published API surface — a MiMa binary-compatibility gate (build.sbt) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: Dispatcher modules/agent/src/main/scala/org/llm4s/agent/graph/EventHub.scala:634 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Pipeline modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:1784 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Llm4sConfig modules/core/src/main/scala/org/llm4s/config/Llm4sConfig.scala:71 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. This type is on a published API surface — a MiMa binary-compatibility gate (build.sbt) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: ToolLoop modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:526 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. This type is on a published API surface — a MiMa binary-compatibility gate (build.sbt) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: HostFileBackend modules/agent/src/main/scala/org/llm4s/agent/harness/HostFileBackend.scala:76 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. This type is on a published API surface — a MiMa binary-compatibility gate (build.sbt) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: Run modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:2780 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Sql modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/Sql.scala:10 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PostgresCheckpointer modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:67 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. This type is on a published API surface — a MiMa binary-compatibility gate (build.sbt) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: Attempt modules/agent/src/main/scala/org/llm4s/agent/delegation/ChildRunner.scala:193 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SqliteCheckpointer modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:616 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. This type is on a published API surface — a MiMa binary-compatibility gate (build.sbt) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: Agent modules/agent/src/main/scala/org/llm4s/agent/Agent.scala:39 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. This type is on a published API surface — a MiMa binary-compatibility gate (build.sbt) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: OpenAIClient modules/openai/src/main/scala/org/llm4s/llmconnect/provider/OpenAIClient.scala:116 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. This type is on a published API surface — a MiMa binary-compatibility gate (build.sbt) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: WorkspaceAgentInterfaceImpl modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:37 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. This type is on a published API surface — a MiMa binary-compatibility gate (build.sbt) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×16
  • Duplicated block (6 lines × 2) modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:781 — modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:781-786 | modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:938-943 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:804 — modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:804-809 | modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:958-963 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:691 — modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:691-696 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:421-428 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:691` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala:122 — modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala:122-127 | modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceRegexSafetyManager.scala:143-148 — before extracting anything, compare `modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala` and `modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceRegexSafetyManager.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala:122` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala:181 — modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala:181-186 | modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/JsonGraphStore.scala:196-201 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala:151 — modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala:151-156 | modules/rag/src/main/scala/org/llm4s/vectorstore/HybridSearcher.scala:278-283 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/HybridSearcher.scala:288 — modules/rag/src/main/scala/org/llm4s/vectorstore/HybridSearcher.scala:288-294 | modules/rag/src/main/scala/org/llm4s/vectorstore/HybridSearcher.scala:343-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/vectorstore/HybridSearcher.scala:288` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:569 — modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:569-574 | modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:877-882 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) modules/core/src/main/scala/org/llm4s/config/RawProvidersConfigLoader.scala:189 — modules/core/src/main/scala/org/llm4s/config/RawProvidersConfigLoader.scala:189-194 | modules/core/src/main/scala/org/llm4s/config/SharedCredentials.scala:186-191 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala:167 — modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala:167-172 | modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceRegexSafetyManager.scala:165-170 — before extracting anything, compare `modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala` and `modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceRegexSafetyManager.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) modules/mcp/src/main/scala/org/llm4s/mcp/MCPServer.scala:195 — modules/mcp/src/main/scala/org/llm4s/mcp/MCPServer.scala:195-200 | modules/samples/src/main/scala/org/llm4s/samples/mcp/DemonstrationMCPServer.scala:65-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) REDACTED:365 — REDACTED:365-370 | REDACTED:321-326 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:396 — modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:396-401 | modules/agent/src/main/scala/org/llm4s/agent/graph/Checkpointer.scala:550-555 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:396` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:65 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:65-72 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupDemoView.scala:78-83 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupDemoView.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/memory/BasicMemoryExample.scala:103 — modules/samples/src/main/scala/org/llm4s/samples/memory/BasicMemoryExample.scala:103-108 | modules/samples/src/main/scala/org/llm4s/samples/memory/BasicMemoryExample.scala:112-117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/memory/BasicMemoryExample.scala:103` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:249 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:249-254 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala:183-188 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×15
  • Duplicated block (9 lines × 2) modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:175 — modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:175-183 | modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:241-249 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:175` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) modules/anthropic/src/main/scala/org/llm4s/llmconnect/config/AnthropicConfig.scala:170 — modules/anthropic/src/main/scala/org/llm4s/llmconnect/config/AnthropicConfig.scala:170-178 | modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/config/OpenAIConfig.scala:244-252 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/anthropic/src/main/scala/org/llm4s/llmconnect/config/AnthropicConfig.scala:170` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala:78 — modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala:78-86 | modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceRegexSafetyManager.scala:100-108 — before extracting anything, compare `modules/core/src/main/scala/org/llm4s/security/RegexSafetyManager.scala` and `modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceRegexSafetyManager.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:295 — modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:295-303 | modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:357-365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:347 — modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:347-355 | modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:419-427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:347` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaEmbeddingProvider.scala:112 — modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaEmbeddingProvider.scala:112-120 | modules/openai/src/main/scala/org/llm4s/llmconnect/provider/OpenAIEmbeddingProvider.scala:115-123 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `EmbeddingRequest): Result[EmbeddingResponse] = CancelledError.attempt("ollama.embed"` in one and `EmbeddingRequest): Result[EmbeddingResponse] = CancelledError.attempt("openai.embed"` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/config/CohereConfig.scala:97 — modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/config/CohereConfig.scala:97-105 | modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/config/MistralConfig.scala:70-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/config/CohereConfig.scala:97` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/config/DeepSeekConfig.scala:81 — modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/config/DeepSeekConfig.scala:81-89 | modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/config/ZaiConfig.scala:66-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/config/DeepSeekConfig.scala:81` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:230 — modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:230-238 | modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:254-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:230` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:331 — modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:331-339 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:349-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:331` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaClient.scala:159 — modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaClient.scala:159-167 | modules/providers/watsonx/src/main/scala/org/llm4s/llmconnect/provider/WatsonXClient.scala:542-550 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/basic/DeepSeekTestExample.scala:23 — modules/samples/src/main/scala/org/llm4s/samples/basic/DeepSeekTestExample.scala:23-31 | modules/samples/src/main/scala/org/llm4s/samples/basic/GeminiTestExample.scala:24-32 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/basic/DeepSeekTestExample.scala` and `modules/samples/src/main/scala/org/llm4s/samples/basic/GeminiTestExample.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/basic/DeepSeekTestExample.scala:23` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/context/ContextPipelineExample.scala:47 — modules/samples/src/main/scala/org/llm4s/samples/context/ContextPipelineExample.scala:47-55 | modules/samples/src/main/scala/org/llm4s/samples/context/LlmDigestSqueezeExample.scala:44-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/context/ContextPipelineExample.scala:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/memory/ConversationMemoryExample.scala:186 — modules/samples/src/main/scala/org/llm4s/samples/memory/ConversationMemoryExample.scala:186-194 | modules/samples/src/main/scala/org/llm4s/samples/memory/ConversationMemoryExample.scala:197-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:223 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:223-231 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala:157-165 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D15 · Churn × Complexity Hotspots · Repeated repair · ×11
  • Repeated repair: modules/agent-testkit/src/main/scala/org/llm4s/agent/testkit/CheckpointerContract.scala modules/agent-testkit/src/main/scala/org/llm4s/agent/testkit/CheckpointerContract.scala:2101 — modules/agent-testkit/src/main/scala/org/llm4s/agent/testkit/CheckpointerContract.scala changed 18 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is CheckpointerContract.evolving at line 2101), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): fence a child's first commit by the parent's claim (#2071) (#2072)”; “fix(agent): fence child deletes atomically by the claim above; optional ChildRef.toolCallId (#2063) (#2064)”; “fix(agent)!: bound a held run's closing commit and require every store call to return within a bound (closes #1919) (#1963)”; “fix(agent)!: a run's observer and run scope key on its claim's fencing token, not its RunId (closes #1918) (#1954)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/agent-testkit/src/main/scala/org/llm4s/agent/testkit/CheckpointerContract.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:348 — modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala changed 14 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is SqliteCheckpointer.prune at line 348), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): fence a child's first commit by the parent's claim (#2071) (#2072)”; “fix(agent): fence child deletes atomically by the claim above; optional ChildRef.toolCallId (#2063) (#2064)”; “fix(agent)!: bound a held run's closing commit and require every store call to return within a bound (closes #1919) (#1963)”; “fix(agent)!: a run's observer and run scope key on its claim's fencing token, not its RunId (closes #1918) (#1954)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: modules/workspace/workspaceShared/src/main/scala/org/llm4s/shared/WorkspaceSandboxConfig.scala modules/workspace/workspaceShared/src/main/scala/org/llm4s/shared/WorkspaceSandboxConfig.scala:467 — modules/workspace/workspaceShared/src/main/scala/org/llm4s/shared/WorkspaceSandboxConfig.scala changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is WorkspaceSandboxConfig.validate at line 467), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(workspace): widen the extra-commands denylist, refuse tar/zip/rsync/scp program options, give children a fallback PATH (closes #1805) (#1829)”; “fix(workspace): refuse interpreters and launchers as extra commands, sanitise child PATH, run cmd with /d (closes #1761, closes #1792) (#1802)”; “fix(workspace): launch allowlisted programs by a trusted absolute path, never from the working directory (closes #1790) (#1791)”; “fix(workspace): WebSocket commands go through the command policy, not a shell (closes #1756) (#1757)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/workspace/workspaceShared/src/main/scala/org/llm4s/shared/WorkspaceSandboxConfig.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: modules/core/src/main/scala/org/llm4s/reliability/RetryPolicy.scala modules/core/src/main/scala/org/llm4s/reliability/RetryPolicy.scala:64 — modules/core/src/main/scala/org/llm4s/reliability/RetryPolicy.scala changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is RetryPolicy.isTransient at line 64), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent)!: typed claim errors, recoverable ThreadBusy, inMemory clock, contract gaps (#1700 follow-up) (#1929)”; “fix(error): LLMError.isRecoverable is total (closes #1380) (#1383)”; “fix: LLMError.isRecoverable and RetryPolicy agree for every error type (closes #1316) (#1360)”; “fix: every client through Llm4sHttpClient; honour a 503's Retry-After (#1133) (#1264)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/core/src/main/scala/org/llm4s/reliability/RetryPolicy.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/GraphJsonParser.scala modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/GraphJsonParser.scala:44 — modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/GraphJsonParser.scala changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is GraphJsonParser.parse at line 44), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: redact provider response bodies before truncating them for logs and errors (closes #1674) (#1679)”; “fix(knowledgegraph): GraphJsonParser logs a bounded preview of the reply, not the whole reply (#1639)”; “fix: bound the nesting depth of model- and tool-produced JSON (closes #1562) (#1630)”; “fix(knowledgegraph): GraphJsonParser returns a Left for non-object input (closes #1527) (#1561)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/GraphJsonParser.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: modules/memory/src/main/scala/org/llm4s/agent/memory/BaseMemoryManagerOps.scala modules/memory/src/main/scala/org/llm4s/agent/memory/BaseMemoryManagerOps.scala:194 — modules/memory/src/main/scala/org/llm4s/agent/memory/BaseMemoryManagerOps.scala changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is BaseMemoryManagerOps.stats at line 194), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(memory)!: pass cancellation through entity extraction, growth-safe MemoryManagerConfig (#2026)”; “fix(memory)!: wire contextTokenBudget and autoExtractEntities, remove autoRecordMessages and consolidationEnabled (closes #1579) (#1827)”; “fix(memory): no section heading without an entry under a tight budget (closes #1580) (#1759)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/memory/src/main/scala/org/llm4s/agent/memory/BaseMemoryManagerOps.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: modules/agent/src/main/scala/org/llm4s/agent/guardrails/LLMGuardrail.scala modules/agent/src/main/scala/org/llm4s/agent/guardrails/LLMGuardrail.scala:273 — modules/agent/src/main/scala/org/llm4s/agent/guardrails/LLMGuardrail.scala changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is LLMGuardrail.readScore at line 273), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): judge guardrails validate their threshold (closes #1520) (#1566)”; “fix: redact provider response bodies before truncating them for logs and errors (closes #1674) (#1679)”; “fix(agent): judge guardrails refuse out-of-range and scaled scores instead of clamping them (closes #1405) (#1407)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/agent/src/main/scala/org/llm4s/agent/guardrails/LLMGuardrail.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/shell/ShellConfig.scala modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/shell/ShellConfig.scala:87 — modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/shell/ShellConfig.scala changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is ShellConfig.isCommandAllowed at line 87), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent-tools): ShellTool checks attached option values (closes #1723) (#1758)”; “fix(agent-tools): contain file paths by real path, scrub the shell environment, bound HTTP reads (part of #1408) (#1409)”; “fix(agent-tools): the read-only shell preset no longer allows env, reworked from #872 (#1341)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/shell/ShellConfig.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: modules/core/src/main/scala/org/llm4s/error/LLMError.scala modules/core/src/main/scala/org/llm4s/error/LLMError.scala:65 — modules/core/src/main/scala/org/llm4s/error/LLMError.scala changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is LLMError.isRecoverable at line 65), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(core): error context names the exception class when its message is null (closes #1556) (#1627)”; “fix(error): LLMError.isRecoverable is total (closes #1380) (#1383)”; “fix: LLMError.isRecoverable and RetryPolicy agree for every error type (closes #1316) (#1360)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/core/src/main/scala/org/llm4s/error/LLMError.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: modules/core/src/main/scala/org/llm4s/util/BoundedJson.scala modules/core/src/main/scala/org/llm4s/util/BoundedJson.scala:105 — modules/core/src/main/scala/org/llm4s/util/BoundedJson.scala changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is BoundedJson.maxNesting at line 105), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(core): DefaultErrorMapper classifies 401 and 429 only when the message names an HTTP status, and keeps the cause (closes #1668) (#1669)”; “fix(core): recognise a too-deep BoundedJson refusal structurally, not by error equality (closes #1651) (#1652)”; “fix(anthropic,gemini): bound the depth of tool_use input and functionCall.args (closes #1643) (#1644)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/core/src/main/scala/org/llm4s/util/BoundedJson.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: modules/agent/src/main/scala/org/llm4s/agent/graph/RunClaim.scala modules/agent/src/main/scala/org/llm4s/agent/graph/RunClaim.scala:85 — modules/agent/src/main/scala/org/llm4s/agent/graph/RunClaim.scala changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is ClaimRequest.of at line 85), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent)!: record the tenant on a run claim, so takeover and ThreadBusy never name another tenant's run (closes #1926) (#1953)”; “fix(agent)!: typed claim errors, recoverable ThreadBusy, inMemory clock, contract gaps (#1700 follow-up) (#1929)”; “fix(agent)!: a run judges its own claim lease and stops at once when it loses it (#1700 follow-up) (#1897)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-23..2026-10-21, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-23 15:02:14 +05:30' --until='2026-10-21 15:02:14 +05:30' --full-history --no-merges -- modules/agent/src/main/scala/org/llm4s/agent/graph/RunClaim.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×11
  • Duplicated block (8 lines × 2) modules/llm4s-zio/src/main/scala/org/llm4s/zio/AgentZ.scala:187 — modules/llm4s-zio/src/main/scala/org/llm4s/zio/AgentZ.scala:187-194 | modules/llm4s-zio/src/main/scala/org/llm4s/zio/AgentZ.scala:234-241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:211 — modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:211-218 | REDACTED:147-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:208 — modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:208-215 | modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:224-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:208` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:339 — modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:339-346 | modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:411-418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) modules/openai/src/main/scala/org/llm4s/llmconnect/provider/OpenAIEmbeddingProvider.scala:94 — modules/openai/src/main/scala/org/llm4s/llmconnect/provider/OpenAIEmbeddingProvider.scala:94-101 | modules/providers/voyage/src/main/scala/org/llm4s/llmconnect/provider/VoyageAIEmbeddingProvider.scala:92-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/openai/src/main/scala/org/llm4s/llmconnect/provider/OpenAIEmbeddingProvider.scala:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:99 — modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:99-106 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:133-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:355 — modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:355-362 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:373-380 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:355` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:92 — modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:92-99 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:121-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:119` calls `currentTimeMillis` and `modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:91` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:227 — modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:227-234 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:379-386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:227` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) modules/workspace/workspaceClient/src/main/scala/org/llm4s/workspace/ContainerisedWorkspace.scala:342 — modules/workspace/workspaceClient/src/main/scala/org/llm4s/workspace/ContainerisedWorkspace.scala:342-349 | modules/workspace/workspaceClient/src/main/scala/org/llm4s/workspace/ContainerisedWorkspace.scala:354-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:279 — modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:279-286 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:383-390 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D31 · IaC & Container Security · Medium IaC · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×9
  • Duplicated block (10 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:128 — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:128-137 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:127-136 — before extracting anything, compare `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala` and `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 279 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/OpenAIImageClient.scala:356 — modules/image/src/main/scala/org/llm4s/imagegeneration/provider/OpenAIImageClient.scala:356-365 | modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StabilityAIClient.scala:259-268 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/image/src/main/scala/org/llm4s/imagegeneration/provider/OpenAIImageClient.scala:356` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) modules/mcp/src/main/scala/org/llm4s/mcp/MCPServer.scala:540 — modules/mcp/src/main/scala/org/llm4s/mcp/MCPServer.scala:540-549 | modules/samples/src/main/scala/org/llm4s/samples/mcp/DemonstrationMCPServer.scala:175-185 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/mcp/src/main/scala/org/llm4s/mcp/MCPServer.scala:540` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) REDACTED:374 — REDACTED:374-383 | REDACTED:330-339 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala:375 — modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala:375-384 | modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala:399-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala:375` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:255 — modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:255-264 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:304-313 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:145 — modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:145-154 | modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala:146-155 — before extracting anything, compare `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala` and `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/streaming/BasicStreamingExample.scala:30 — modules/samples/src/main/scala/org/llm4s/samples/streaming/BasicStreamingExample.scala:30-39 | modules/samples/src/main/scala/org/llm4s/samples/streaming/StreamingWithProgressExample.scala:41-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/streaming/BasicStreamingExample.scala:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:71 — modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:71-80 | modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:139-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D3 · God Classes · MethodTooLong · ×7
  • MethodTooLong: Redaction.isRegexSpace modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2862 — MethodTooLong — isRegexSpace runs 641 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 541 over it, 6.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Redaction.jsonFieldPasses modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2865 — MethodTooLong — jsonFieldPasses runs 639 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 539 over it, 6.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WebSocketCommandExecutor.stream modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala:157 — MethodTooLong — stream runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BedrockClient.transformed modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala:234 — MethodTooLong — transformed runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SqliteCheckpointer.commit modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:134 — MethodTooLong — commit runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BedrockClient.runStream modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala:257 — MethodTooLong — runStream runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WorkspaceAgentInterfaceImpl.digestOf modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:678 — MethodTooLong — digestOf runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×7
  • Duplicated block (13 lines × 2) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala:220 — modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala:220-232 | modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StableDiffusionClient.scala:231-243 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala:220` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:218 — modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:218-230 | modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala:225-237 — before extracting anything, compare `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala` and `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:218` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:66 — modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:66-78 | modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:278-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala:30 — modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala:30-42 | modules/rag/src/main/scala/org/llm4s/vectorstore/HybridSearcher.scala:136-148 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:175 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:175-187 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala:109-121 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:234 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:234-246 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala:168-180 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/embeddingsupport/EmbeddingExample.scala:267 — modules/samples/src/main/scala/org/llm4s/samples/embeddingsupport/EmbeddingExample.scala:267-279 | modules/samples/src/main/scala/org/llm4s/samples/embeddingsupport/EmbeddingExample.scala:298-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/embeddingsupport/EmbeddingExample.scala:267` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×7
  • Duplicated block (7 lines × 2) modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/GroundingGuardrail.scala:243 — modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/GroundingGuardrail.scala:243-249 | modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/SourceAttributionGuardrail.scala:267-273 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/GroundingGuardrail.scala:243` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:376 — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:376-382 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:361-367 — before extracting anything, compare `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala` and `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 279 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:376` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:184 — modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:184-190 | modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala:192-199 — before extracting anything, compare `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala` and `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:184` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) modules/knowledgegraph-neo4j/src/main/scala/org/llm4s/knowledgegraph/neo4j/Neo4jGraphStore.scala:152 — modules/knowledgegraph-neo4j/src/main/scala/org/llm4s/knowledgegraph/neo4j/Neo4jGraphStore.scala:152-158 | modules/knowledgegraph-neo4j/src/main/scala/org/llm4s/knowledgegraph/neo4j/Neo4jGraphStore.scala:284-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/knowledgegraph-neo4j/src/main/scala/org/llm4s/knowledgegraph/neo4j/Neo4jGraphStore.scala:152` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) REDACTED:244 — REDACTED:244-250 | REDACTED:204-210 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:244` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) REDACTED:699 — REDACTED:699-705 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:605-611 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:11 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:11-17 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupDemoView.scala:11-17 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupDemoView.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D5 · Coupling · Off the main sequence · ×7
  • Off the main sequence: core — core: abstractness 0.10, instability 0.03, distance 0.87 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
  • Off the main sequence: agent — agent: abstractness 0.06, instability 0.09, distance 0.85 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
  • Off the main sequence: openaiCompatible — openaiCompatible: abstractness 0.02, instability 0.17, distance 0.81 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
  • Off the main sequence: media — media: abstractness 0.19, instability 0.00, distance 0.81 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
  • Off the main sequence: anthropic — anthropic: abstractness 0.00, instability 0.20, distance 0.80 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
  • Off the main sequence: gemini — gemini: abstractness 0.00, instability 0.20, distance 0.80 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
  • Off the main sequence: ollama — ollama: abstractness 0.00, instability 0.20, distance 0.80 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×6
  • Duplicated block (5 lines × 4) modules/gemini/src/main/scala/org/llm4s/llmconnect/config/GeminiConfig.scala:61 — modules/gemini/src/main/scala/org/llm4s/llmconnect/config/GeminiConfig.scala:61-65 | modules/ollama/src/main/scala/org/llm4s/llmconnect/config/OllamaConfig.scala:64-68 | modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/config/OpenAIConfig.scala:159-163 | modules/openai/src/main/scala/org/llm4s/llmconnect/config/AzureConfig.scala:64-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `modules/gemini/src/main/scala/org/llm4s/llmconnect/config/GeminiConfig.scala:61` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) REDACTED:595 — REDACTED:595-599 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:393-397 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:486-490 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:521-525 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:595` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:101 — modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:101-105 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:135-139 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:94-98 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:123-127 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 4) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala:177 — modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala:177-181 | modules/image/src/main/scala/org/llm4s/imagegeneration/provider/OpenAIImageClient.scala:170-174 | modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StabilityAIClient.scala:104-108 | modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StableDiffusionClient.scala:114-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (5 lines × 4) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala:188 — modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala:188-192 | modules/image/src/main/scala/org/llm4s/imagegeneration/provider/OpenAIImageClient.scala:181-185 | modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StabilityAIClient.scala:118-122 | modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StableDiffusionClient.scala:125-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (5 lines × 4) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala:200 — modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala:200-204 | modules/image/src/main/scala/org/llm4s/imagegeneration/provider/OpenAIImageClient.scala:193-197 | modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StabilityAIClient.scala:133-137 | modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StableDiffusionClient.scala:137-141 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (4 members, 50+ identical tokens) modules/gemini/src/main/scala/org/llm4s/llmconnect/config/GeminiConfig.scala:58 — modules/gemini/src/main/scala/org/llm4s/llmconnect/config/GeminiConfig.scala:58-65 | modules/ollama/src/main/scala/org/llm4s/llmconnect/config/OllamaConfig.scala:62-68 | modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/config/OpenAIConfig.scala:156-163 | modules/openai/src/main/scala/org/llm4s/llmconnect/config/AzureConfig.scala:61-68 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:97 — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:97-141 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:147-256 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:95-142 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:148-267 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:595 — REDACTED:595-603 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:393-401 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:486-494 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:521-529 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala:127 — modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala:127-167 | modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala:176-219 | modules/rag/src/main/scala/org/llm4s/vectorstore/HybridSearcher.scala:257-294 | modules/rag/src/main/scala/org/llm4s/vectorstore/HybridSearcher.scala:307-348 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:85 — modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:85-111 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:114-160 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:85-107 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:110-139 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×5
  • Duplicated block (12–13 lines × 2) modules/core/src/main/scala/org/llm4s/core/safety/NetworkSecurity.scala:253 — modules/core/src/main/scala/org/llm4s/core/safety/NetworkSecurity.scala:253-265 | modules/core/src/main/scala/org/llm4s/core/safety/NetworkSecurity.scala:292-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/core/src/main/scala/org/llm4s/core/safety/NetworkSecurity.scala:253` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:391 — modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:391-403 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:189-200 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) REDACTED:420 — REDACTED:420-432 | REDACTED:383-394 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:420` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgSearchIndex.scala:408 — modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgSearchIndex.scala:408-420 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:415-426 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgSearchIndex.scala:408` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgSearchIndex.scala:423` calls `resource` and `modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:427` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12–13 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/embeddingsupport/EmbeddingExample.scala:252 — modules/samples/src/main/scala/org/llm4s/samples/embeddingsupport/EmbeddingExample.scala:252-264 | modules/samples/src/main/scala/org/llm4s/samples/embeddingsupport/EmbeddingExample.scala:284-295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/embeddingsupport/EmbeddingExample.scala:252` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×5
  • Duplicated block (12 lines × 2) modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:317 — modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:317-328 | modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala:323-334 — before extracting anything, compare `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala` and `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:531 — modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:531-542 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:334-345 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:531` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:333` calls `val`, `getOrElse` and `modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:530` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) REDACTED:327 — REDACTED:327-338 | REDACTED:282-293 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:327` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/basic/OllamaExample.scala:13 — modules/samples/src/main/scala/org/llm4s/samples/basic/OllamaExample.scala:13-24 | modules/samples/src/main/scala/org/llm4s/samples/basic/RetryCompletionExample.scala:25-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/basic/OllamaExample.scala:13` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:55 — modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:55-66 | modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:204-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:55` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×5
  • Duplicated block (11 lines × 2) modules/core/src/main/scala/org/llm4s/toolapi/SchemaDefinition.scala:93 — modules/core/src/main/scala/org/llm4s/toolapi/SchemaDefinition.scala:93-103 | modules/core/src/main/scala/org/llm4s/toolapi/SchemaDefinition.scala:154-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/core/src/main/scala/org/llm4s/toolapi/SchemaDefinition.scala:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQAPipeline.scala:61 — modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQAPipeline.scala:61-71 | modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQAPipeline.scala:85-95 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQAPipeline.scala:61` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/provider/OpenRouterProvider.scala:44 — modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/provider/OpenRouterProvider.scala:44-54 | modules/openai/src/main/scala/org/llm4s/llmconnect/provider/RequestyProvider.scala:42-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/basic/DeepSeekTestExample.scala:75 — modules/samples/src/main/scala/org/llm4s/samples/basic/DeepSeekTestExample.scala:75-85 | modules/samples/src/main/scala/org/llm4s/samples/basic/GeminiTestExample.scala:60-71 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/basic/DeepSeekTestExample.scala` and `modules/samples/src/main/scala/org/llm4s/samples/basic/GeminiTestExample.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/basic/DeepSeekTestExample.scala:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupProviderSelection.scala:96 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupProviderSelection.scala:96-106 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupProviderSelection.scala:117-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupProviderSelection.scala:96` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×5
  • Duplicated block (5 lines × 3) modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:687 — modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:687-691 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:412-421 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:378-382 — before extracting anything, compare `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala` and `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 279 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:687` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:289 — modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:289-293 | modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:339-343 | modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:411-415 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:289` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/BraveSearchTool.scala:68 — modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/BraveSearchTool.scala:68-72 | modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/BraveSearchTool.scala:117-121 | modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/BraveSearchTool.scala:140-144 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/BraveSearchTool.scala:68` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) modules/samples/src/main/scala/org/llm4s/samples/memory/BasicMemoryExample.scala:168 — modules/samples/src/main/scala/org/llm4s/samples/memory/BasicMemoryExample.scala:168-172 | modules/samples/src/main/scala/org/llm4s/samples/memory/BasicMemoryExample.scala:178-182 | modules/samples/src/main/scala/org/llm4s/samples/memory/BasicMemoryExample.scala:188-192 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/memory/BasicMemoryExample.scala:168` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) modules/samples/src/main/scala/org/llm4s/samples/memory/ConversationMemoryExample.scala:170 — modules/samples/src/main/scala/org/llm4s/samples/memory/ConversationMemoryExample.scala:170-174 | modules/samples/src/main/scala/org/llm4s/samples/memory/MemoryWithAgentExample.scala:79-83 | modules/samples/src/main/scala/org/llm4s/samples/memory/MemoryWithAgentExample.scala:87-91 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/memory/ConversationMemoryExample.scala:170` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/GroundingGuardrail.scala:162 — modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/GroundingGuardrail.scala:162-178 | modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/SourceAttributionGuardrail.scala:161-177 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/GroundingGuardrail.scala:162` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:192 — modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:192-208 | modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala:201-217 — before extracting anything, compare `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala` and `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:192` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/basic/BasicLLMCallingWithTrace.scala:40 — modules/samples/src/main/scala/org/llm4s/samples/basic/BasicLLMCallingWithTrace.scala:40-56 | modules/samples/src/main/scala/org/llm4s/samples/basic/EnhancedTracingExample.scala:61-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (17 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/basic/ParallelNamedProvidersExample.scala:22 — modules/samples/src/main/scala/org/llm4s/samples/basic/ParallelNamedProvidersExample.scala:22-38 | modules/samples/src/main/scala/org/llm4s/samples/basic/SerialNamedProvidersExample.scala:16-32 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×4
  • Duplicated block (15 lines × 2) modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/ContextRelevanceGuardrail.scala:101 — modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/ContextRelevanceGuardrail.scala:101-115 | modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/GroundingGuardrail.scala:88-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/ContextRelevanceGuardrail.scala:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) REDACTED:390 — REDACTED:390-404 | REDACTED:346-360 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/basic/DeepSeekTestExample.scala:120 — modules/samples/src/main/scala/org/llm4s/samples/basic/DeepSeekTestExample.scala:120-134 | modules/samples/src/main/scala/org/llm4s/samples/basic/GeminiTestExample.scala:114-128 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/basic/DeepSeekTestExample.scala` and `modules/samples/src/main/scala/org/llm4s/samples/basic/GeminiTestExample.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/basic/DeepSeekTestExample.scala:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/memory/SQLiteMemoryExample.scala:72 — modules/samples/src/main/scala/org/llm4s/samples/memory/SQLiteMemoryExample.scala:72-86 | modules/samples/src/main/scala/org/llm4s/samples/memory/VectorMemoryExample.scala:105-122 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/memory/SQLiteMemoryExample.scala:72` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
X18 · Disposal-pattern correctness · Disposable created and abandoned in the function that made it · ×4
  • Disposable created and abandoned in the function that made it modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/filesystem/ListDirectoryTool.scala:141 — `Files.list(…)` opens something that has to be given back — a file descriptor, a socket, a directory handle — and its only use reads `.iterator` through it and drops it, so this expression both creates the value and is the last place that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it: `Too many open files` under load, and on Windows a file that cannot be replaced or deleted while it is held. Open it with `scala.util.Using.resource(Files.list(…)) { r => … }`, which releases it on every path including a throw, or hold it and call `.close()` in a `finally`.
  • Disposable created and abandoned in the function that made it modules/rag/src/main/scala/org/llm4s/rag/benchmark/DatasetManager.scala:83 — `scala.io.Source.fromFile(…)` opens something that has to be given back — a file descriptor, a socket, a directory handle — and its only use reads `.getLines` through it and drops it, so this expression both creates the value and is the last place that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it: `Too many open files` under load, and on Windows a file that cannot be replaced or deleted while it is held. Open it with `scala.util.Using.resource(scala.io.Source.fromFile(…)) { r => … }`, which releases it on every path including a throw, or hold it and call `.close()` in a `finally`.
  • Disposable created and abandoned in the function that made it modules/rag/src/main/scala/org/llm4s/rag/benchmark/DatasetManager.scala:213 — `Files.walk(…)` opens something that has to be given back — a file descriptor, a socket, a directory handle — and its only use reads `.iterator` through it and drops it, so this expression both creates the value and is the last place that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it: `Too many open files` under load, and on Windows a file that cannot be replaced or deleted while it is held. Open it with `scala.util.Using.resource(Files.walk(…)) { r => … }`, which releases it on every path including a throw, or hold it and call `.close()` in a `finally`.
  • Disposable created and abandoned in the function that made it modules/rag/src/main/scala/org/llm4s/rag/benchmark/DatasetManager.scala:244 — `scala.io.Source.fromFile(…)` opens something that has to be given back — a file descriptor, a socket, a directory handle — and its only use reads `.getLines` through it and drops it, so this expression both creates the value and is the last place that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it: `Too many open files` under load, and on Windows a file that cannot be replaced or deleted while it is held. Open it with `scala.util.Using.resource(scala.io.Source.fromFile(…)) { r => … }`, which releases it on every path including a throw, or hold it and call `.close()` in a `finally`.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×3
  • Duplicated block (22 lines × 2) modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:247 — modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:247-268 | modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala:253-274 — before extracting anything, compare `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala` and `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:161 — modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:161-182 | modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:513-534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:161` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteKeywordIndex.scala:110 — modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteKeywordIndex.scala:110-131 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteKeywordIndex.scala:144-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteKeywordIndex.scala:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×3
  • Duplicated block (20 lines × 2) modules/core/src/main/scala/org/llm4s/llmconnect/EmbeddingClient.scala:37 — modules/core/src/main/scala/org/llm4s/llmconnect/EmbeddingClient.scala:37-56 | modules/core/src/main/scala/org/llm4s/llmconnect/EmbeddingClient.scala:78-97 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/core/src/main/scala/org/llm4s/llmconnect/EmbeddingClient.scala:37` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:108 — modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:108-127 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:141-160 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:108` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (20 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:255 — modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:255-274 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:361-380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:255` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×3
  • Duplicated block (14 lines × 3) modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:378 — modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:378-391 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:471-484 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:506-519 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:378` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:43 — modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:43-56 | modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:103-116 | modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:158-171 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:43` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:309 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:309-322 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala:243-256 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupRenderSupport.scala:169-182 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×3
  • Duplicated block (10–11 lines × 2) modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:275 — modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:275-285 | modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:311-320 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:275` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala:261 — modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala:261-271 | modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala:319-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala:261` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupSetupViewSupport.scala:130 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupSetupViewSupport.scala:130-139 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupSetupViewSupport.scala:259-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupSetupViewSupport.scala:130` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×3
  • Duplicated block (9 lines × 3) modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:320 — modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:320-328 | modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:447-455 | modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:528-536 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:320` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:122 — modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:122-130 | modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:185-193 | modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:345-353 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:122` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupCompare.scala:58 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupCompare.scala:58-66 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupProviderSelection.scala:100-108 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupProviderSelection.scala:121-129 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupCompare.scala:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×2
  • Duplicated block (25 lines × 2) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/GraphJsonParser.scala:70 — modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/GraphJsonParser.scala:70-94 | modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/JsonGraphStore.scala:244-268 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (25 lines × 2) modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextPrecision.scala:50 — modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextPrecision.scala:50-74 | modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextRecall.scala:49-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextPrecision.scala:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–22 lines × 2) · ×2
  • Duplicated block (19–22 lines × 2) modules/rag/src/main/scala/org/llm4s/rag/loader/UrlLoader.scala:106 — modules/rag/src/main/scala/org/llm4s/rag/loader/UrlLoader.scala:106-124 | modules/rag/src/main/scala/org/llm4s/rag/loader/WebCrawlerLoader.scala:233-254 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/rag/loader/UrlLoader.scala:106` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19–22 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:141 — modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:141-159 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:185-206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:184` calls `max` and `modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:139` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×2
  • Duplicated block (14 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:239 — modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:239-252 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:288-301 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:236` calls `deleteBatch`, `Seq` and `modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:285` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/ContextRelevanceGuardrail.scala:212 — modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/ContextRelevanceGuardrail.scala:212-225 | modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/GroundingGuardrail.scala:204-222 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:147 — modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:147-157 | modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:150-160 | modules/agent/src/main/scala/org/llm4s/agent/graph/Checkpointer.scala:455-465 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:147` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 3) modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:330 — modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:330-342 | modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala:336-348 | modules/image/src/main/scala/org/llm4s/imageprocessing/provider/geminiclient/GeminiVisionClient.scala:276-286 — before extracting anything, compare `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala` and `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×2
  • Duplicated block (8–9 lines × 2) modules/memory/src/main/scala/org/llm4s/agent/memory/EmbeddingService.scala:182 — modules/memory/src/main/scala/org/llm4s/agent/memory/EmbeddingService.scala:182-190 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:539-546 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8–9 lines × 2) modules/providers/cohere/src/main/scala/org/llm4s/llmconnect/provider/CohereEmbeddingProvider.scala:238 — modules/providers/cohere/src/main/scala/org/llm4s/llmconnect/provider/CohereEmbeddingProvider.scala:238-245 | modules/providers/jina/src/main/scala/org/llm4s/llmconnect/provider/JinaEmbeddingProvider.scala:215-223 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/providers/cohere/src/main/scala/org/llm4s/llmconnect/provider/CohereEmbeddingProvider.scala:238` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:839 — modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:839-847 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:546-554 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:483-491 | modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala:712-720 — before extracting anything, compare `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala` and `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 279 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 4) modules/core/src/main/scala/org/llm4s/trace/ConsoleTracing.scala:209 — modules/core/src/main/scala/org/llm4s/trace/ConsoleTracing.scala:209-217 | modules/core/src/main/scala/org/llm4s/trace/Tracing.scala:233-241 | modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala:584-592 | modules/trace-opentelemetry/src/main/scala/org/llm4s/trace/OpenTelemetryTracing.scala:331-339 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:195 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:195-215 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala:129-149 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:77 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:77-97 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupDemoView.scala:91-111 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupDemoView.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:77` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
X13 · Undrained process stream · Redirected process stream is never drained (deadlock) · ×2
  • Redirected process stream is never drained (deadlock) modules/workspace/workspaceClient/src/main/scala/org/llm4s/workspace/ContainerisedWorkspace.scala:342 — The JDK pipes both `stdout` and `stderr` of a child started this way — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and here `process.getErrorStream` (stderr) is read while the child's end is awaited, but nothing in this scope ever reads `process.getInputStream` (stdout). The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds to stdout (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the `waitFor` or end of stream this code waits on never comes. Nothing fails loudly: the thread hangs and the stuck child holds its resources until something kills it. Read both streams (a thread or `Future` per stream), merge them with `redirectErrorStream(true)` before `start()`, discard the unwanted one with `redirectError(ProcessBuilder.Redirect.DISCARD)` (or `redirectOutput`), or use `scala.sys.process`, which pumps both.
  • Redirected process stream is never drained (deadlock) modules/workspace/workspaceClient/src/main/scala/org/llm4s/workspace/ContainerisedWorkspace.scala:354 — The JDK pipes both `stdout` and `stderr` of a child started this way — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and here `process.getErrorStream` (stderr) is read while the child's end is awaited, but nothing in this scope ever reads `process.getInputStream` (stdout). The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds to stdout (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the `waitFor` or end of stream this code waits on never comes. Nothing fails loudly: the thread hangs and the stuck child holds its resources until something kills it. Read both streams (a thread or `Future` per stream), merge them with `redirectErrorStream(true)` before `start()`, discard the unwanted one with `redirectError(ProcessBuilder.Redirect.DISCARD)` (or `redirectOutput`), or use `scala.sys.process`, which pumps both.
D1 · Cyclomatic Complexity · Redaction.pythonValues (cyclomatic 144) · ×1
  • Redaction.pythonValues (cyclomatic 144) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1046 — Redaction.pythonValues has cyclomatic complexity 144 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · Redaction.redactLeaves (cyclomatic 113) · ×1
  • Redaction.redactLeaves (cyclomatic 113) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3460 — Redaction.redactLeaves has cyclomatic complexity 113 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · ToolLoop.implement (cyclomatic 62) · ×1
  • ToolLoop.implement (cyclomatic 62) modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:1275 — ToolLoop.implement has cyclomatic complexity 62 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · Redaction.urlUserinfoPasswords (cyclomatic 44) · ×1
  • Redaction.urlUserinfoPasswords (cyclomatic 44) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:778 — Redaction.urlUserinfoPasswords has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · Redaction.withSingularKeys (cyclomatic 42) · ×1
  • Redaction.withSingularKeys (cyclomatic 42) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:905 — Redaction.withSingularKeys has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · AnthropicClient.streamComplete (cyclomatic 37) · ×1
  • AnthropicClient.streamComplete (cyclomatic 37) modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:272 — AnthropicClient.streamComplete has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Redaction.queryValue (cyclomatic 37) · ×1
  • Redaction.queryValue (cyclomatic 37) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2784 — Redaction.queryValue has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · WorkspaceAgentInterfaceImpl.writeFile (cyclomatic 37) · ×1
  • WorkspaceAgentInterfaceImpl.writeFile (cyclomatic 37) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:830 — WorkspaceAgentInterfaceImpl.writeFile has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Redaction.redactQuoted (cyclomatic 35) · ×1
  • Redaction.redactQuoted (cyclomatic 35) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3196 — Redaction.redactQuoted has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · ToolLoop.assemble (cyclomatic 31) · ×1
  • ToolLoop.assemble (cyclomatic 31) modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:1104 — ToolLoop.assemble has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Redaction.redactEqualsPairs (cyclomatic 31) · ×1
  • Redaction.redactEqualsPairs (cyclomatic 31) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3821 — Redaction.redactEqualsPairs has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · WebSocketCommandExecutor.stream (cyclomatic 31) · ×1
  • WebSocketCommandExecutor.stream (cyclomatic 31) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala:157 — WebSocketCommandExecutor.stream has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CalculatorTool.calculate (cyclomatic 29) · ×1
  • CalculatorTool.calculate (cyclomatic 29) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/core/CalculatorTool.scala:88 — CalculatorTool.calculate has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Redaction.escapedQuotedValues (cyclomatic 29) · ×1
  • Redaction.escapedQuotedValues (cyclomatic 29) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1603 — Redaction.escapedQuotedValues has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · SubsetValidator.unsupportedAt (cyclomatic 26) · ×1
  • SubsetValidator.unsupportedAt (cyclomatic 26) modules/agent/src/main/scala/org/llm4s/agent/graph/tool/ToolArgumentValidator.scala:69 — SubsetValidator.unsupportedAt has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · StreamableHTTPTransportImpl.readSSEResponse (cyclomatic 26) · ×1
  • StreamableHTTPTransportImpl.readSSEResponse (cyclomatic 26) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:264 — StreamableHTTPTransportImpl.readSSEResponse has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CommandPolicy.parseOptions (cyclomatic 26) · ×1
  • CommandPolicy.parseOptions (cyclomatic 26) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1273 — CommandPolicy.parseOptions has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Run.loop (cyclomatic 25) · ×1
  • Run.loop (cyclomatic 25) modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3228 — Run.loop has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Skill.fromFields (cyclomatic 25) · ×1
  • Skill.fromFields (cyclomatic 25) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala:93 — Skill.fromFields has cyclomatic complexity 25 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · Frontmatter.flowList (cyclomatic 25) · ×1
  • Frontmatter.flowList (cyclomatic 25) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala:470 — Frontmatter.flowList has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Redaction.cookieValueEnd (cyclomatic 25) · ×1
  • Redaction.cookieValueEnd (cyclomatic 25) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2468 — Redaction.cookieValueEnd has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · TraceModelJson.parseSpan (cyclomatic 25) · ×1
  • TraceModelJson.parseSpan (cyclomatic 25) modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:314 — TraceModelJson.parseSpan has cyclomatic complexity 25 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · Redaction.quoteSafeParts (cyclomatic 24) · ×1
  • Redaction.quoteSafeParts (cyclomatic 24) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1505 — Redaction.quoteSafeParts has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · Redaction.ampTailEdits (cyclomatic 23) · ×1
  • Redaction.ampTailEdits (cyclomatic 23) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1711 — Redaction.ampTailEdits has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · CommandPolicy.cpDestinationRefusal (cyclomatic 23) · ×1
  • CommandPolicy.cpDestinationRefusal (cyclomatic 23) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1721 — CommandPolicy.cpDestinationRefusal has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Frontmatter.quotedAt (cyclomatic 21) · ×1
  • Frontmatter.quotedAt (cyclomatic 21) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala:427 — Frontmatter.quotedAt has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Redaction.addedReadingEdits (cyclomatic 21) · ×1
  • Redaction.addedReadingEdits (cyclomatic 21) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:695 — Redaction.addedReadingEdits has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · Redaction.escapedQueryParamValues (cyclomatic 21) · ×1
  • Redaction.escapedQueryParamValues (cyclomatic 21) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2616 — Redaction.escapedQueryParamValues has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · TraceCollectorTracing.eventToSpan (cyclomatic 21) · ×1
  • TraceCollectorTracing.eventToSpan (cyclomatic 21) modules/observability/src/main/scala/org/llm4s/trace/TraceCollector.scala:94 — TraceCollectorTracing.eventToSpan has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · TraceModelJson.parseSpanValue (cyclomatic 21) · ×1
  • TraceModelJson.parseSpanValue (cyclomatic 21) modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:177 — TraceModelJson.parseSpanValue has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · CommandPolicy.sequenceRefusal (cyclomatic 21) · ×1
  • CommandPolicy.sequenceRefusal (cyclomatic 21) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:2098 — CommandPolicy.sequenceRefusal has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Frontmatter.fields (cyclomatic 20) · ×1
  • Frontmatter.fields (cyclomatic 20) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala:253 — Frontmatter.fields has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · WorkspaceAgentInterfaceImpl.applyOperations (cyclomatic 20) · ×1
  • WorkspaceAgentInterfaceImpl.applyOperations (cyclomatic 20) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:1253 — WorkspaceAgentInterfaceImpl.applyOperations has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Pipeline.outcome (cyclomatic 19) · ×1
  • Pipeline.outcome (cyclomatic 19) modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:2365 — Pipeline.outcome has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · HostFileBackend.openWith (cyclomatic 19) · ×1
  • HostFileBackend.openWith (cyclomatic 19) modules/agent/src/main/scala/org/llm4s/agent/harness/HostFileBackend.scala:758 — HostFileBackend.openWith has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · PostgresMemoryStore.filterToSql (cyclomatic 19) · ×1
  • PostgresMemoryStore.filterToSql (cyclomatic 19) modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:699 — PostgresMemoryStore.filterToSql has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · BedrockClient.runStream (cyclomatic 19) · ×1
  • BedrockClient.runStream (cyclomatic 19) modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/provider/BedrockClient.scala:257 — BedrockClient.runStream has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · RAG.sync (cyclomatic 19) · ×1
  • RAG.sync (cyclomatic 19) modules/rag/src/main/scala/org/llm4s/rag/RAG.scala:331 — RAG.sync has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · CommandPolicy.linkOperands (cyclomatic 19) · ×1
  • CommandPolicy.linkOperands (cyclomatic 19) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1899 — CommandPolicy.linkOperands has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · GitSandbox.driverOverrides (cyclomatic 19) · ×1
  • GitSandbox.driverOverrides (cyclomatic 19) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/GitSandbox.scala:210 — GitSandbox.driverOverrides has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · WorkspaceAgentInterfaceImpl.fileSnapshot (cyclomatic 19) · ×1
  • WorkspaceAgentInterfaceImpl.fileSnapshot (cyclomatic 19) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:1120 — WorkspaceAgentInterfaceImpl.fileSnapshot has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HTTPTool.followRedirects (cyclomatic 18) · ×1
  • HTTPTool.followRedirects (cyclomatic 18) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/http/HTTPTool.scala:318 — HTTPTool.followRedirects has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Redaction.scanQuotedValue (cyclomatic 18) · ×1
  • Redaction.scanQuotedValue (cyclomatic 18) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3080 — Redaction.scanQuotedValue has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · Redaction.endsString (cyclomatic 18) · ×1
  • Redaction.endsString (cyclomatic 18) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3145 — Redaction.endsString has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · StreamableHTTPTransportImpl.handleResponse (cyclomatic 18) · ×1
  • StreamableHTTPTransportImpl.handleResponse (cyclomatic 18) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:155 — StreamableHTTPTransportImpl.handleResponse has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OllamaClient.stream (cyclomatic 18) · ×1
  • OllamaClient.stream (cyclomatic 18) modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaClient.scala:191 — OllamaClient.stream has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SchemaMacros.checkImpl (cyclomatic 18) · ×1
  • SchemaMacros.checkImpl (cyclomatic 18) modules/schema-derivation/src/main/scala/org/llm4s/schema/SchemaMacros.scala:76 — SchemaMacros.checkImpl has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorkspaceAgentInterfaceImpl.commitStaged (cyclomatic 18) · ×1
  • WorkspaceAgentInterfaceImpl.commitStaged (cyclomatic 18) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:690 — WorkspaceAgentInterfaceImpl.commitStaged has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · WorkspaceAgentInterfaceImpl.prepareCommandOrThrow (cyclomatic 18) · ×1
  • WorkspaceAgentInterfaceImpl.prepareCommandOrThrow (cyclomatic 18) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:1676 — WorkspaceAgentInterfaceImpl.prepareCommandOrThrow has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CommandTokenizer.tokenize (cyclomatic 17) · ×1
  • CommandTokenizer.tokenize (cyclomatic 17) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/shell/CommandTokenizer.scala:27 — CommandTokenizer.tokenize has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Kept.of (cyclomatic 17) · ×1
  • Kept.of (cyclomatic 17) modules/agent/src/main/scala/org/llm4s/agent/harness/HostFileBackend.scala:1208 — Kept.of has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · HarnessConfigLoader.read (cyclomatic 17) · ×1
  • HarnessConfigLoader.read (cyclomatic 17) modules/agent/src/main/scala/org/llm4s/config/HarnessConfigLoader.scala:72 — HarnessConfigLoader.read has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · StdioTransportImpl.sendRequest (cyclomatic 17) · ×1
  • StdioTransportImpl.sendRequest (cyclomatic 17) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:1080 — StdioTransportImpl.sendRequest has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SQLiteMemoryStore.leafSql (cyclomatic 17) · ×1
  • SQLiteMemoryStore.leafSql (cyclomatic 17) REDACTED:470 — SQLiteMemoryStore.leafSql has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · RAG.syncDocumentsAsync (cyclomatic 17) · ×1
  • RAG.syncDocumentsAsync (cyclomatic 17) modules/rag/src/main/scala/org/llm4s/rag/RAG.scala:666 — RAG.syncDocumentsAsync has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · CommandPolicy.windowsFormRefusal (cyclomatic 17) · ×1
  • CommandPolicy.windowsFormRefusal (cyclomatic 17) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:514 — CommandPolicy.windowsFormRefusal has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CommandPolicy.sortCandidates (cyclomatic 17) · ×1
  • CommandPolicy.sortCandidates (cyclomatic 17) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1387 — CommandPolicy.sortCandidates has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Attempt.step (cyclomatic 16) · ×1
  • Attempt.step (cyclomatic 16) modules/agent/src/main/scala/org/llm4s/agent/delegation/ChildRunner.scala:362 — Attempt.step has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ReplayGuard.verifiable (cyclomatic 16) · ×1
  • ReplayGuard.verifiable (cyclomatic 16) modules/agent/src/main/scala/org/llm4s/agent/graph/EffectReplay.scala:395 — ReplayGuard.verifiable has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · Dispatcher.drain (cyclomatic 16) · ×1
  • Dispatcher.drain (cyclomatic 16) modules/agent/src/main/scala/org/llm4s/agent/graph/EventHub.scala:1180 — Dispatcher.drain has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SubsetValidator.satisfiability (cyclomatic 16) · ×1
  • SubsetValidator.satisfiability (cyclomatic 16) modules/agent/src/main/scala/org/llm4s/agent/graph/tool/ToolArgumentValidator.scala:128 — SubsetValidator.satisfiability has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AnthropicClient.addMessagesToParams (cyclomatic 16) · ×1
  • AnthropicClient.addMessagesToParams (cyclomatic 16) modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:522 — AnthropicClient.addMessagesToParams has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Redaction.redactEscapedQuoted (cyclomatic 16) · ×1
  • Redaction.redactEscapedQuoted (cyclomatic 16) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2974 — Redaction.redactEscapedQuoted has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · EnclosingQuotes.enclosingAt (cyclomatic 16) · ×1
  • EnclosingQuotes.enclosingAt (cyclomatic 16) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3313 — EnclosingQuotes.enclosingAt has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 17 of the 77 methods over the threshold — including the worst — and 402 of the 738 points over it (54%), 6× the next-largest file (modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala at 67). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · VertexAIClient.streamComplete (cyclomatic 16) · ×1
  • VertexAIClient.streamComplete (cyclomatic 16) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:144 — VertexAIClient.streamComplete has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · OpenAIImageClient.sizeToApiFormat (cyclomatic 16) · ×1
  • OpenAIImageClient.sizeToApiFormat (cyclomatic 16) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/OpenAIImageClient.scala:302 — OpenAIImageClient.sizeToApiFormat has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StableDiffusionClient.editImage (cyclomatic 16) · ×1
  • StableDiffusionClient.editImage (cyclomatic 16) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StableDiffusionClient.scala:143 — StableDiffusionClient.editImage has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · Stage.createLogicAndMaterializedValue (cyclomatic 16) · ×1
  • Stage.createLogicAndMaterializedValue (cyclomatic 16) modules/llm4s-pekko/src/main/scala/org/llm4s/pekko/BlockingSource.scala:112 — Stage.createLogicAndMaterializedValue has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MCPClientImpl.initialize (cyclomatic 16) · ×1
  • MCPClientImpl.initialize (cyclomatic 16) modules/mcp/src/main/scala/org/llm4s/mcp/MCPClientImpl.scala:135 — MCPClientImpl.initialize has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SSETransportImpl.sendRequest (cyclomatic 16) · ×1
  • SSETransportImpl.sendRequest (cyclomatic 16) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:485 — SSETransportImpl.sendRequest has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VectorMemoryStore.leafSql (cyclomatic 16) · ×1
  • VectorMemoryStore.leafSql (cyclomatic 16) REDACTED:551 — VectorMemoryStore.leafSql has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · TraceModelJson.parseTrace (cyclomatic 16) · ×1
  • TraceModelJson.parseTrace (cyclomatic 16) modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:386 — TraceModelJson.parseTrace has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · MarkdownChunker.groupSectionsIntoChunks (cyclomatic 16) · ×1
  • MarkdownChunker.groupSectionsIntoChunks (cyclomatic 16) modules/rag/src/main/scala/org/llm4s/chunking/MarkdownChunker.scala:161 — MarkdownChunker.groupSectionsIntoChunks has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RAG.ingestResultsAsync (cyclomatic 16) · ×1
  • RAG.ingestResultsAsync (cyclomatic 16) modules/rag/src/main/scala/org/llm4s/rag/RAG.scala:564 — RAG.ingestResultsAsync has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PgSearchIndex.filterToSql (cyclomatic 16) · ×1
  • PgSearchIndex.filterToSql (cyclomatic 16) modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgSearchIndex.scala:321 — PgSearchIndex.filterToSql has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CommandPolicy.indexedCandidates (cyclomatic 16) · ×1
  • CommandPolicy.indexedCandidates (cyclomatic 16) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1152 — CommandPolicy.indexedCandidates has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · WorkspaceAgentInterfaceImpl.searchFiles (cyclomatic 16) · ×1
  • WorkspaceAgentInterfaceImpl.searchFiles (cyclomatic 16) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:1355 — WorkspaceAgentInterfaceImpl.searchFiles has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D17 · Explicit Debt · TodoComment · ×1
  • TodoComment modules/core/src/main/scala/org/llm4s/config/Llm4sConfig.scala:330 — // TODO: As part of the wider Llm4sConfig cleanup, accept an optional ConfigSource — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D2 · Cognitive Complexity · Redaction.pythonValues (cognitive 251) · ×1
  • Redaction.pythonValues (cognitive 251) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1046 — Redaction.pythonValues has cognitive complexity 251 (threshold 15). Drivers by points: if/else 86 (161 pts), boolean chains 73, loops 13 (17 pts) (nesting depth added 79). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · TraceModelJson.parseSpan (cognitive 164) · ×1
  • TraceModelJson.parseSpan (cognitive 164) modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:314 — TraceModelJson.parseSpan has cognitive complexity 164 (threshold 15). Drivers by points: loops 14 (113 pts), match/switch 7 (46 pts), if/else 5 (nesting depth added 138). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Redaction.redactLeaves (cognitive 158) · ×1
  • Redaction.redactLeaves (cognitive 158) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3460 — Redaction.redactLeaves has cognitive complexity 158 (threshold 15). Drivers by points: if/else 50 (77 pts), boolean chains 60, loops 12 (19 pts), match/switch 2 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · ToolLoop.implement (cognitive 157) · ×1
  • ToolLoop.implement (cognitive 157) modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:1275 — ToolLoop.implement has cognitive complexity 157 (threshold 15). Drivers by points: loops 19 (82 pts), match/switch 13 (46 pts), if/else 19 (28 pts), boolean chains 1 (nesting depth added 105). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · HostFileBackend.openWith (cognitive 139) · ×1
  • HostFileBackend.openWith (cognitive 139) modules/agent/src/main/scala/org/llm4s/agent/harness/HostFileBackend.scala:758 — HostFileBackend.openWith has cognitive complexity 139 (threshold 15). Drivers by points: loops 14 (119 pts), match/switch 1 (15 pts), if/else 5 (nesting depth added 119). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Redaction.urlUserinfoPasswords (cognitive 135) · ×1
  • Redaction.urlUserinfoPasswords (cognitive 135) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:778 — Redaction.urlUserinfoPasswords has cognitive complexity 135 (threshold 15). Drivers by points: if/else 32 (115 pts), boolean chains 16, loops 2 (4 pts) (nesting depth added 85). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · HarnessConfigLoader.read (cognitive 118) · ×1
  • HarnessConfigLoader.read (cognitive 118) modules/agent/src/main/scala/org/llm4s/config/HarnessConfigLoader.scala:72 — HarnessConfigLoader.read has cognitive complexity 118 (threshold 15). Drivers by points: loops 16 (118 pts) (nesting depth added 102). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Redaction.withSingularKeys (cognitive 94) · ×1
  • Redaction.withSingularKeys (cognitive 94) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:905 — Redaction.withSingularKeys has cognitive complexity 94 (threshold 15). Drivers by points: if/else 23 (64 pts), boolean chains 21, loops 3 (9 pts) (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · Skill.fromFields (cognitive 69) · ×1
  • Skill.fromFields (cognitive 69) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala:93 — Skill.fromFields has cognitive complexity 69 (threshold 15). Drivers by points: loops 9 (45 pts), match/switch 3 (18 pts), if/else 5 (6 pts) (nesting depth added 52). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Redaction.redactEqualsPairs (cognitive 62) · ×1
  • Redaction.redactEqualsPairs (cognitive 62) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3821 — Redaction.redactEqualsPairs has cognitive complexity 62 (threshold 15). Drivers by points: if/else 24 (46 pts), boolean chains 14, loops 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · AnthropicClient.streamComplete (cognitive 60) · ×1
  • AnthropicClient.streamComplete (cognitive 60) modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:272 — AnthropicClient.streamComplete has cognitive complexity 60 (threshold 15). Drivers by points: if/else 22 (39 pts), boolean chains 14, match/switch 2 (7 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubsetValidator.unsupportedAt (cognitive 59) · ×1
  • SubsetValidator.unsupportedAt (cognitive 59) modules/agent/src/main/scala/org/llm4s/agent/graph/tool/ToolArgumentValidator.scala:69 — SubsetValidator.unsupportedAt has cognitive complexity 59 (threshold 15). Drivers by points: match/switch 10 (36 pts), if/else 14 (18 pts), boolean chains 5 (nesting depth added 30). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ToolLoop.assemble (cognitive 59) · ×1
  • ToolLoop.assemble (cognitive 59) modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:1104 — ToolLoop.assemble has cognitive complexity 59 (threshold 15). Drivers by points: loops 8 (21 pts), match/switch 6 (20 pts), if/else 8 (18 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Redaction.queryValue (cognitive 57) · ×1
  • Redaction.queryValue (cognitive 57) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2784 — Redaction.queryValue has cognitive complexity 57 (threshold 15). Drivers by points: if/else 27 (37 pts), boolean chains 17, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · TraceModelJson.parseTrace (cognitive 55) · ×1
  • TraceModelJson.parseTrace (cognitive 55) modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:386 — TraceModelJson.parseTrace has cognitive complexity 55 (threshold 15). Drivers by points: loops 6 (27 pts), match/switch 6 (24 pts), if/else 4 (nesting depth added 39). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · JevResponse.parseAnswer (cognitive 55) · ×1
  • JevResponse.parseAnswer (cognitive 55) modules/providers/jev/src/main/scala/org/llm4s/jev/JevResponse.scala:101 — JevResponse.parseAnswer has cognitive complexity 55 (threshold 15). Drivers by points: loops 8 (36 pts), if/else 5 (16 pts), match/switch 1 (3 pts) (nesting depth added 41). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · StableDiffusionClient.editImage (cognitive 54) · ×1
  • StableDiffusionClient.editImage (cognitive 54) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/StableDiffusionClient.scala:143 — StableDiffusionClient.editImage has cognitive complexity 54 (threshold 15). Drivers by points: loops 9 (45 pts), match/switch 2 (8 pts), boolean chains 1 (nesting depth added 42). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · TypedAgent.bindUnder (cognitive 52) · ×1
  • TypedAgent.bindUnder (cognitive 52) modules/agent/src/main/scala/org/llm4s/agent/delegation/TypedAgent.scala:172 — TypedAgent.bindUnder has cognitive complexity 52 (threshold 15). Drivers by points: loops 7 (28 pts), if/else 7 (22 pts), boolean chains 2 (nesting depth added 36). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · JevResponse.parseScore (cognitive 51) · ×1
  • JevResponse.parseScore (cognitive 51) modules/providers/jev/src/main/scala/org/llm4s/jev/JevResponse.scala:164 — JevResponse.parseScore has cognitive complexity 51 (threshold 15). Drivers by points: loops 9 (37 pts), if/else 4 (13 pts), boolean chains 1 (nesting depth added 37). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · StreamableHTTPTransportImpl.readSSEResponse (cognitive 49) · ×1
  • StreamableHTTPTransportImpl.readSSEResponse (cognitive 49) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:264 — StreamableHTTPTransportImpl.readSSEResponse has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (39 pts), match/switch 4 (8 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OllamaClient.stream (cognitive 49) · ×1
  • OllamaClient.stream (cognitive 49) modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaClient.scala:191 — OllamaClient.stream has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (42 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 29). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Frontmatter.flowList (cognitive 47) · ×1
  • Frontmatter.flowList (cognitive 47) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala:470 — Frontmatter.flowList has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 7, loops 3 (6 pts), match/switch 2 (6 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAIImageClient.editImage (cognitive 47) · ×1
  • OpenAIImageClient.editImage (cognitive 47) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/OpenAIImageClient.scala:59 — OpenAIImageClient.editImage has cognitive complexity 47 (threshold 15). Drivers by points: loops 9 (45 pts), if/else 2 (nesting depth added 36). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · WebSocketCommandExecutor.stream (cognitive 47) · ×1
  • WebSocketCommandExecutor.stream (cognitive 47) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala:157 — WebSocketCommandExecutor.stream has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 4, error handling 3, match/switch 2 (3 pts), loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseMemoryManagerOps.stats (cognitive 46) · ×1
  • BaseMemoryManagerOps.stats (cognitive 46) modules/memory/src/main/scala/org/llm4s/agent/memory/BaseMemoryManagerOps.scala:194 — BaseMemoryManagerOps.stats has cognitive complexity 46 (threshold 15). Drivers by points: loops 7 (28 pts), if/else 4 (18 pts) (nesting depth added 35). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · AgentBuilder.build (cognitive 45) · ×1
  • AgentBuilder.build (cognitive 45) modules/agent/src/main/scala/org/llm4s/agent/AgentBuilder.scala:249 — AgentBuilder.build has cognitive complexity 45 (threshold 15). Drivers by points: loops 9 (45 pts) (nesting depth added 36). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Redaction.redactQuoted (cognitive 45) · ×1
  • Redaction.redactQuoted (cognitive 45) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3196 — Redaction.redactQuoted has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 20, loops 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · Redaction.escapedQuotedValues (cognitive 43) · ×1
  • Redaction.escapedQuotedValues (cognitive 43) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1603 — Redaction.escapedQuotedValues has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 15, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · Redaction.scanQuotedValue (cognitive 41) · ×1
  • Redaction.scanQuotedValue (cognitive 41) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3080 — Redaction.scanQuotedValue has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 4, loops 1 (4 pts), match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · Redaction.ampTailEdits (cognitive 40) · ×1
  • Redaction.ampTailEdits (cognitive 40) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1711 — Redaction.ampTailEdits has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · VertexAIClient.streamComplete (cognitive 40) · ×1
  • VertexAIClient.streamComplete (cognitive 40) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:144 — VertexAIClient.streamComplete has cognitive complexity 40 (threshold 15). Drivers by points: loops 5 (24 pts), if/else 2 (7 pts), match/switch 2 (7 pts), boolean chains 2 (nesting depth added 29). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · WorkspaceAgentInterfaceImpl.writeFile (cognitive 40) · ×1
  • WorkspaceAgentInterfaceImpl.writeFile (cognitive 40) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:830 — WorkspaceAgentInterfaceImpl.writeFile has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (25 pts), match/switch 7 (10 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · StdioTransportImpl.sendRequest (cognitive 39) · ×1
  • StdioTransportImpl.sendRequest (cognitive 39) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:1080 — StdioTransportImpl.sendRequest has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 4 (15 pts), error handling 2 (4 pts) (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GraphRuntime.updateState (cognitive 38) · ×1
  • GraphRuntime.updateState (cognitive 38) modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:1531 — GraphRuntime.updateState has cognitive complexity 38 (threshold 15). Drivers by points: loops 7 (35 pts), match/switch 2, if/else 1 (nesting depth added 28). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Frontmatter.fields (cognitive 38) · ×1
  • Frontmatter.fields (cognitive 38) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala:253 — Frontmatter.fields has cognitive complexity 38 (threshold 15). Drivers by points: match/switch 5 (22 pts), if/else 7 (13 pts), boolean chains 3 (nesting depth added 23). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · WatsonXConfig.fromValues (cognitive 38) · ×1
  • WatsonXConfig.fromValues (cognitive 38) modules/providers/watsonx/src/main/scala/org/llm4s/llmconnect/config/WatsonXConfig.scala:94 — WatsonXConfig.fromValues has cognitive complexity 38 (threshold 15). Drivers by points: loops 8 (36 pts), boolean chains 2 (nesting depth added 28). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · CommandPolicy.parseOptions (cognitive 38) · ×1
  • CommandPolicy.parseOptions (cognitive 38) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1273 — CommandPolicy.parseOptions has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 11, match/switch 2 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommandPolicy.sequenceRefusal (cognitive 38) · ×1
  • CommandPolicy.sequenceRefusal (cognitive 38) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:2098 — CommandPolicy.sequenceRefusal has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 4 (10 pts), boolean chains 9 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Redaction.quoteSafeParts (cognitive 37) · ×1
  • Redaction.quoteSafeParts (cognitive 37) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1505 — Redaction.quoteSafeParts has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 9, loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · JevRequest.validate (cognitive 37) · ×1
  • JevRequest.validate (cognitive 37) modules/providers/jev/src/main/scala/org/llm4s/jev/JevRequest.scala:72 — JevRequest.validate has cognitive complexity 37 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 6 (11 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 22). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · NamedProviderConfigValidator.validate (cognitive 36) · ×1
  • NamedProviderConfigValidator.validate (cognitive 36) modules/core/src/main/scala/org/llm4s/config/NamedProviderValidator.scala:282 — NamedProviderConfigValidator.validate has cognitive complexity 36 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 4 (13 pts), boolean chains 2 (nesting depth added 24). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · MarkdownChunker.parseMarkdownSections (cognitive 36) · ×1
  • MarkdownChunker.parseMarkdownSections (cognitive 36) modules/rag/src/main/scala/org/llm4s/chunking/MarkdownChunker.scala:59 — MarkdownChunker.parseMarkdownSections has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (27 pts), match/switch 2 (7 pts), boolean chains 1, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HTTPTool.followRedirects (cognitive 35) · ×1
  • HTTPTool.followRedirects (cognitive 35) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/http/HTTPTool.scala:318 — HTTPTool.followRedirects has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 6, match/switch 1 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReplayGuard.verifiable (cognitive 35) · ×1
  • ReplayGuard.verifiable (cognitive 35) modules/agent/src/main/scala/org/llm4s/agent/graph/EffectReplay.scala:395 — ReplayGuard.verifiable has cognitive complexity 35 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 6 (10 pts), match/switch 3 (4 pts) (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Run.loop (cognitive 35) · ×1
  • Run.loop (cognitive 35) modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3228 — Run.loop has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 6 (22 pts), if/else 8 (11 pts), boolean chains 2 (nesting depth added 19). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DocumentText.read (cognitive 35) · ×1
  • DocumentText.read (cognitive 35) modules/agent/src/main/scala/org/llm4s/agent/harness/RunDocuments.scala:177 — DocumentText.read has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 1 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · NetworkSecurity.validateUrl (cognitive 35) · ×1
  • NetworkSecurity.validateUrl (cognitive 35) modules/core/src/main/scala/org/llm4s/core/safety/NetworkSecurity.scala:222 — NetworkSecurity.validateUrl has cognitive complexity 35 (threshold 15). Drivers by points: loops 7 (28 pts), match/switch 1 (7 pts) (nesting depth added 27). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Redaction.escapedQueryParamValues (cognitive 35) · ×1
  • Redaction.escapedQueryParamValues (cognitive 35) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2616 — Redaction.escapedQueryParamValues has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 5, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · Redaction.cookieValueEnd (cognitive 34) · ×1
  • Redaction.cookieValueEnd (cognitive 34) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2468 — Redaction.cookieValueEnd has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 12, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · GraphTraversal.bfs (cognitive 34) · ×1
  • GraphTraversal.bfs (cognitive 34) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/GraphTraversal.scala:12 — GraphTraversal.bfs has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 3 (11 pts), boolean chains 2 (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TraceModelJson.parseSpanEvent (cognitive 34) · ×1
  • TraceModelJson.parseSpanEvent (cognitive 34) modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:280 — TraceModelJson.parseSpanEvent has cognitive complexity 34 (threshold 15). Drivers by points: loops 5 (20 pts), match/switch 4 (10 pts), if/else 4 (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CommandPolicy.cpDestinationRefusal (cognitive 34) · ×1
  • CommandPolicy.cpDestinationRefusal (cognitive 34) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1721 — CommandPolicy.cpDestinationRefusal has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 6, loops 3 (6 pts), match/switch 2 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONTool.processJSON (cognitive 33) · ×1
  • JSONTool.processJSON (cognitive 33) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/core/JSONTool.scala:97 — JSONTool.processJSON has cognitive complexity 33 (threshold 15). Drivers by points: loops 4 (18 pts), match/switch 3 (10 pts), if/else 4 (5 pts) (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CostEstimator.estimateFromMetadata (cognitive 33) · ×1
  • CostEstimator.estimateFromMetadata (cognitive 33) modules/core/src/main/scala/org/llm4s/llmconnect/provider/CostEstimator.scala:56 — CostEstimator.estimateFromMetadata has cognitive complexity 33 (threshold 15). Drivers by points: loops 7 (26 pts), if/else 3, match/switch 2 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · TraceModelJson.parseSpanValue (cognitive 33) · ×1
  • TraceModelJson.parseSpanValue (cognitive 33) modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala:177 — TraceModelJson.parseSpanValue has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 9 (24 pts), if/else 9 (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SchemaGuidedExtractor.buildSchemaPrompt (cognitive 32) · ×1
  • SchemaGuidedExtractor.buildSchemaPrompt (cognitive 32) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/SchemaGuidedExtractor.scala:51 — SchemaGuidedExtractor.buildSchemaPrompt has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22 (32 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownChunker.groupSectionsIntoChunks (cognitive 32) · ×1
  • MarkdownChunker.groupSectionsIntoChunks (cognitive 32) modules/rag/src/main/scala/org/llm4s/chunking/MarkdownChunker.scala:161 — MarkdownChunker.groupSectionsIntoChunks has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceAgentInterfaceImpl.fileSnapshot (cognitive 32) · ×1
  • WorkspaceAgentInterfaceImpl.fileSnapshot (cognitive 32) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:1120 — WorkspaceAgentInterfaceImpl.fileSnapshot has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (27 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceAgentInterfaceImpl.searchFiles (cognitive 32) · ×1
  • WorkspaceAgentInterfaceImpl.searchFiles (cognitive 32) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:1355 — WorkspaceAgentInterfaceImpl.searchFiles has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JevConfig.validate (cognitive 31) · ×1
  • JevConfig.validate (cognitive 31) modules/providers/jev/src/main/scala/org/llm4s/jev/JevConfig.scala:62 — JevConfig.validate has cognitive complexity 31 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 4 (9 pts), boolean chains 1 (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ProcessRegistry.spawn (cognitive 31) · ×1
  • ProcessRegistry.spawn (cognitive 31) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/ProcessRegistry.scala:84 — ProcessRegistry.spawn has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceAgentInterfaceImpl.applyOperations (cognitive 31) · ×1
  • WorkspaceAgentInterfaceImpl.applyOperations (cognitive 31) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:1253 — WorkspaceAgentInterfaceImpl.applyOperations has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Redaction.addedReadingEdits (cognitive 30) · ×1
  • Redaction.addedReadingEdits (cognitive 30) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:695 — Redaction.addedReadingEdits has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · GeminiClient.streamComplete (cognitive 30) · ×1
  • GeminiClient.streamComplete (cognitive 30) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:143 — GeminiClient.streamComplete has cognitive complexity 30 (threshold 15). Drivers by points: loops 3 (18 pts), if/else 2 (5 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ProviderModelListers.openAICompatible (cognitive 30) · ×1
  • ProviderModelListers.openAICompatible (cognitive 30) modules/openai-compatible/src/main/scala/org/llm4s/config/ProviderModelListers.scala:45 — ProviderModelListers.openAICompatible has cognitive complexity 30 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 4 (8 pts), boolean chains 1 (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · WorkspaceSandboxConfig.validate (cognitive 30) · ×1
  • WorkspaceSandboxConfig.validate (cognitive 30) modules/workspace/workspaceShared/src/main/scala/org/llm4s/shared/WorkspaceSandboxConfig.scala:467 — WorkspaceSandboxConfig.validate has cognitive complexity 30 (threshold 15). Drivers by points: loops 7 (28 pts), if/else 2 (nesting depth added 21). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · BuiltinTools.customSafe (cognitive 29) · ×1
  • BuiltinTools.customSafe (cognitive 29) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/BuiltinTools.scala:144 — BuiltinTools.customSafe has cognitive complexity 29 (threshold 15). Drivers by points: loops 8 (27 pts), match/switch 2 (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · CommandTokenizer.tokenize (cognitive 29) · ×1
  • CommandTokenizer.tokenize (cognitive 29) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/shell/CommandTokenizer.scala:27 — CommandTokenizer.tokenize has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (23 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Frontmatter.quotedAt (cognitive 29) · ×1
  • Frontmatter.quotedAt (cognitive 29) modules/agent/src/main/scala/org/llm4s/agent/harness/Skill.scala:427 — Frontmatter.quotedAt has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 5, match/switch 1 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuiltinTools.developmentSafe (cognitive 28) · ×1
  • BuiltinTools.developmentSafe (cognitive 28) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/BuiltinTools.scala:111 — BuiltinTools.developmentSafe has cognitive complexity 28 (threshold 15). Drivers by points: loops 7 (28 pts) (nesting depth added 21). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ExaSearchTool.create (cognitive 28) · ×1
  • ExaSearchTool.create (cognitive 28) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/ExaSearchTool.scala:333 — ExaSearchTool.create has cognitive complexity 28 (threshold 15). Drivers by points: loops 7 (25 pts), match/switch 1 (3 pts) (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ClientBuilds.openAiCompatibleConfig (cognitive 28) · ×1
  • ClientBuilds.openAiCompatibleConfig (cognitive 28) modules/java-api/src/main/scala/org/llm4s/javaapi/ClientBuilds.scala:112 — ClientBuilds.openAiCompatibleConfig has cognitive complexity 28 (threshold 15). Drivers by points: loops 7 (28 pts) (nesting depth added 21). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (ClientBuilds.azureOpenAiConfig) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ClientBuilds.azureOpenAiConfig (cognitive 28) · ×1
  • ClientBuilds.azureOpenAiConfig (cognitive 28) modules/java-api/src/main/scala/org/llm4s/javaapi/ClientBuilds.scala:131 — ClientBuilds.azureOpenAiConfig has cognitive complexity 28 (threshold 15). Drivers by points: loops 7 (28 pts) (nesting depth added 21). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (ClientBuilds.openAiCompatibleConfig) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · MCPClientImpl.initialize (cognitive 28) · ×1
  • MCPClientImpl.initialize (cognitive 28) modules/mcp/src/main/scala/org/llm4s/mcp/MCPClientImpl.scala:135 — MCPClientImpl.initialize has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 4 (16 pts), if/else 6 (11 pts), boolean chains 1 (nesting depth added 17). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RobotsTxtParser.parseAll (cognitive 28) · ×1
  • RobotsTxtParser.parseAll (cognitive 28) modules/rag/src/main/scala/org/llm4s/rag/loader/internal/RobotsTxtParser.scala:216 — RobotsTxtParser.parseAll has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PgCollectionStore.updatePermissions (cognitive 28) · ×1
  • PgCollectionStore.updatePermissions (cognitive 28) modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:195 — PgCollectionStore.updatePermissions has cognitive complexity 28 (threshold 15). Drivers by points: loops 7 (25 pts), match/switch 1 (3 pts) (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · AnthropicModelLister.listAnthropicModels (cognitive 27) · ×1
  • AnthropicModelLister.listAnthropicModels (cognitive 27) modules/anthropic/src/main/scala/org/llm4s/config/AnthropicModelLister.scala:47 — AnthropicModelLister.listAnthropicModels has cognitive complexity 27 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 2 (6 pts), match/switch 1 (6 pts) (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · CodeGenExample.main (cognitive 27) · ×1
  • CodeGenExample.main (cognitive 27) modules/workspace/workspaceClient/src/main/scala/org/llm4s/codegen/CodeGenExample.scala:40 — CodeGenExample.main has cognitive complexity 27 (threshold 15). Drivers by points: loops 7 (26 pts), match/switch 1 (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · CompiledGraph.restoreTask (cognitive 26) · ×1
  • CompiledGraph.restoreTask (cognitive 26) modules/agent/src/main/scala/org/llm4s/agent/graph/CompiledGraph.scala:963 — CompiledGraph.restoreTask has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 3 (5 pts), match/switch 1 (5 pts), boolean chains 1 (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · SubsetValidator.satisfiability (cognitive 26) · ×1
  • SubsetValidator.satisfiability (cognitive 26) modules/agent/src/main/scala/org/llm4s/agent/graph/tool/ToolArgumentValidator.scala:128 — SubsetValidator.satisfiability has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 7 (12 pts), if/else 9 (10 pts), boolean chains 4 (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SSETransportImpl.sendRequest (cognitive 26) · ×1
  • SSETransportImpl.sendRequest (cognitive 26) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:485 — SSETransportImpl.sendRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 3 (8 pts), boolean chains 2 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SafeParameterExtractor.navigateToValue (cognitive 25) · ×1
  • SafeParameterExtractor.navigateToValue (cognitive 25) modules/core/src/main/scala/org/llm4s/toolapi/SafeParameterExtractor.scala:226 — SafeParameterExtractor.navigateToValue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 5 (9 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · StreamableHTTPTransportImpl.handleResponse (cognitive 25) · ×1
  • StreamableHTTPTransportImpl.handleResponse (cognitive 25) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:155 — StreamableHTTPTransportImpl.handleResponse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 4 (11 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GraphRAG.localSearch (cognitive 25) · ×1
  • GraphRAG.localSearch (cognitive 25) modules/rag/src/main/scala/org/llm4s/knowledgegraph/graphrag/GraphRAG.scala:164 — GraphRAG.localSearch has cognitive complexity 25 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 4 (9 pts), boolean chains 1 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · CrawlingIterator.openConnectionWithRedirects (cognitive 25) · ×1
  • CrawlingIterator.openConnectionWithRedirects (cognitive 25) modules/rag/src/main/scala/org/llm4s/rag/loader/WebCrawlerLoader.scala:215 — CrawlingIterator.openConnectionWithRedirects has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 5 (16 pts), if/else 5 (8 pts), boolean chains 1 (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CommandPolicy.linkOperands (cognitive 25) · ×1
  • CommandPolicy.linkOperands (cognitive 25) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1899 — CommandPolicy.linkOperands has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5, loops 2 (3 pts), match/switch 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ListDirectoryTool.listDirectory (cognitive 24) · ×1
  • ListDirectoryTool.listDirectory (cognitive 24) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/filesystem/ListDirectoryTool.scala:115 — ListDirectoryTool.listDirectory has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Redaction.redactEscapedQuoted (cognitive 24) · ×1
  • Redaction.redactEscapedQuoted (cognitive 24) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:2974 — Redaction.redactEscapedQuoted has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 6, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · RAG.ingestResults (cognitive 24) · ×1
  • RAG.ingestResults (cognitive 24) modules/rag/src/main/scala/org/llm4s/rag/RAG.scala:226 — RAG.ingestResults has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RAG.sync (cognitive 24) · ×1
  • RAG.sync (cognitive 24) modules/rag/src/main/scala/org/llm4s/rag/RAG.scala:331 — RAG.sync has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 5 (17 pts), if/else 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PgCollectionStore.create (cognitive 24) · ×1
  • PgCollectionStore.create (cognitive 24) modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:24 — PgCollectionStore.create has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (17 pts), if/else 2 (6 pts), match/switch 1 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · GitSandbox.driverOverrides (cognitive 24) · ×1
  • GitSandbox.driverOverrides (cognitive 24) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/GitSandbox.scala:210 — GitSandbox.driverOverrides has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 6 (9 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentRun.status (cognitive 23) · ×1
  • AgentRun.status (cognitive 23) modules/agent/src/main/scala/org/llm4s/agent/AgentRun.scala:244 — AgentRun.status has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (20 pts), match/switch 2 (3 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ReplayGuard.transactional (cognitive 23) · ×1
  • ReplayGuard.transactional (cognitive 23) modules/agent/src/main/scala/org/llm4s/agent/graph/EffectReplay.scala:352 — ReplayGuard.transactional has cognitive complexity 23 (threshold 15). Drivers by points: loops 7 (19 pts), match/switch 2 (3 pts), if/else 1 (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PermissionMiddleware.decide (cognitive 23) · ×1
  • PermissionMiddleware.decide (cognitive 23) modules/agent/src/main/scala/org/llm4s/agent/graph/middleware/PermissionMiddleware.scala:71 — PermissionMiddleware.decide has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 2 (4 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Doctor.localCheck (cognitive 23) · ×1
  • Doctor.localCheck (cognitive 23) modules/config-policy/src/main/scala/org/llm4s/configpolicy/Doctor.scala:380 — Doctor.localCheck has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 2 (4 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · MCPHandler.handleSSEPost (cognitive 23) · ×1
  • MCPHandler.handleSSEPost (cognitive 23) modules/mcp/src/main/scala/org/llm4s/mcp/MCPServer.scala:392 — MCPHandler.handleSSEPost has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 4 (11 pts), loops 2 (7 pts), if/else 2 (5 pts) (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · StdioTransportImpl.startReaderThread (cognitive 23) · ×1
  • StdioTransportImpl.startReaderThread (cognitive 23) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:946 — StdioTransportImpl.startReaderThread has cognitive complexity 23 (threshold 15). Drivers by points: error handling 3 (9 pts), if/else 4 (9 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownChunker.forceChunkText (cognitive 23) · ×1
  • MarkdownChunker.forceChunkText (cognitive 23) modules/rag/src/main/scala/org/llm4s/chunking/MarkdownChunker.scala:269 — MarkdownChunker.forceChunkText has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PgCollectionStore.delete (cognitive 23) · ×1
  • PgCollectionStore.delete (cognitive 23) modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:264 — PgCollectionStore.delete has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 4 (8 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PgCollectionStore.computeEffectivePermissions (cognitive 23) · ×1
  • PgCollectionStore.computeEffectivePermissions (cognitive 23) modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:299 — PgCollectionStore.computeEffectivePermissions has cognitive complexity 23 (threshold 15). Drivers by points: loops 3 (12 pts), if/else 4 (9 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · WorkspaceToolExample.main (cognitive 23) · ×1
  • WorkspaceToolExample.main (cognitive 23) modules/workspace/workspaceSamples/src/main/scala/org/llm4s/samples/toolapi/WorkspaceToolExample.scala:56 — WorkspaceToolExample.main has cognitive complexity 23 (threshold 15). Drivers by points: loops 3 (9 pts), match/switch 3 (8 pts), if/else 6 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadFileTool.readFile (cognitive 22) · ×1
  • ReadFileTool.readFile (cognitive 22) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/filesystem/ReadFileTool.scala:96 — ReadFileTool.readFile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 1 (5 pts), match/switch 2 (5 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · InMemoryLongTermStore.modifyChecked (cognitive 22) · ×1
  • InMemoryLongTermStore.modifyChecked (cognitive 22) modules/agent/src/main/scala/org/llm4s/agent/harness/LongTermStore.scala:312 — InMemoryLongTermStore.modifyChecked has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 5 (9 pts) (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SessionManager.saveSession (cognitive 22) · ×1
  • SessionManager.saveSession (cognitive 22) modules/agent/src/main/scala/org/llm4s/assistant/SessionManager.scala:92 — SessionManager.saveSession has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (20 pts), if/else 1, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SSEParser.parseEvent (cognitive 22) · ×1
  • SSEParser.parseEvent (cognitive 22) modules/core/src/main/scala/org/llm4s/llmconnect/streaming/SSEParser.scala:40 — SSEParser.parseEvent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Redaction.sequenceEdits (cognitive 22) · ×1
  • Redaction.sequenceEdits (cognitive 22) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1784 — Redaction.sequenceEdits has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · EnclosingQuotes.enclosingAt (cognitive 22) · ×1
  • EnclosingQuotes.enclosingAt (cognitive 22) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3313 — EnclosingQuotes.enclosingAt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 7, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · GraphQAPipeline.ask (cognitive 22) · ×1
  • GraphQAPipeline.ask (cognitive 22) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQAPipeline.scala:57 — GraphQAPipeline.ask has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 2 (7 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · GraphRanking.betweennessCentrality (cognitive 22) · ×1
  • GraphRanking.betweennessCentrality (cognitive 22) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphRanking.scala:131 — GraphRanking.betweennessCentrality has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (11 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MCPClientImpl.createMCPToolHandler (cognitive 22) · ×1
  • MCPClientImpl.createMCPToolHandler (cognitive 22) modules/mcp/src/main/scala/org/llm4s/mcp/MCPClientImpl.scala:395 — MCPClientImpl.createMCPToolHandler has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (10 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SentenceChunker.groupSentencesIntoChunks (cognitive 22) · ×1
  • SentenceChunker.groupSentencesIntoChunks (cognitive 22) modules/rag/src/main/scala/org/llm4s/chunking/SentenceChunker.scala:151 — SentenceChunker.groupSentencesIntoChunks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommandPolicy.windowsFormRefusal (cognitive 22) · ×1
  • CommandPolicy.windowsFormRefusal (cognitive 22) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:514 — CommandPolicy.windowsFormRefusal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PostgresCheckpointer.call (cognitive 21) · ×1
  • PostgresCheckpointer.call (cognitive 21) modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:445 — PostgresCheckpointer.call has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentBuilder.loopAgent (cognitive 21) · ×1
  • AgentBuilder.loopAgent (cognitive 21) modules/agent/src/main/scala/org/llm4s/agent/AgentBuilder.scala:422 — AgentBuilder.loopAgent has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Attempt.continued (cognitive 21) · ×1
  • Attempt.continued (cognitive 21) modules/agent/src/main/scala/org/llm4s/agent/delegation/ChildRunner.scala:546 — Attempt.continued has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (10 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Dispatcher.offerPair (cognitive 21) · ×1
  • Dispatcher.offerPair (cognitive 21) modules/agent/src/main/scala/org/llm4s/agent/graph/EventHub.scala:953 — Dispatcher.offerPair has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GraphRuntime.recoverOn (cognitive 21) · ×1
  • GraphRuntime.recoverOn (cognitive 21) modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:603 — GraphRuntime.recoverOn has cognitive complexity 21 (threshold 15). Drivers by points: loops 3 (12 pts), match/switch 3 (8 pts), if/else 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ToolLoop.prepare (cognitive 21) · ×1
  • ToolLoop.prepare (cognitive 21) modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:684 — ToolLoop.prepare has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (Pipeline.admission) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Pipeline.admission (cognitive 21) · ×1
  • Pipeline.admission (cognitive 21) modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:2041 — Pipeline.admission has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (ToolLoop.prepare) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · HarnessProfile.assembled (cognitive 21) · ×1
  • HarnessProfile.assembled (cognitive 21) modules/agent/src/main/scala/org/llm4s/agent/harness/HarnessProfile.scala:248 — HarnessProfile.assembled has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (HarnessProfile.checkedBeforeSandbox) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · HarnessProfile.checkedBeforeSandbox (cognitive 21) · ×1
  • HarnessProfile.checkedBeforeSandbox (cognitive 21) modules/agent/src/main/scala/org/llm4s/agent/harness/HarnessProfile.scala:264 — HarnessProfile.checkedBeforeSandbox has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (HarnessProfile.assembled) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · NamedProviderConfigNormalizer.normalize (cognitive 21) · ×1
  • NamedProviderConfigNormalizer.normalize (cognitive 21) modules/core/src/main/scala/org/llm4s/config/NamedProviderConfigNormalizer.scala:23 — NamedProviderConfigNormalizer.normalize has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 5 (11 pts), loops 4 (10 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TokenExchangeConfig.validate (cognitive 21) · ×1
  • TokenExchangeConfig.validate (cognitive 21) modules/core/src/main/scala/org/llm4s/llmconnect/auth/TokenExchange.scala:72 — TokenExchangeConfig.validate has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · GeminiModelLister.listGeminiModels (cognitive 21) · ×1
  • GeminiModelLister.listGeminiModels (cognitive 21) modules/gemini/src/main/scala/org/llm4s/config/GeminiModelLister.scala:35 — GeminiModelLister.listGeminiModels has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (15 pts), match/switch 1 (5 pts), if/else 1 (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · HuggingFaceClient.generateImages (cognitive 21) · ×1
  • HuggingFaceClient.generateImages (cognitive 21) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/HuggingFaceClient.scala:140 — HuggingFaceClient.generateImages has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · OpenAIImageClient.generateImages (cognitive 21) · ×1
  • OpenAIImageClient.generateImages (cognitive 21) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/OpenAIImageClient.scala:35 — OpenAIImageClient.generateImages has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ClientBuilds.openAiConfig (cognitive 21) · ×1
  • ClientBuilds.openAiConfig (cognitive 21) modules/java-api/src/main/scala/org/llm4s/javaapi/ClientBuilds.scala:59 — ClientBuilds.openAiConfig has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: 2 other methods here (ClientBuilds.anthropicConfig, ClientBuilds.geminiConfig) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ClientBuilds.anthropicConfig (cognitive 21) · ×1
  • ClientBuilds.anthropicConfig (cognitive 21) modules/java-api/src/main/scala/org/llm4s/javaapi/ClientBuilds.scala:74 — ClientBuilds.anthropicConfig has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: 2 other methods here (ClientBuilds.openAiConfig, ClientBuilds.geminiConfig) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ClientBuilds.geminiConfig (cognitive 21) · ×1
  • ClientBuilds.geminiConfig (cognitive 21) modules/java-api/src/main/scala/org/llm4s/javaapi/ClientBuilds.scala:85 — ClientBuilds.geminiConfig has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: 2 other methods here (ClientBuilds.openAiConfig, ClientBuilds.anthropicConfig) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · RagBuilds.build (cognitive 21) · ×1
  • RagBuilds.build (cognitive 21) modules/java-rag/src/main/scala/org/llm4s/javaapi/rag/RagBuilds.scala:25 — RagBuilds.build has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · GraphEngine.traverseDFS (cognitive 21) · ×1
  • GraphEngine.traverseDFS (cognitive 21) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/engine/GraphEngine.scala:89 — GraphEngine.traverseDFS has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatibleProvider.validatedConfig (cognitive 21) · ×1
  • OpenAICompatibleProvider.validatedConfig (cognitive 21) modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/provider/OpenAICompatibleProvider.scala:221 — OpenAICompatibleProvider.validatedConfig has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · RAG.assemble (cognitive 21) · ×1
  • RAG.assemble (cognitive 21) modules/rag/src/main/scala/org/llm4s/rag/RAG.scala:1514 — RAG.assemble has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 2 (6 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · OpenAITTSClient.synthesize (cognitive 21) · ×1
  • OpenAITTSClient.synthesize (cognitive 21) modules/speech/src/main/scala/org/llm4s/speech/tts/provider/OpenAITTSClient.scala:34 — OpenAITTSClient.synthesize has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · CommandPolicy.pathRefusal (cognitive 21) · ×1
  • CommandPolicy.pathRefusal (cognitive 21) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1093 — CommandPolicy.pathRefusal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WriteFileTool.writeFile (cognitive 20) · ×1
  • WriteFileTool.writeFile (cognitive 20) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/filesystem/WriteFileTool.scala:103 — WriteFileTool.writeFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 3, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · StateFileBackend.admit (cognitive 20) · ×1
  • StateFileBackend.admit (cognitive 20) modules/agent/src/main/scala/org/llm4s/agent/harness/StateFileBackend.scala:98 — StateFileBackend.admit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (10 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LLMClient.balancedFrom (cognitive 20) · ×1
  • LLMClient.balancedFrom (cognitive 20) modules/core/src/main/scala/org/llm4s/llmconnect/LLMClient.scala:222 — LLMClient.balancedFrom has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Redaction.backslashQuotedValueEnd (cognitive 20) · ×1
  • Redaction.backslashQuotedValueEnd (cognitive 20) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3924 — Redaction.backslashQuotedValueEnd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · OllamaClient.parseToolCall (cognitive 20) · ×1
  • OllamaClient.parseToolCall (cognitive 20) modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaClient.scala:515 — OllamaClient.parseToolCall has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (15 pts), match/switch 1 (5 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · OpenAICompatibleConfig.validate (cognitive 20) · ×1
  • OpenAICompatibleConfig.validate (cognitive 20) modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/config/OpenAICompatibleConfig.scala:162 — OpenAICompatibleConfig.validate has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (14 pts), match/switch 2 (5 pts), if/else 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SchemaMacros.checkImpl (cognitive 20) · ×1
  • SchemaMacros.checkImpl (cognitive 20) modules/schema-derivation/src/main/scala/org/llm4s/schema/SchemaMacros.scala:76 — SchemaMacros.checkImpl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7, match/switch 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommandPolicy.transfers (cognitive 20) · ×1
  • CommandPolicy.transfers (cognitive 20) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1988 — CommandPolicy.transfers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (6 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · generate-windows-best-fit.best_fits (cognitive 20) · ×1
  • generate-windows-best-fit.best_fits (cognitive 20) scripts/generate-windows-best-fit.py:60 — generate-windows-best-fit.best_fits has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompiledGraph.decodeWrite (cognitive 19) · ×1
  • CompiledGraph.decodeWrite (cognitive 19) modules/agent/src/main/scala/org/llm4s/agent/graph/CompiledGraph.scala:728 — CompiledGraph.decodeWrite has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (15 pts), match/switch 2 (4 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Run.end (cognitive 19) · ×1
  • Run.end (cognitive 19) modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3334 — Run.end has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 4 (8 pts), boolean chains 2 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Pipeline.outcome (cognitive 19) · ×1
  • Pipeline.outcome (cognitive 19) modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:2365 — Pipeline.outcome has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 6 (8 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Text.depthWithin (cognitive 19) · ×1
  • Text.depthWithin (cognitive 19) modules/agent/src/main/scala/org/llm4s/agent/harness/FileBackend.scala:461 — Text.depthWithin has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Bounded.render (cognitive 19) · ×1
  • Bounded.render (cognitive 19) modules/agent/src/main/scala/org/llm4s/agent/harness/FileTools.scala:560 — Bounded.render has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostFileBackend.checked (cognitive 19) · ×1
  • HostFileBackend.checked (cognitive 19) modules/agent/src/main/scala/org/llm4s/agent/harness/HostFileBackend.scala:874 — HostFileBackend.checked has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (15 pts), match/switch 2, boolean chains 1, if/else 1 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · InstructionMemoryMiddleware.load (cognitive 19) · ×1
  • InstructionMemoryMiddleware.load (cognitive 19) modules/agent/src/main/scala/org/llm4s/agent/harness/InstructionMemoryMiddleware.scala:83 — InstructionMemoryMiddleware.load has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnthropicClient.addMessagesToParams (cognitive 19) · ×1
  • AnthropicClient.addMessagesToParams (cognitive 19) modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:522 — AnthropicClient.addMessagesToParams has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ToolOutputCompressor.compressToolMessage (cognitive 19) · ×1
  • ToolOutputCompressor.compressToolMessage (cognitive 19) modules/core/src/main/scala/org/llm4s/context/ToolOutputCompressor.scala:100 — ToolOutputCompressor.compressToolMessage has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 6 (10 pts), if/else 7 (9 pts) (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Redaction.endsString (cognitive 19) · ×1
  • Redaction.endsString (cognitive 19) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:3145 — Redaction.endsString has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 3, loops 2, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · OpenAICompatibleModelLister.listModels (cognitive 19) · ×1
  • OpenAICompatibleModelLister.listModels (cognitive 19) modules/openai-compatible/src/main/scala/org/llm4s/config/OpenAICompatibleModelListers.scala:94 — OpenAICompatibleModelLister.listModels has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (15 pts), match/switch 1 (4 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · JevRetry.run (cognitive 19) · ×1
  • JevRetry.run (cognitive 19) modules/providers/jev/src/main/scala/org/llm4s/jev/JevRetry.scala:55 — JevRetry.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SemanticChunker.groupSentencesIntoChunks (cognitive 19) · ×1
  • SemanticChunker.groupSentencesIntoChunks (cognitive 19) modules/rag/src/main/scala/org/llm4s/chunking/SemanticChunker.scala:198 — SemanticChunker.groupSentencesIntoChunks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UrlLoader.openConnection (cognitive 19) · ×1
  • UrlLoader.openConnection (cognitive 19) modules/rag/src/main/scala/org/llm4s/rag/loader/UrlLoader.scala:90 — UrlLoader.openConnection has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 3 (10 pts), if/else 5 (8 pts), boolean chains 1 (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · WebSocketCommandExecutor.execute (cognitive 19) · ×1
  • WebSocketCommandExecutor.execute (cognitive 19) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala:50 — WebSocketCommandExecutor.execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (8 pts), boolean chains 3 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CalculatorTool.calculate (cognitive 18) · ×1
  • CalculatorTool.calculate (cognitive 18) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/core/CalculatorTool.scala:88 — CalculatorTool.calculate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentRun.await (cognitive 18) · ×1
  • AgentRun.await (cognitive 18) modules/agent/src/main/scala/org/llm4s/agent/AgentRun.scala:135 — AgentRun.await has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), match/switch 2 (6 pts), if/else 2 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ReplayGuard.unverifiable (cognitive 18) · ×1
  • ReplayGuard.unverifiable (cognitive 18) modules/agent/src/main/scala/org/llm4s/agent/graph/EffectReplay.scala:460 — ReplayGuard.unverifiable has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (5 pts), match/switch 2 (3 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · GraphRuntime.keepChildren (cognitive 18) · ×1
  • GraphRuntime.keepChildren (cognitive 18) modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:1206 — GraphRuntime.keepChildren has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Text.jsonValueBytes (cognitive 18) · ×1
  • Text.jsonValueBytes (cognitive 18) modules/agent/src/main/scala/org/llm4s/agent/harness/FileBackend.scala:370 — Text.jsonValueBytes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenExchange.parse (cognitive 18) · ×1
  • TokenExchange.parse (cognitive 18) modules/core/src/main/scala/org/llm4s/llmconnect/auth/TokenExchange.scala:241 — TokenExchange.parse has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 4 (7 pts), boolean chains 2 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · OpenAIImageClient.sizeToApiFormat (cognitive 18) · ×1
  • OpenAIImageClient.sizeToApiFormat (cognitive 18) modules/image/src/main/scala/org/llm4s/imagegeneration/provider/OpenAIImageClient.scala:302 — OpenAIImageClient.sizeToApiFormat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 1 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GraphEngine.traverse (cognitive 18) · ×1
  • GraphEngine.traverse (cognitive 18) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/engine/GraphEngine.scala:37 — GraphEngine.traverse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (8 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BedrockConfig.fromValues (cognitive 18) · ×1
  • BedrockConfig.fromValues (cognitive 18) modules/providers/bedrock/src/main/scala/org/llm4s/llmconnect/config/BedrockConfig.scala:83 — BedrockConfig.fromValues has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (17 pts), boolean chains 1 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · RAG.ingestResultsAsync (cognitive 18) · ×1
  • RAG.ingestResultsAsync (cognitive 18) modules/rag/src/main/scala/org/llm4s/rag/RAG.scala:564 — RAG.ingestResultsAsync has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (7 pts), if/else 5 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceAgentInterfaceImpl.currentHash (cognitive 18) · ×1
  • WorkspaceAgentInterfaceImpl.currentHash (cognitive 18) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:324 — WorkspaceAgentInterfaceImpl.currentHash has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompiledGraph.resume (cognitive 17) · ×1
  • CompiledGraph.resume (cognitive 17) modules/agent/src/main/scala/org/llm4s/agent/graph/CompiledGraph.scala:109 — CompiledGraph.resume has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (8 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · GraphRuntime.settleChild (cognitive 17) · ×1
  • GraphRuntime.settleChild (cognitive 17) modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:872 — GraphRuntime.settleChild has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (14 pts), match/switch 2, boolean chains 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ConfigPolicyEngine.check (cognitive 17) · ×1
  • ConfigPolicyEngine.check (cognitive 17) modules/config-policy/src/main/scala/org/llm4s/configpolicy/ConfigPolicy.scala:164 — ConfigPolicyEngine.check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 5 (7 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RawProvidersConfigLoader.readAuth (cognitive 17) · ×1
  • RawProvidersConfigLoader.readAuth (cognitive 17) modules/core/src/main/scala/org/llm4s/config/RawProvidersConfigLoader.scala:29 — RawProvidersConfigLoader.readAuth has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 4 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Message.validateConversationFlow (cognitive 17) · ×1
  • Message.validateConversationFlow (cognitive 17) modules/core/src/main/scala/org/llm4s/llmconnect/model/Message.scala:186 — Message.validateConversationFlow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · BoundedJson.maxNesting (cognitive 17) · ×1
  • BoundedJson.maxNesting (cognitive 17) modules/core/src/main/scala/org/llm4s/util/BoundedJson.scala:105 — BoundedJson.maxNesting has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Redaction.safeBodyQuoteForms (cognitive 17) · ×1
  • Redaction.safeBodyQuoteForms (cognitive 17) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:180 — Redaction.safeBodyQuoteForms has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · JevResponse.parse (cognitive 17) · ×1
  • JevResponse.parse (cognitive 17) modules/providers/jev/src/main/scala/org/llm4s/jev/JevResponse.scala:200 — JevResponse.parse has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 1, match/switch 1 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · JsonSchemaValidator.typeMatches (cognitive 17) · ×1
  • JsonSchemaValidator.typeMatches (cognitive 17) modules/rag/src/main/scala/org/llm4s/eval/dataset/JsonSchemaValidator.scala:104 — JsonSchemaValidator.typeMatches has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 6 (nesting depth added 5). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GraphRAG.summarizeCommunities (cognitive 17) · ×1
  • GraphRAG.summarizeCommunities (cognitive 17) modules/rag/src/main/scala/org/llm4s/knowledgegraph/graphrag/GraphRAG.scala:118 — GraphRAG.summarizeCommunities has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (14 pts), boolean chains 1, if/else 1, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RAG.createEmbeddings (cognitive 17) · ×1
  • RAG.createEmbeddings (cognitive 17) modules/rag/src/main/scala/org/llm4s/rag/RAG.scala:1599 — RAG.createEmbeddings has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (15 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · RAG.createHybridSearcher (cognitive 17) · ×1
  • RAG.createHybridSearcher (cognitive 17) modules/rag/src/main/scala/org/llm4s/rag/RAG.scala:1681 — RAG.createHybridSearcher has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (9 pts), loops 2 (7 pts), if/else 1 (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CommandPolicy.walk (cognitive 17) · ×1
  • CommandPolicy.walk (cognitive 17) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/CommandPolicy.scala:1553 — CommandPolicy.walk has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (10 pts), if/else 4 (7 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GraphRuntime.resumeOn (cognitive 16) · ×1
  • GraphRuntime.resumeOn (cognitive 16) modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:710 — GraphRuntime.resumeOn has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (12 pts), if/else 2 (3 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GraphRuntime.history (cognitive 16) · ×1
  • GraphRuntime.history (cognitive 16) modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:1376 — GraphRuntime.history has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (12 pts), if/else 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ToolLoop.boundaryPlacements (cognitive 16) · ×1
  • ToolLoop.boundaryPlacements (cognitive 16) modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:635 — ToolLoop.boundaryPlacements has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), match/switch 1 (4 pts), if/else 2 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Pipeline.answered (cognitive 16) · ×1
  • Pipeline.answered (cognitive 16) modules/agent/src/main/scala/org/llm4s/agent/graph/toolloop/ToolLoop.scala:1956 — Pipeline.answered has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (9 pts), match/switch 3 (6 pts), if/else 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · HostFileBackend.children (cognitive 16) · ×1
  • HostFileBackend.children (cognitive 16) modules/agent/src/main/scala/org/llm4s/agent/harness/HostFileBackend.scala:559 — HostFileBackend.children has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProviderTimeoutsReader.read (cognitive 16) · ×1
  • ProviderTimeoutsReader.read (cognitive 16) modules/core/src/main/scala/org/llm4s/config/ProviderTimeoutsReader.scala:29 — ProviderTimeoutsReader.read has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 4 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · CachingLLMClient.completeCached (cognitive 16) · ×1
  • CachingLLMClient.completeCached (cognitive 16) modules/core/src/main/scala/org/llm4s/llmconnect/caching/CachingLLMClient.scala:85 — CachingLLMClient.completeCached has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 4 (6 pts), boolean chains 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DefaultModelRegistryService.findModel (cognitive 16) · ×1
  • DefaultModelRegistryService.findModel (cognitive 16) modules/core/src/main/scala/org/llm4s/model/ModelRegistryService.scala:172 — DefaultModelRegistryService.findModel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (6 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ReliableClient.executeWithDeadlineAndRetry (cognitive 16) · ×1
  • ReliableClient.executeWithDeadlineAndRetry (cognitive 16) modules/core/src/main/scala/org/llm4s/reliability/ReliableClient.scala:165 — ReliableClient.executeWithDeadlineAndRetry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 2 (5 pts), match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Redaction.uncoveredEdits (cognitive 16) · ×1
  • Redaction.uncoveredEdits (cognitive 16) modules/core/src/main/scala/org/llm4s/util/Redaction.scala:1559 — Redaction.uncoveredEdits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, loops 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cognitive complexity CONCENTRATES: modules/core/src/main/scala/org/llm4s/util/Redaction.scala holds 21 of the 204 methods over the threshold — including the worst — and 887 of the 3372 points over it (26%), 3.9× the next-largest file (modules/observability/src/main/scala/org/llm4s/trace/model/TraceModelJson.scala at 226). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · SchemaValidator.partitionEdges (cognitive 16) · ×1
  • SchemaValidator.partitionEdges (cognitive 16) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/SchemaValidator.scala:76 — SchemaValidator.partitionEdges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GraphQAPipeline.askWithQuery (cognitive 16) · ×1
  • GraphQAPipeline.askWithQuery (cognitive 16) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQAPipeline.scala:82 — GraphQAPipeline.askWithQuery has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 2 (6 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · KeywordTokens.words (cognitive 16) · ×1
  • KeywordTokens.words (cognitive 16) modules/memory/src/main/scala/org/llm4s/agent/memory/KeywordTokens.scala:49 — KeywordTokens.words has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatibleConfig.fromValues (cognitive 16) · ×1
  • OpenAICompatibleConfig.fromValues (cognitive 16) modules/openai-compatible/src/main/scala/org/llm4s/llmconnect/config/OpenAICompatibleConfig.scala:206 — OpenAICompatibleConfig.fromValues has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (15 pts), boolean chains 1 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · JevConfig.checkBaseUrl (cognitive 16) · ×1
  • JevConfig.checkBaseUrl (cognitive 16) modules/providers/jev/src/main/scala/org/llm4s/jev/JevConfig.scala:118 — JevConfig.checkBaseUrl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · GraphRAG.globalSearch (cognitive 16) · ×1
  • GraphRAG.globalSearch (cognitive 16) modules/rag/src/main/scala/org/llm4s/knowledgegraph/graphrag/GraphRAG.scala:139 — GraphRAG.globalSearch has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 4 (6 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · GraphRAG.persistCommunityNodes (cognitive 16) · ×1
  • GraphRAG.persistCommunityNodes (cognitive 16) modules/rag/src/main/scala/org/llm4s/knowledgegraph/graphrag/GraphRAG.scala:272 — GraphRAG.persistCommunityNodes has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (13 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · QdrantVectorStore.deleteByPrefix (cognitive 16) · ×1
  • QdrantVectorStore.deleteByPrefix (cognitive 16) modules/rag/src/main/scala/org/llm4s/vectorstore/QdrantVectorStore.scala:213 — QdrantVectorStore.deleteByPrefix has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceAgentInterfaceImpl.commitStaged (cognitive 16) · ×1
  • WorkspaceAgentInterfaceImpl.commitStaged (cognitive 16) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:690 — WorkspaceAgentInterfaceImpl.commitStaged has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (6 pts), if/else 5, boolean chains 3, loops 1 (2 pts) (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceAgentInterfaceImpl.prepareCommandOrThrow (cognitive 16) · ×1
  • WorkspaceAgentInterfaceImpl.prepareCommandOrThrow (cognitive 16) modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WorkspaceAgentInterfaceImpl.scala:1676 — WorkspaceAgentInterfaceImpl.prepareCommandOrThrow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 3, match/switch 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D20 · ADR Quality · The body is a step-by-step guide for preparing for ESoC with LLM4S but does not state the context/problem driving the decision or give any consequences/trade-offs of joining the community and following these steps · ×1
  • The body is a step-by-step guide for preparing for ESoC with LLM4S but does not state the context/problem driving the decision or give any consequences/trade-offs of joining the community and following these steps European Summer of Code/Project Ideas/2026.md — Add an introductory Context section explaining why the European Summer of Code matters (global collaboration, mentorship) and a Consequences section on trade-offs such as time commitment vs benefits from being part of the global virtual community
D20 · ADR Quality · The body is a step-by-step guide on how to prepare for LFX2026 with LLM4S (application + 13 stepwise instructions), but no context/problem and no consequences/trade-offs are stated · ×1
  • The body is a step-by-step guide on how to prepare for LFX2026 with LLM4S (application + 13 stepwise instructions), but no context/problem and no consequences/trade-offs are stated LFX Mentorship/Project Ideas/2026.md — Add the problem motivating the mentorship project (e.g. global talent shortage, cross-timezone collaboration) and a Consequences section covering trade-offs such as time commitment for mentors/pairs, PR/issue creation without permission, and how to handle burnout
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (37 shared lines) · ×1
  • Near-duplicate member pair (37 shared lines) modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:182 — modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:182-230 | modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala:190-237 — These two members are variants of one another: 37 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (30 shared lines) · ×1
  • Near-duplicate member pair (30 shared lines) modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:130 — modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:130-199 | modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:134-274 — These two members are variants of one another: 30 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/GraphJsonParser.scala:44 — modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/GraphJsonParser.scala:44-112 | modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/JsonGraphStore.scala:235-275 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) modules/rag/src/main/scala/org/llm4s/rag/evaluation/TestDataset.scala:270 — modules/rag/src/main/scala/org/llm4s/rag/evaluation/TestDataset.scala:270-294 | modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/AnswerRelevancy.scala:184-208 | modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextPrecision.scala:204-228 | modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextRecall.scala:226-250 | modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/Faithfulness.scala:241-267 | modules/rag/src/main/scala/org/llm4s/reranker/LLMReranker.scala:194-220 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Duplicated block (87–101 lines × 2) · ×1
  • Duplicated block (87–101 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:274 — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:274-374 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:273-359 — before extracting anything, compare `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala` and `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 279 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:274` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (46–49 lines × 2) · ×1
  • Duplicated block (46–49 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:443 — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:443-491 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:398-443 — before extracting anything, compare `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala` and `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 279 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:443` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (44–46 lines × 2) · ×1
  • Duplicated block (44–46 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:194 — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:194-239 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:198-241 — before extracting anything, compare `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala` and `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 279 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:194` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (40–44 lines × 2) · ×1
  • Duplicated block (40–44 lines × 2) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:363 — modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:363-406 | modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:626-665 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (39–41 lines × 3) · ×1
  • Duplicated block (39–41 lines × 3) modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:272 — modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala:272-312 | modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala:278-318 | modules/image/src/main/scala/org/llm4s/imageprocessing/provider/geminiclient/GeminiVisionClient.scala:223-261 — before extracting anything, compare `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/OpenAIVisionClient.scala` and `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (35–36 lines × 2) · ×1
  • Duplicated block (35–36 lines × 2) modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:184 — modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:184-218 | modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:276-311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/anthropic/src/main/scala/org/llm4s/llmconnect/provider/AnthropicClient.scala:184` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (33–34 lines × 2) · ×1
  • Duplicated block (33–34 lines × 2) modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextRecall.scala:147 — modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextRecall.scala:147-180 | modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/Faithfulness.scala:163-195 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextRecall.scala:147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) modules/rag/src/main/scala/org/llm4s/rag/evaluation/TestDataset.scala:208 — modules/rag/src/main/scala/org/llm4s/rag/evaluation/TestDataset.scala:208-239 | modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/AnswerRelevancy.scala:103-133 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/rag/evaluation/TestDataset.scala:208` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26–30 lines × 2) · ×1
  • Duplicated block (26–30 lines × 2) REDACTED:73 — REDACTED:73-98 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:53-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:73` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) modules/rag/src/main/scala/org/llm4s/chunking/SemanticChunker.scala:249 — modules/rag/src/main/scala/org/llm4s/chunking/SemanticChunker.scala:249-271 | modules/rag/src/main/scala/org/llm4s/chunking/SentenceChunker.scala:208-231 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIAuthProvider.scala:134 — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIAuthProvider.scala:134-156 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIAuthProvider.scala:216-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIAuthProvider.scala:134` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) modules/mcp/src/main/scala/org/llm4s/mcp/MCPClientImpl.scala:143 — modules/mcp/src/main/scala/org/llm4s/mcp/MCPClientImpl.scala:143-163 | modules/mcp/src/main/scala/org/llm4s/mcp/MCPClientImpl.scala:178-200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/mcp/src/main/scala/org/llm4s/mcp/MCPClientImpl.scala:143` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala:128 — modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala:128-149 | modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/JsonGraphStore.scala:141-161 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala:128` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:427 — modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:427-448 | modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:685-704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (20–21 lines × 3) · ×1
  • Duplicated block (20–21 lines × 3) modules/providers/cohere/src/main/scala/org/llm4s/llmconnect/provider/CohereEmbeddingProvider.scala:216 — modules/providers/cohere/src/main/scala/org/llm4s/llmconnect/provider/CohereEmbeddingProvider.scala:216-236 | modules/providers/jina/src/main/scala/org/llm4s/llmconnect/provider/JinaEmbeddingProvider.scala:184-204 | modules/providers/voyage/src/main/scala/org/llm4s/llmconnect/provider/VoyageAIEmbeddingProvider.scala:105-124 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `modules/providers/cohere/src/main/scala/org/llm4s/llmconnect/provider/CohereEmbeddingProvider.scala:216` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) REDACTED:342 — REDACTED:342-362 | REDACTED:299-318 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (19–20 lines × 6) · ×1
  • Duplicated block (19–20 lines × 6) modules/rag/src/main/scala/org/llm4s/rag/evaluation/TestDataset.scala:276 — modules/rag/src/main/scala/org/llm4s/rag/evaluation/TestDataset.scala:276-294 | modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/AnswerRelevancy.scala:190-208 | modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextPrecision.scala:210-228 | modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextRecall.scala:232-250 | modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/Faithfulness.scala:248-267 | modules/rag/src/main/scala/org/llm4s/reranker/LLMReranker.scala:201-220 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/rag/evaluation/TestDataset.scala:276` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 4) · ×1
  • Duplicated block (20 lines × 4) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:97 — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:97-116 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:147-166 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:95-114 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:148-167 — before extracting anything, compare `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala` and `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 279 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:97` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–20 lines × 3) · ×1
  • Duplicated block (19–20 lines × 3) modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgSearchIndex.scala:321 — modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgSearchIndex.scala:321-340 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:362-380 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:455-473 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgSearchIndex.scala:321` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–19 lines × 3) · ×1
  • Duplicated block (18–19 lines × 3) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/BraveSearchTool.scala:399 — modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/BraveSearchTool.scala:399-416 | modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/DuckDuckGoSearchTool.scala:205-222 | modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/ExaSearchTool.scala:445-463 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/BraveSearchTool.scala:399` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–19 lines × 3) · ×1
  • Duplicated block (13–19 lines × 3) modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaEmbeddingProvider.scala:129 — modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaEmbeddingProvider.scala:129-147 | modules/openai/src/main/scala/org/llm4s/llmconnect/provider/OpenAIEmbeddingProvider.scala:144-156 | modules/providers/voyage/src/main/scala/org/llm4s/llmconnect/provider/VoyageAIEmbeddingProvider.scala:131-143 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `modules/ollama/src/main/scala/org/llm4s/llmconnect/provider/OllamaEmbeddingProvider.scala:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×1
  • Duplicated block (18 lines × 2) modules/core/src/main/scala/org/llm4s/reliability/ReliableClient.scala:183 — modules/core/src/main/scala/org/llm4s/reliability/ReliableClient.scala:183-200 | modules/core/src/main/scala/org/llm4s/reliability/ReliableClient.scala:243-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/core/src/main/scala/org/llm4s/reliability/ReliableClient.scala:183` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) modules/observability/src/main/scala/org/llm4s/trace/LangfuseBatchSender.scala:71 — modules/observability/src/main/scala/org/llm4s/trace/LangfuseBatchSender.scala:71-88 | modules/observability/src/main/scala/org/llm4s/trace/LangfuseTracing.scala:105-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/observability/src/main/scala/org/llm4s/trace/LangfuseBatchSender.scala:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:355 — modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:355-371 | modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:373-388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala:355` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:217 — modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:217-232 | modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:561-574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:217` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:257 — modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:257-272 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:296-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:257` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–15 lines × 3) · ×1
  • Duplicated block (12–15 lines × 3) modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:378 — modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:378-392 | modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:500-511 | modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:640-651 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/mcp/src/main/scala/org/llm4s/mcp/MCPTransport.scala:378` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala:94 — modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala:94-108 | modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/JsonGraphStore.scala:113-126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) modules/knowledgegraph-neo4j/src/main/scala/org/llm4s/knowledgegraph/neo4j/Neo4jGraphStore.scala:176 — modules/knowledgegraph-neo4j/src/main/scala/org/llm4s/knowledgegraph/neo4j/Neo4jGraphStore.scala:176-189 | modules/knowledgegraph-neo4j/src/main/scala/org/llm4s/knowledgegraph/neo4j/Neo4jGraphStore.scala:295-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/knowledgegraph-neo4j/src/main/scala/org/llm4s/knowledgegraph/neo4j/Neo4jGraphStore.scala:176` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) modules/rag/src/main/scala/org/llm4s/chunking/MarkdownChunker.scala:282 — modules/rag/src/main/scala/org/llm4s/chunking/MarkdownChunker.scala:282-293 | modules/rag/src/main/scala/org/llm4s/chunking/SemanticChunker.scala:253-264 | modules/rag/src/main/scala/org/llm4s/chunking/SentenceChunker.scala:212-224 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9–13 lines × 2) · ×1
  • Duplicated block (9–13 lines × 2) modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala:44 — modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala:44-56 | modules/image/src/main/scala/org/llm4s/imageprocessing/provider/geminiclient/GeminiVisionClient.scala:60-68 — before extracting anything, compare `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/anthropicclient/AnthropicVisionClient.scala` and `modules/image/src/main/scala/org/llm4s/imageprocessing/provider/geminiclient/GeminiVisionClient.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) REDACTED:491 — REDACTED:491-503 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:401-410 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:491` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgSearchIndex.scala:436 — modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgSearchIndex.scala:436-447 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala:546-557 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:564-575 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgSearchIndex.scala:436` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:263 — modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:263-271 | modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:287-298 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:263` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) modules/core/src/main/scala/org/llm4s/llmconnect/LLMClientRetry.scala:71 — modules/core/src/main/scala/org/llm4s/llmconnect/LLMClientRetry.scala:71-82 | modules/core/src/main/scala/org/llm4s/llmconnect/LLMClientRetry.scala:135-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/core/src/main/scala/org/llm4s/llmconnect/LLMClientRetry.scala:71` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–12 lines × 2) · ×1
  • Duplicated block (7–12 lines × 2) modules/mcp/src/main/scala/org/llm4s/mcp/MCPServer.scala:514 — modules/mcp/src/main/scala/org/llm4s/mcp/MCPServer.scala:514-520 | modules/samples/src/main/scala/org/llm4s/samples/mcp/DemonstrationMCPServer.scala:135-146 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `modules/samples/src/main/scala/org/llm4s/samples/mcp/DemonstrationMCPServer.scala:148` calls `Failure`, `error`, `sendJsonRpcError` and `modules/mcp/src/main/scala/org/llm4s/mcp/MCPServer.scala:521` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/filesystem/ListDirectoryTool.scala:121 — modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/filesystem/ListDirectoryTool.scala:121-129 | modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/filesystem/ReadFileTool.scala:102-110 | modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/filesystem/WriteFileTool.scala:110-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/filesystem/ListDirectoryTool.scala:121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–10 lines × 3) · ×1
  • Duplicated block (8–10 lines × 3) modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:534 — modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:534-543 | REDACTED:393-400 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:337-345 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:534` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:333` calls `val`, `getOrElse` and `modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:530` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8–9 lines × 3) · ×1
  • Duplicated block (8–9 lines × 3) modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:534 — modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:534-542 | modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:337-345 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:357-364 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:534` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala:333` calls `val`, `getOrElse` and `modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:530` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:168 — modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:168-175 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:352-359 | modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:368-375 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:182 — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:182-188 | modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala:185-192 — before extracting anything, compare `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala` and `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 279 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:182` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (3–8 lines × 4) · ×1
  • Duplicated block (3–8 lines × 4) modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala:160 — modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala:160-167 | modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala:212-219 | modules/rag/src/main/scala/org/llm4s/vectorstore/HybridSearcher.scala:285-287 | modules/rag/src/main/scala/org/llm4s/vectorstore/HybridSearcher.scala:340-342 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala:160` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6–7 lines × 4) · ×1
  • Duplicated block (6–7 lines × 4) REDACTED:391 — REDACTED:391-397 | REDACTED:428-433 | REDACTED:347-353 | REDACTED:390-395 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:288 — modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:288-293 | modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:323-329 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:288` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:140 — modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:140-144 | modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala:143-147 | modules/agent/src/main/scala/org/llm4s/agent/graph/Checkpointer.scala:450-453 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/filesystem/FileInfoTool.scala:60 — modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/filesystem/FileInfoTool.scala:60-67 | modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/BraveSearchTool.scala:286-293 | modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/DuckDuckGoSearchTool.scala:109-116 | modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/search/ExaSearchTool.scala:293-300 | modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/shell/ShellTool.scala:111-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
D4 · Code Duplication · Near-duplicate member pair (59 shared lines) · ×1
  • Near-duplicate member pair (59 shared lines) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:11 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:11-101 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupDemoView.scala:11-115 — These two members are variants of one another: 59 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) modules/samples/src/main/scala/org/llm4s/samples/agent/ConversationPersistenceExample.scala:29 — modules/samples/src/main/scala/org/llm4s/samples/agent/ConversationPersistenceExample.scala:29-93 | modules/samples/src/main/scala/org/llm4s/samples/agent/LongConversationExample.scala:23-76 | modules/samples/src/main/scala/org/llm4s/samples/agent/MultiStepAgentExample.scala:21-55 | modules/samples/src/main/scala/org/llm4s/samples/agent/MultiTurnConversationExample.scala:22-60 | modules/samples/src/main/scala/org/llm4s/samples/agent/SingleStepAgentExample.scala:19-53 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Duplicated block (49–50 lines × 2) · ×1
  • Duplicated block (49–50 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:107 — modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:107-155 | modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:162-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:107` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24–39 lines × 2) · ×1
  • Duplicated block (24–39 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/memory/SQLiteMemoryExample.scala:40 — modules/samples/src/main/scala/org/llm4s/samples/memory/SQLiteMemoryExample.scala:40-63 | modules/samples/src/main/scala/org/llm4s/samples/memory/VectorMemoryExample.scala:50-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (36 lines × 3) · ×1
  • Duplicated block (36 lines × 3) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:268 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala:268-303 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala:202-237 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupRenderSupport.scala:491-526 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupAsyncSupport.scala` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/ProviderSetupInputSupport.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (23–26 lines × 3) · ×1
  • Duplicated block (23–26 lines × 3) modules/samples/src/main/scala/org/llm4s/samples/SpeechSamples.scala:62 — modules/samples/src/main/scala/org/llm4s/samples/SpeechSamples.scala:62-84 | modules/samples/src/main/scala/org/llm4s/samples/SpeechSamples.scala:121-143 | modules/samples/src/main/scala/org/llm4s/samples/SpeechSamples.scala:179-204 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/SpeechSamples.scala:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:70 — modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:70-88 | modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:185-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–18 lines × 3) · ×1
  • Duplicated block (17–18 lines × 3) modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:67 — modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:67-84 | modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:127-144 | modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:182-198 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/agent/AdaptiveWindowingExample.scala:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–17 lines × 2) · ×1
  • Duplicated block (11–17 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:55 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:55-65 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupDemoView.scala:61-77 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupDemoView.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:87 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:87-101 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupDemoView.scala:101-115 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupSetupView.scala:199-213 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupDemoView.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:64 — modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:64-74 | modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:76-86 | modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:88-98 | modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:213-223 | modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:225-235 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–11 lines × 3) · ×1
  • Duplicated block (6–11 lines × 3) modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:157 — modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:157-167 | modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:169-179 | modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:180-185 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/toolapi/BuiltinToolsExample.scala:157` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–10 lines × 5) · ×1
  • Duplicated block (8–10 lines × 5) modules/samples/src/main/scala/org/llm4s/samples/agent/ConversationPersistenceExample.scala:36 — modules/samples/src/main/scala/org/llm4s/samples/agent/ConversationPersistenceExample.scala:36-43 | modules/samples/src/main/scala/org/llm4s/samples/agent/LongConversationExample.scala:35-42 | modules/samples/src/main/scala/org/llm4s/samples/agent/MultiStepAgentExample.scala:23-32 | modules/samples/src/main/scala/org/llm4s/samples/agent/MultiTurnConversationExample.scala:27-34 | modules/samples/src/main/scala/org/llm4s/samples/agent/SingleStepAgentExample.scala:21-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `modules/samples/src/main/scala/org/llm4s/samples/agent/ConversationPersistenceExample.scala:30` calls `info` and `modules/samples/src/main/scala/org/llm4s/samples/agent/MultiStepAgentExample.scala:21` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (3–10 lines × 4) · ×1
  • Duplicated block (3–10 lines × 4) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:31 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:31-33 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:34-39 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupDemoView.scala:38-47 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupSetupView.scala:89-93 — before extracting anything, compare `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupDemoView.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:32` calls `List`, `BoxNode`, `Style` and `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/view/ProviderSetupCompareView.scala:31` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (4–7 lines × 3) · ×1
  • Duplicated block (4–7 lines × 3) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/CompareModeUpdate.scala:34 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/CompareModeUpdate.scala:34-40 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/DemoModeUpdate.scala:35-41 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/SetupModeUpdate.scala:46-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/update/CompareModeUpdate.scala:34` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupRuntime.scala:398 — modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupRuntime.scala:398-402 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupRuntime.scala:404-408 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupRuntime.scala:410-414 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupRuntime.scala:416-420 | modules/samples/src/main/scala/org/llm4s/samples/dashboard/providersetup/ProviderSetupRuntime.scala:422-426 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (109 lines × 2) · ×1
  • Duplicated block (109 lines × 2) modules/samples/src/main/scala/org/llm4s/samples/guardrails/FactualityGuardrailExample.scala:40 — modules/samples/src/main/scala/org/llm4s/samples/guardrails/FactualityGuardrailExample.scala:40-154 | modules/samples/src/main/scala/org/llm4s/samples/guardrails/LLMJudgeGuardrailExample.scala:43-151 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
X1 · Async correctness · Future started here is not kept · ×1
  • Future started here is not kept modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala:218 — The `Future` this starts is not kept anywhere, and `scala.concurrent.Future` never reports a failure on its own: `Future { … }` catches any non-fatal exception its body throws and stores it as the future's `Failure` — not rethrown, not printed, not passed to the `ExecutionContext`'s `reportFailure` — so once nobody holds the future the error is gone, and nothing can wait for the work to finish either. Keep the future and compose it into what the caller returns (`for`/`flatMap`, `Future.sequence`), or, for genuine fire-and-forget, attach a handler that reports the failure — `Future { … }.failed.foreach(error => log.error("…", error))` or `.onComplete { case Failure(e) => report(e); case _ => }` — or catch and report inside the body itself.
Minor — 150 finding(s)
M4 · Documentation accuracy · README/code drift · ×40
  • README/code drift README.md:86 — README claims LLM4S is a 'pre-1.0 release' while the evidence shows no such version and only v0.5.1 exists — searched for: `v0.5.1`, `pre-1.0`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest and configuration files (package.json and other *.json, *.csproj, *.props, *.sln/*.slnx, *.yml, *.toml, *.config, tool configs such as eslint.config.js, Dockerfile); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong.
  • README/code drift CONTRIBUTING.md:147 — CONTRIBUTING.md documents the environment variable `SCREAMING_SNAKE_CASE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift README.md:326 — README.md names `src/main/scala-3`, but no file or folder `src/main/scala-3` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift README.md:551 — README.md names `provider/model`, but no file or folder `provider/model` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift README.md:631 — README.md links to `RELEASE.md`, but `RELEASE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift README.md:726 — README.md links to `docs/image_assets/gsoc_assets/gsoc_2025/talks/gsoc_lighting_talks_2025/slides/Anshuman_Awasthi_LLM4S_Support_image_voice_and_other_LLM_modalites.pdf`, but `docs/image_assets/gsoc_assets/gsoc_2025/talks/gsoc_lighting_talks_2025/slides/Anshuman_Awasthi_LLM4S_Support_image_voice_and_other_LLM_modalites.pdf` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift README.md:726 — README.md links to `docs/image_assets/gsoc_assets/gsoc_2025/talks/gsoc_lighting_talks_2025/slides/Anshuman_Awasthi_LLM4S_Support_image_voice_and_other_LLM_modalites.pptx`, but `docs/image_assets/gsoc_assets/gsoc_2025/talks/gsoc_lighting_talks_2025/slides/Anshuman_Awasthi_LLM4S_Support_image_voice_and_other_LLM_modalites.pptx` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift deploy/README.md:46 — deploy/README.md documents the environment variable `JAVA_OPTS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/PRODUCTION_DEPLOYMENT.md:35 — docs/PRODUCTION_DEPLOYMENT.md links to `getting-started/configuration#api-keys`, but `docs/getting-started/configuration` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/PRODUCTION_DEPLOYMENT.md:737 — docs/PRODUCTION_DEPLOYMENT.md links to `reference/configuration-boundary`, but `docs/reference/configuration-boundary` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/README.md:48 — docs/README.md links to `/scaladoc/`, but `scaladoc` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/events.md:34 — docs/events.md links to `/community/#llm4s-dev-hours`, but `community` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/index.md:20 — docs/index.md links to `/getting-started/installation`, but `getting-started/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/index.md:85 — docs/index.md links to `/guide/image-generation`, but `guide/image-generation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/index.md:85 — docs/index.md links to `/guide/speech`, but `guide/speech` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/index.md:103 — docs/index.md links to `/guide/agents/`, but `guide/agents` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/index.md:111 — docs/index.md links to `/guide/agents/guardrails`, but `guide/agents/guardrails` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/index.md:119 — docs/index.md links to `/guide/agents/memory`, but `guide/agents/memory` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/index.md:137 — docs/index.md links to `/advanced/`, but `advanced` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/index.md:186 — docs/index.md links to `/getting-started/configuration#named-provider-sections`, but `getting-started/configuration` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/index.md:329 — docs/index.md links to `/reference/v1-scope#scala-and-jdk-support`, but `reference/v1-scope` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/index.md:347 — docs/index.md links to `/events/`, but `events` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/index.md:376 — docs/index.md links to `/reference/roadmap`, but `reference/roadmap` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/index.md:382 — docs/index.md links to `/guide/`, but `guide` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/llm4s-g8-starter-kit.md:127 — docs/llm4s-g8-starter-kit.md names `src/test/scala/MainSpec.scala`, but no file or folder `src/test/scala/MainSpec.scala` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • + 15 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/AgentTracing.scala:81 — `warn` at line 81 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/AgentTracing.scala:127 — `warn` at line 127 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/AgentTracing.scala:139 — `warn` at line 139 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/AgentTracing.scala:147 — `warn` at line 147 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/AgentTracing.scala:156 — `warn` at line 156 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/AgentRun.scala:58 — `warn` at line 58 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/AgentRun.scala:167 — `warn` at line 167 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/Agent.scala:151 — `warn` at line 151 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/delegation/TypedAgent.scala:346 — `warn` at line 346 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/TracingSubscriber.scala:40 — `warn` at line 40 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/TracingSubscriber.scala:45 — `warn` at line 45 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:1217 — `debug` at line 1217 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:1226 — `warn` at line 1226 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:1257 — `warn` at line 1257 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:1275 — `debug` at line 1275 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:1733 — `warn` at line 1733 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:2050 — `warn` at line 2050 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:2056 — `warn` at line 2056 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:2687 — `warn` at line 2687 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:2747 — `warn` at line 2747 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:2752 — `warn` at line 2752 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3004 — `warn` at line 3004 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3076 — `warn` at line 3076 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3156 — `warn` at line 3156 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • Interpolated log message defeats structured logging modules/agent/src/main/scala/org/llm4s/agent/graph/GraphRuntime.scala:3167 — `warn` at line 3167 is handed an interpolated string as its message through SLF4J, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. scala-logging's `LazyLogging` logger takes an `s"…"` message apart into that pattern at compile time, so switching to it is also a fix.
  • + 15 more in this group — see findings.md.
D34 · Knowledge Freshness · Orphaned file · ×32
  • Orphaned file modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQAPipeline.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/mcp/src/main/scala/org/llm4s/mcp/MCPTypes.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQueryTranslator.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphRanking.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/core/src/main/scala/org/llm4s/context/SemanticBlocks.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/core/src/main/scala/org/llm4s/context/TokenWindow.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/agent-tools/src/main/scala/org/llm4s/config/ToolsConfigLoader.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/config-policy/src/main/scala/org/llm4s/configpolicy/EnvConfigPolicy.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/engine/GraphEngine.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/NativeQueryGenerator.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQueryExecutor.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/KnowledgeGraph.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/agent/src/main/scala/org/llm4s/agent/guardrails/builtin/SecretLeakGuardrail.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/core/src/main/scala/org/llm4s/llmconnect/provider/CostEstimator.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/memory/src/main/scala/org/llm4s/agent/memory/ConsolidationPrompts.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/SchemaValidator.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/image/src/main/scala/org/llm4s/imagegeneration/ImagePricingRegistry.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/SchemaGuidedExtractor.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/KnowledgeGraphGenerator.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/extraction/ExtractionSchema.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncKeywordIndex.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQuery.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/core/src/main/scala/org/llm4s/error/ContextError.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/memory/src/main/scala/org/llm4s/agent/memory/EmbeddingMemoryStore.scala:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 7 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×16
  • Duplicated predicate modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/GroundingGuardrail.scala:243 — `claims.toUpperCase(Locale.ROOT) == "NONE" || claims.isEmpty` appears character-identically in 2 files — modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/GroundingGuardrail.scala, modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/SourceAttributionGuardrail.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala:156 — `commit.retractTurn && commit.checkpoint.isEmpty` appears character-identically in 3 files — modules/agent-checkpoint-postgres/src/main/scala/org/llm4s/agent/graph/postgres/PostgresCheckpointer.scala, modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteCheckpointer.scala, modules/agent/src/main/scala/org/llm4s/agent/graph/Checkpointer.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/agent/src/main/scala/org/llm4s/agent/harness/FileBackend.scala:410 — `cp < 0x20 || (cp >= 0xd800 && cp <= 0xdfff)` appears character-identically in 2 files — modules/agent/src/main/scala/org/llm4s/agent/harness/FileBackend.scala, modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/agent/src/main/scala/org/llm4s/agent/harness/FileBackend.scala:409 — `cp == '"' || cp == '\\' || cp == '\n' || cp == '\r' || cp == '\t' || cp == '\b' || cp == '\f'` appears character-identically in 2 files — modules/agent/src/main/scala/org/llm4s/agent/harness/FileBackend.scala, modules/workspace/workspaceRunner/src/main/scala/org/llm4s/runner/WebSocketCommandExecutor.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala:110 — `e.relationship == rel && nodesByProperty.contains(e.source) && nodesByProperty.contains(e.target)` appears character-identically in 2 files — modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala, modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/JsonGraphStore.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala:49 — `e.source == edge.source && e.target == edge.target && e.relationship == edge.relationship` appears character-identically in 2 files — modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala, modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/JsonGraphStore.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala:168 — `e.source == source && e.target == target && e.relationship == relationship` appears character-identically in 2 files — modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala, modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/JsonGraphStore.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala:763 — `json == null || json == "{}" || json.isEmpty` appears character-identically in 4 files — modules/memory-postgres/src/main/scala/org/llm4s/agent/memory/PostgresMemoryStore.scala, REDACTED, modules/rag/src/main/scala/org/llm4s/vectorstore/PgVectorStore.scala, modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteVectorStore.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:690 — `json == null || json.isEmpty || json == "{}"` appears character-identically in 5 files — REDACTED, modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgCollectionStore.scala, modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgSearchIndex.scala, modules/rag/src/main/scala/org/llm4s/vectorstore/PgKeywordIndex.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQueryExecutor.scala:65 — `nodeIds.contains(e.source) && nodeIds.contains(e.target)` appears character-identically in 2 files — modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQueryExecutor.scala, modules/rag/src/main/scala/org/llm4s/knowledgegraph/graphrag/GraphRAG.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala:116 — `nodesByProperty.contains(e.source) && nodesByProperty.contains(e.target)` appears character-identically in 2 files — modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/InMemoryGraphStore.scala, modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/storage/JsonGraphStore.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:318 — `parts.nonEmpty && (am.toolCalls.nonEmpty || am.contentOpt.isDefined)` appears character-identically in 2 files — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala, modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala:177 — `response.statusCode < 200 || response.statusCode >= 300` appears character-identically in 2 files — modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala, modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/core/src/main/scala/org/llm4s/http/Llm4sHttpClient.scala:93 — `response.statusCode >= 200 && response.statusCode < 300` appears character-identically in 12 files — modules/core/src/main/scala/org/llm4s/http/Llm4sHttpClient.scala, modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/GeminiClient.scala, modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIAuthProvider.scala, modules/gemini/src/main/scala/org/llm4s/llmconnect/provider/VertexAIClient.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextPrecision.scala:64 — `sample.contexts.isEmpty || sample.contexts.forall(_.trim.isEmpty)` appears character-identically in 3 files — modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextPrecision.scala, modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/ContextRecall.scala, modules/rag/src/main/scala/org/llm4s/rag/evaluation/metrics/Faithfulness.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/core/src/main/scala/org/llm4s/llmconnect/caching/CacheConfig.scala:53 — `similarityThreshold >= 0.0 && similarityThreshold <= 1.0` appears character-identically in 2 files — modules/core/src/main/scala/org/llm4s/llmconnect/caching/CacheConfig.scala, modules/rag/src/main/scala/org/llm4s/chunking/SemanticChunker.scala. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X7 · Silent fallback defaults · Silent fallback default in catch · ×7
  • Silent fallback default in catch modules/openai/src/main/scala/org/llm4s/llmconnect/provider/OpenAIClient.scala:771 — `serialize` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch case or in the Scaladoc, and the row stops firing.
  • Silent fallback default in catch modules/provider-testkit/src/main/scala/org/llm4s/testkit/FakeTokenExchangeServer.scala:179 — `jsonFields` swallows every exception into `Map.empty` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch case or in the Scaladoc, and the row stops firing.
  • Silent fallback default in catch modules/rag/src/main/scala/org/llm4s/extract/TikaDocumentExtractor.scala:104 — `detectMimeType` swallows every exception into `"application/octet-stream"` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch case or in the Scaladoc, and the row stops firing.
  • Silent fallback default in catch modules/rag/src/main/scala/org/llm4s/rag/loader/internal/RobotsTxtParser.scala:175 — `fetch` swallows every exception into `Seq.empty` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch case or in the Scaladoc, and the row stops firing.
  • Silent fallback default in catch modules/rag/src/main/scala/org/llm4s/vectorstore/SQLiteKeywordIndex.scala:394 — `deserializeMetadata` swallows every exception into `Map.empty` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch case or in the Scaladoc, and the row stops firing.
  • Silent fallback default in catch modules/samples/src/main/scala/org/llm4s/samples/chat/tui/ChatTuiEnv.scala:77 — `parse` swallows every exception into `Map.empty` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch case or in the Scaladoc, and the row stops firing.
  • Silent fallback default in catch modules/spring-boot-starter/src/main/scala/org/llm4s/spring/SpringProviderSource.scala:235 — `readSafely` swallows every exception into `Vector.empty` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch case or in the Scaladoc, and the row stops firing.
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 15 significant file(s) lose their only recent owner: modules/image/src/main/scala/org/llm4s/imageprocessing/provider/LocalImageProcessor.scala, modules/rag/src/main/scala/org/llm4s/rag/permissions/pg/PgSchemaManager.scala, modules/agent/src/main/scala/org/llm4s/assistant/ConsoleInterface.scala, modules/rag/src/main/scala/org/llm4s/rag/loader/DocumentLoader.scala, modules/agent/src/main/scala/org/llm4s/agent/ContextWindowConfig.scala, modules/rag/src/main/scala/org/llm4s/rag/permissions/SearchIndex.scala, modules/rag/src/main/scala/org/llm4s/rag/loader/DocumentLoaders.scala, modules/rag/src/main/scala/org/llm4s/rag/loader/SourceBackedLoader.scala (+7 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 11 significant file(s) lose their only recent owner: modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/ContextRelevanceGuardrail.scala, modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/SourceAttributionGuardrail.scala, modules/agent/src/main/scala/org/llm4s/agent/guardrails/rag/GroundingGuardrail.scala, modules/rag/src/main/scala/org/llm4s/rag/benchmark/BenchmarkConfig.scala, modules/agent-tools/src/main/scala/org/llm4s/toolapi/builtin/shell/ShellConfig.scala, modules/agent/src/main/scala/org/llm4s/agent/guardrails/patterns/PIIPatterns.scala, modules/rag/src/main/scala/org/llm4s/reranker/LLMReranker.scala, modules/core/src/main/scala/org/llm4s/context/tokens/TokenizerMapping.scala (+3 more). Pair on, review, or document these before any departure.
D31 · IaC & Container Security · Low IaC · ×2
  • REDACTED
  • REDACTED
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (28 single-owned of 603 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 603 of the 819 production source files in this repository met that bar). They are anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: modules/rag/src/main/scala/org/llm4s/vectorstore/VectorStoreFactory.scala, modules/agent-tools/src/main/scala/org/llm4s/config/ToolsConfigLoader.scala.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 3 project(s) overshoot their size bounds, lowering Project Cohesion to 3.3/10. The most over is `(repository root)` (171503 LoC, 2869 module-visible types across 210 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 32 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQAPipeline.scala, modules/mcp/src/main/scala/org/llm4s/mcp/MCPTypes.scala, modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphQueryTranslator.scala, modules/knowledgegraph/src/main/scala/org/llm4s/knowledgegraph/query/GraphRanking.scala, modules/rag/src/main/scala/org/llm4s/vectorstore/AsyncHybridSearcher.scala, modules/core/src/main/scala/org/llm4s/context/SemanticBlocks.scala, modules/core/src/main/scala/org/llm4s/context/TokenWindow.scala, modules/config-policy/src/main/scala/org/llm4s/configpolicy/EnvConfigPolicy.scala (and 24 more) (33 orphaned of 603 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 603 of the 819 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D40 · Network Egress Confinement · No network policy · ×1
  • No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
P10 · Library API & versioning · Large public API surface · ×1
  • Large public API surface — 38/43 types (88%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
PF1 · Benchmark discipline · Benchmarks don't track allocations · ×1
  • Benchmarks don't track allocations modules/benchmarks/src/main/scala/org/llm4s/benchmarks/ToolRegistryBenchmark.scala — A JMH/Jetpack Benchmark suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured.
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×1
  • No app-layer HTTPS enforcement detected — This repository runs an HTTP server and nothing in its Scala source or committed configuration secures the transport: no HTTPS served (akka/pekko-http `ConnectionContext.httpsServer`/`enableHttps`, an http4s builder's `withTLS`, Jetty's `SslContextFactory`, zio-http's `SSLConfig`, Play's `https.port`), no `Strict-Transport-Security` header, HSTS middleware or Play `RedirectHttpsFilter`, no `X-Forwarded-Proto` read or Play `play.http.forwarded.trustedProxies` for a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: modules/deploy-service/src/main/scala/org/llm4s/deploy/DeployService.scala:34 — `cask.Main`.
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Scala server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: modules/deploy-service/src/main/scala/org/llm4s/deploy/DeployService.scala:34 — `cask.Main`.
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×1
  • Diagnostic log message is built whether or not it is wanted modules/agent/src/main/scala/org/llm4s/assistant/SessionManager.scala:150 — `debug` at line 150 is called with an argument built by `json.obj.keySet.mkString("…")` (line 150), whose cost grows with the collection it walks. Scala evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: the logger takes a built `String` (SLF4J, Akka/Pekko `LoggingAdapter`, `context.log`), and there is no `isDebugEnabled`/`isTraceEnabled` test and no debug flag.
X5 · Nullable reference types · Scala's null is not held to the type system everywhere · ×1
  • Scala's null is not held to the type system everywhere — No build over this repository's 767 Scala product file(s) passes `-Yexplicit-nulls`, enables WartRemover's `Null` wart or runs Scalafix's `DisableSyntax.noNulls`, so every reference type admits null and nothing reports a `null` written into the code or returned from a Java API — the first one to reach a method call is a `NullPointerException`. `Option` by convention is a habit no tool here holds the code to.
Minor — 6 finding(s)
D12 · Dependency Hygiene · Outdated · ×5
  • Outdated: bigdecimal — `bigdecimal` is resolved to 3.3.1 in the committed Gemfile.lock but 4.1.3 is the current release on rubygems.org, and docs/Gemfile declares no version requirement for it, so nothing but the lockfile is holding it back. This build is therefore missing every fix published since, including any security fix. This crosses a major version, so read the changelog before taking it. Run `bundle update bigdecimal` and commit the updated Gemfile.lock.
  • Outdated: csv — `csv` is resolved to 3.3.5 in the committed Gemfile.lock but 3.3.6 is the current release on rubygems.org, and docs/Gemfile declares no version requirement for it, so nothing but the lockfile is holding it back. This build is therefore missing every fix published since, including any security fix. Run `bundle update csv` and commit the updated Gemfile.lock.
  • Outdated: jekyll-feed — `jekyll-feed` is resolved to 0.17.0 in the committed Gemfile.lock but 0.18.0 is the current release on rubygems.org, and it already satisfies the `"~> 0.17"` requirement declared in docs/Gemfile — so the lockfile is behind this repository's own declared range. This build is therefore missing every fix published since, including any security fix. Run `bundle update jekyll-feed` and commit the updated Gemfile.lock.
  • Outdated: jekyll-seo-tag — `jekyll-seo-tag` is resolved to 2.8.0 in the committed Gemfile.lock but 2.9.1 is the current release on rubygems.org, and it already satisfies the `"~> 2.8"` requirement declared in docs/Gemfile — so the lockfile is behind this repository's own declared range. This build is therefore missing every fix published since, including any security fix. Run `bundle update jekyll-seo-tag` and commit the updated Gemfile.lock.
  • Outdated: just-the-docs — `just-the-docs` is resolved to 0.10.1 in the committed Gemfile.lock but 0.12.0 is the current release on rubygems.org, and it already satisfies the `"~> 0.10"` requirement declared in docs/Gemfile — so the lockfile is behind this repository's own declared range. This build is therefore missing every fix published since, including any security fix. Run `bundle update just-the-docs` and commit the updated Gemfile.lock.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: workspaceShared — workspaceShared: abstractness 0.06, instability 0.00, distance 0.94 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-bf2265f22aa849d4bb5e7077e7d7f426/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-bf2265f22aa849d4bb5e7077e7d7f426/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .222artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update2artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .12artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 45 file(s) — `modules/agent-checkpoint-sqlite/src/main/scala/org/llm4s/agent/graph/sqlite/SqliteSchema.scala`, `modules/agent-memory/src/main/scala/org/llm4s/agent/harness/memory/MemoryEvents.scala`, `modules/agent/src/main/scala/org/llm4s/agent/AgentTracing.scala`, `modules/agent/src/main/scala/org/llm4s/agent/RunScope.scala`, `modules/agent/src/main/scala/org/llm4s/agent/delegation/DelegatedSuspension.scala`, … (+40 more) — so the PII/GDPR sweep did not cover them at all.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a15ddb-ab9d-7038-bf90-6fa37db10597 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md