Public report of microsoft/semantic-kernel, published 23 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 reportMeasured 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, 23 October 2026, 05:46 UTC · Survey ID cd_c9fe01748c3a45df91d212145a329fdf
microsoft/semantic-kernel
Measured 23 October 2026, 05:24 UTC, at code version 2550183
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
Boundary Type-Coupling is not measured: Bounded contexts not declared.
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
Down 2 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: 226,624 lines of product code in 243 projects, tests not counted · Estimated rebuild effort: about 5.6 person-years · Weakest lens: Code Health, 52
Findings by how serious they are
319 critical1404 serious1180 minor
7 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
23 October 2026, 05:24 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 ▸
78of 85 dimensions measured by tools. The other 7 are advisory notes from an AI model, which explain the code but don't count towards the score.
2577of 2903 findings point to an exact file and line, so you can open each one in the code. The other 326 concern the repository as a whole, such as missing documentation.
85dimensions across 7 lenses, read from 226,624 lines of product code in 243 projects.
microsoft/semantic-kernel scores 57 out of 100, which would normally be rated Adequate, but it is rated Weak because its weakest group of dimensions, Dependencies, is rated Critical. The standard never rates a score more than one step above its weakest group, so a high average can't hide a weak area.
The weakest lens counts most in the score, and here that is Code Health, which scores 52 and is rated Adequate. Its Explicit Debt dimension scores 0 out of 10, and until that reaches 4, Code Health can't be rated higher than Adequate. The first actions are to resolve the 1 Vulnerable finding(s) in Dependency Hygiene and to resolve the 6 Deprecated finding(s) in Dependency Hygiene, and if Code Health rose to 70, the score would rise from 57 to about 61.
319 findings are critical: 287 in Explicit Debt, 13 in Static Analysis (SAST), 11 in Dependency Vulnerabilities, six in Project dependency cycles, one in Captive dependencies and one in Dependency Hygiene.
Watchdog couldn't measure Code Coverage, IL Efficiency and Runtime accessibility in this code, so those dimensions are left out of the score. The product code is 226,624 lines, which would take an estimated 5.6 person-years, around €810,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 forThe 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.
Async correctness · Blocking `Thread.Sleep` inside an `async` method dotnet/src/Experimental/Process.IntegrationTests.Resources/ProcessCycleTestResources.cs
Async correctness · Blocking `Thread.Sleep` inside an `async` method dotnet/src/Experimental/Process.IntegrationTests.Resources/ProcessCycleTestResources.cs
Async correctness · Blocking `Thread.Sleep` inside an `async` method dotnet/src/Experimental/Process.IntegrationTests.Resources/ProcessCycleTestResources.cs
Async correctness · Blocking `File.ReadAllBytes` inside an `async` method dotnet/src/Plugins/Plugins.Core/CodeInterpreter/SessionsPythonPlugin.cs
Async correctness · Blocking `File.WriteAllBytes` inside an `async` method dotnet/src/Plugins/Plugins.Core/CodeInterpreter/SessionsPythonPlugin.cs
Cancellation propagation · Async local function without CancellationToken: PerformChatCompletion dotnet/samples/Demos/AmazonBedrockModels/Program.cs
Cancellation propagation · Async local function without CancellationToken: PerformTextGeneration dotnet/samples/Demos/AmazonBedrockModels/Program.cs
Cancellation propagation · Async local function without CancellationToken: PerformStreamChatCompletion dotnet/samples/Demos/AmazonBedrockModels/Program.cs
Cancellation propagation · Async local function without CancellationToken: PerformStreamTextGeneration dotnet/samples/Demos/AmazonBedrockModels/Program.cs
Cancellation propagation · Async method without CancellationToken: OnPromptRenderAsync dotnet/samples/Demos/ContentSafety/Filters/AttackDetectionFilter.cs
Cancellation propagation · Async method without CancellationToken: OnPromptRenderAsync dotnet/samples/Demos/ContentSafety/Filters/TextModerationFilter.cs
Cancellation propagation · Async method without CancellationToken: OnFunctionInvocationAsync dotnet/samples/Demos/QualityCheck/QualityCheckWithFilters/Filters/BertSummarizationEvaluationFilter.cs
Cancellation propagation · Async method without CancellationToken: OnFunctionInvocationAsync dotnet/samples/Demos/QualityCheck/QualityCheckWithFilters/Filters/BleuSummarizationEvaluationFilter.cs
Cancellation propagation · Async method without CancellationToken: OnFunctionInvocationAsync dotnet/samples/Demos/QualityCheck/QualityCheckWithFilters/Filters/CometTranslationEvaluationFilter.cs
Cancellation propagation · Async method without CancellationToken: OnFunctionInvocationAsync dotnet/samples/Demos/QualityCheck/QualityCheckWithFilters/Filters/MeteorSummarizationEvaluationFilter.cs
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: 204 findings
These 204 critical or serious findings were in the previous survey, on 9 October 2026, and are gone from this one. The first 100 are listed here.
Test Quality · No assertions: ItShouldPreserveExplicitHostnameAllowlistDnsBypassAsync dotnet/src/Functions/Functions.UnitTests/OpenApi/ServerUrlValidatorTests.cs
Test Quality · No assertions: ItShouldBypassPrivateGateWhenAllowPrivateNetworkAccessTrueAsync dotnet/src/Functions/Functions.UnitTests/OpenApi/ServerUrlValidatorTests.cs
Test Reliability · Flaky test: Process.IntegrationTestRunner.Local::SemanticKernel.Process.IntegrationTests.ProcessCloudEventsTests.SemanticKernel.Process.IntegrationTests.ProcessCloudEventsTests.ProcessWithSubprocessWithProxyEmittingDifferentTopicsAsync
Explicit Debt · NoWarnInCsproj — 9 warning codes suppressed in one element dotnet/test/VectorData/Chroma.UnitTests/Chroma.UnitTests.csproj
Supply-chain Provenance & Signing · Secret exported as workflow-level env
Cancellation propagation · Async method without CancellationToken: RunAsync dotnet/samples/Demos/AotCompatibility/Program.cs
Cancellation propagation · Async method without CancellationToken: RunHuggingFaceChatAsync dotnet/samples/Demos/TelemetryWithAppInsights/Program.cs
Cancellation propagation · Async method without CancellationToken: RunMistralAIChatAsync dotnet/samples/Demos/TelemetryWithAppInsights/Program.cs
Cancellation propagation · Async method without CancellationToken: RunChatAsync dotnet/samples/Demos/TelemetryWithAppInsights/Program.cs
Cancellation propagation · Async method without CancellationToken: RunAzureOpenAIToolCallsAsync dotnet/samples/Demos/TelemetryWithAppInsights/Program.cs
Cancellation propagation · Async method without CancellationToken: RunAutoToolCallAsync dotnet/samples/Demos/TelemetryWithAppInsights/Program.cs
Cancellation propagation · Async method without CancellationToken: RunChatCompletionAgentAsync dotnet/samples/Demos/TelemetryWithAppInsights/Program.cs
Cancellation propagation · Async method without CancellationToken: InitializeAgentAsync dotnet/samples/Demos/A2AClientServer/A2AClient/HostClientAgent.cs
Cancellation propagation · Async method without CancellationToken: CreateAgentAsync dotnet/samples/Demos/A2AClientServer/A2AClient/HostClientAgent.cs
Cancellation propagation · Async method without CancellationToken: HandleCommandsAsync dotnet/samples/Demos/A2AClientServer/A2AClient/Program.cs
Cancellation propagation · Async method without CancellationToken: RunCliAsync dotnet/samples/Demos/A2AClientServer/A2AClient/Program.cs
Cancellation propagation · Async method without CancellationToken: CreateFoundryHostAgentAsync dotnet/samples/Demos/A2AClientServer/A2AServer/HostAgentFactory.cs
Cancellation propagation · Async method without CancellationToken: CreateChatCompletionHostAgentAsync dotnet/samples/Demos/A2AClientServer/A2AServer/HostAgentFactory.cs
Cancellation propagation · Async method without CancellationToken: RunAsync dotnet/samples/Demos/ModelContextProtocolClientServer/MCPClient/Samples/AgentAvailableAsMCPToolSample.cs
Cancellation propagation · Async method without CancellationToken: RunAsync dotnet/samples/Demos/ModelContextProtocolClientServer/MCPClient/Samples/AzureAIAgentWithMCPToolsSample.cs
Cancellation propagation · Async method without CancellationToken: CreateAzureAIAgentAsync dotnet/samples/Demos/ModelContextProtocolClientServer/MCPClient/Samples/AzureAIAgentWithMCPToolsSample.cs
Cancellation propagation · Async method without CancellationToken: RunAsync dotnet/samples/Demos/ModelContextProtocolClientServer/MCPClient/Samples/ChatCompletionAgentWithMCPToolsSample.cs
Cancellation propagation · Async method without CancellationToken: RunAsync dotnet/samples/Demos/ModelContextProtocolClientServer/MCPClient/Samples/MCPPromptSample.cs
Cancellation propagation · Async method without CancellationToken: RunAsync dotnet/samples/Demos/ModelContextProtocolClientServer/MCPClient/Samples/MCPResourcesSample.cs
Cancellation propagation · Async method without CancellationToken: RunAsync dotnet/samples/Demos/ModelContextProtocolClientServer/MCPClient/Samples/MCPResourceTemplatesSample.cs
Cancellation propagation · Async method without CancellationToken: RunAsync dotnet/samples/Demos/ModelContextProtocolClientServer/MCPClient/Samples/MCPSamplingSample.cs
Cancellation propagation · Async method without CancellationToken: RunAsync dotnet/samples/Demos/ModelContextProtocolClientServer/MCPClient/Samples/MCPToolsSample.cs
Cancellation propagation · Async method without CancellationToken: CreateCollectionFromListAsync dotnet/samples/Demos/ModelContextProtocolClientServer/MCPServer/Extensions/VectorStoreExtensions.cs
Cancellation propagation · Async method without CancellationToken: SummarizeUnreadEmailsAsync dotnet/samples/Demos/ModelContextProtocolClientServer/MCPServer/Tools/MailboxUtils.cs
Cancellation propagation · Async method without CancellationToken: OnAutoFunctionInvocationAsync dotnet/src/SemanticKernel.Abstractions/AI/ChatClient/KernelFunctionInvokingChatClient.cs
Cancellation propagation · Async method without CancellationToken: InvokeFilterOrFunctionAsync dotnet/src/SemanticKernel.Abstractions/AI/ChatClient/KernelFunctionInvokingChatClient.cs
Cancellation propagation · Async method without CancellationToken: InvokeFilterOrFunctionAsync dotnet/src/SemanticKernel.Abstractions/Kernel.cs
Cancellation propagation · Async method without CancellationToken: InvokeFilterOrPromptRenderAsync dotnet/src/SemanticKernel.Abstractions/Kernel.cs
Cancellation propagation · Async method without CancellationToken: RunWithLoggingAsync dotnet/src/InternalUtilities/src/Diagnostics/LoggingExtensions.cs
Cancellation propagation · Async method without CancellationToken: RunWithLoggingAsync dotnet/src/InternalUtilities/src/Diagnostics/LoggingExtensions.cs
Cancellation propagation · Async method without CancellationToken: SearchAsync dotnet/src/SemanticKernel.Core/Memory/Mem0/Mem0Client.cs
Cancellation propagation · Async method without CancellationToken: CreateMemoryAsync dotnet/src/SemanticKernel.Core/Memory/Mem0/Mem0Client.cs
Cancellation propagation · Async method without CancellationToken: ClearMemoryAsync dotnet/src/SemanticKernel.Core/Memory/Mem0/Mem0Client.cs
Cancellation propagation · Async method without CancellationToken: WhenProcessingCompleteAsync dotnet/src/SemanticKernel.Core/Memory/Whiteboard/WhiteboardProvider.cs
Cancellation propagation · Async method without CancellationToken: DeserializeAsync dotnet/src/Agents/Abstractions/AgentChat.cs
Cancellation propagation · Async method without CancellationToken: SerializeAsync dotnet/src/Agents/Abstractions/AgentChatSerializer.cs
Cancellation propagation · Async method without CancellationToken: DeserializeAsync dotnet/src/Agents/Abstractions/AgentChatSerializer.cs
Cancellation propagation · Async method without CancellationToken: ToDescendingAsync dotnet/src/Agents/Abstractions/Extensions/ChatHistoryExtensions.cs
Cancellation propagation · Async method without CancellationToken: OnAutoFunctionInvocationAsync dotnet/src/InternalUtilities/connectors/AI/FunctionCalling/FunctionCallsProcessor.cs
Cancellation propagation · Async method without CancellationToken: InvokeFilterOrFunctionAsync dotnet/src/InternalUtilities/connectors/AI/FunctionCalling/FunctionCallsProcessor.cs
Cancellation propagation · Async method without CancellationToken: CreateCacheHelper dotnet/src/Agents/Copilot/CopilotStudioTokenHandler.cs
Cancellation propagation · Async method without CancellationToken: ProcessActivity dotnet/src/Agents/Copilot/Internal/ActivityProcessor.cs
Cancellation propagation · Async method without CancellationToken: GetMessageAsync dotnet/src/Agents/Magentic/StandardMagenticManager.cs
Cancellation propagation · Async method without CancellationToken: RegisterResultTypeAsync dotnet/src/Agents/Orchestration/AgentOrchestration.cs
Cancellation propagation · Async method without CancellationToken: RegisterOrchestrationAgentAsync dotnet/src/Agents/Orchestration/Extensions/RuntimeExtensions.cs
Cancellation propagation · Async method without CancellationToken: SubscribeAsync dotnet/src/Agents/Orchestration/Extensions/RuntimeExtensions.cs
Cancellation propagation · Async method without CancellationToken: SubscribeAsync dotnet/src/Agents/Orchestration/Extensions/RuntimeExtensions.cs
Cancellation propagation · Async method without CancellationToken: RegisterImplicitAgentSubscriptionsAsync dotnet/src/Agents/Runtime/Core/AgentRuntimeExtensions.cs
Cancellation propagation · Async method without CancellationToken: StartAsync dotnet/src/Agents/Runtime/Core/AgentsApp.cs
Cancellation propagation · Async method without CancellationToken: ShutdownAsync dotnet/src/Agents/Runtime/Core/AgentsApp.cs
Cancellation propagation · Async method without CancellationToken: BuildAsync dotnet/src/Agents/Runtime/Core/AgentsAppBuilder.cs
Cancellation propagation · Async method without CancellationToken: InvokeAsync dotnet/src/Agents/Runtime/Core/Internal/HandlerInvoker.cs
Cancellation propagation · Async method without CancellationToken: RunUntilIdleAsync dotnet/src/Agents/Runtime/InProcess/InProcessRuntime.cs
Cancellation propagation · Async method without CancellationToken: TryGetUnderlyingAgentInstanceAsync dotnet/src/Agents/Runtime/InProcess/InProcessRuntime.cs
Cancellation propagation · Async method without CancellationToken: EnsureAgentAsync dotnet/src/Agents/Runtime/InProcess/InProcessRuntime.cs
Cancellation propagation · Async method without CancellationToken: RunOperationAsync dotnet/src/InternalUtilities/src/Data/VectorStoreErrorHandler.cs
Cancellation propagation · Async method without CancellationToken: RunOperationAsync dotnet/src/InternalUtilities/src/Data/VectorStoreErrorHandler.cs
Cancellation propagation · Async method without CancellationToken: MoveNextAsync dotnet/src/InternalUtilities/src/Data/VectorStoreErrorHandler.cs
Rebuild cost: about €810,000 · Estimate
Cost to rebuild
€270,000 to €1,400,000, for 4,463 to 14,287 hours of work, about 5.6 person-years for 3 to 11 engineers
Difficulty of the problem
High, 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 57. 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.
Size
Large: 226,624 lines of product code
Comment lines
The estimate prices 189,540 lines. Comment lines count towards the size of 226,624 lines but aren't priced as work.
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.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 Vulnerable finding(s) in Dependency Hygiene.
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 €810,000 to build again, about 5.6 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
Resolve the 1 Vulnerable finding(s) in Dependency Hygiene. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for low effort, because it clears the 1 Dependency Hygiene findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.4 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 11,615 lines over the last 90 days, which is about 47,105 lines a year. At that pace, the extra work comes to an estimated 2.4 to 15.7 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
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.
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.
792 modules, with 1158 dependencies between them. 6 loops run through 45 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 752 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.
28 pairs of types, where a type in Microsoft.SemanticKernel.Agents.Runtime.Core uses a type in Microsoft.SemanticKernel.Agents.Runtime. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Microsoft.SemanticKernel.Agents.Runtime.Core uses Microsoft.SemanticKernel.Agents.Runtime, so a change to Microsoft.SemanticKernel.Agents.Runtime can break Microsoft.SemanticKernel.Agents.Runtime.Core, while a change to Microsoft.SemanticKernel.Agents.Runtime.Core can't break Microsoft.SemanticKernel.Agents.Runtime.
Position
Below the diagonal: Microsoft.SemanticKernel.Agents.Runtime.Core uses a module listed above it, which is the healthy direction.
11→33 Microsoft.SemanticKernel.Services uses Microsoft.SemanticKernelpart of a loop✕
Connections
11 pairs of types, where a type in Microsoft.SemanticKernel.Services uses a type in Microsoft.SemanticKernel.
Microsoft.SemanticKernel.Services uses Microsoft.SemanticKernel, so a change to Microsoft.SemanticKernel can break Microsoft.SemanticKernel.Services, while a change to Microsoft.SemanticKernel.Services can't break Microsoft.SemanticKernel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
1 pair of types, where a type in python.semantic_kernel.agents.runtime.core.core_runtime uses a type in python.semantic_kernel.agents.runtime.core.agent_id.
python.semantic_kernel.agents.runtime.core.core_runtime uses python.semantic_kernel.agents.runtime.core.agent_id, so a change to python.semantic_kernel.agents.runtime.core.agent_id can break python.semantic_kernel.agents.runtime.core.core_runtime, while a change to python.semantic_kernel.agents.runtime.core.core_runtime can't break python.semantic_kernel.agents.runtime.core.agent_id.
Position
Below the diagonal: python.semantic_kernel.agents.runtime.core.core_runtime uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.agents.strategies.termination.termination_strategy uses a type in python.semantic_kernel.kernel_pydantic.
python.semantic_kernel.agents.strategies.termination.termination_strategy uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.agents.strategies.termination.termination_strategy, while a change to python.semantic_kernel.agents.strategies.termination.termination_strategy can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.agents.strategies.termination.termination_strategy uses a module listed above it, which is the healthy direction.
python.semantic_kernel.connectors.ai.prompt_execution_settings uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.connectors.ai.prompt_execution_settings, while a change to python.semantic_kernel.connectors.ai.prompt_execution_settings can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.connectors.ai.prompt_execution_settings uses a module listed above it, which is the healthy direction.
python.semantic_kernel.contents.kernel_content uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.contents.kernel_content, while a change to python.semantic_kernel.contents.kernel_content can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.contents.kernel_content uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.functions.kernel_function uses a type in python.semantic_kernel.filters.functions.function_invocation_context.
python.semantic_kernel.functions.kernel_function uses python.semantic_kernel.filters.functions.function_invocation_context, so a change to python.semantic_kernel.filters.functions.function_invocation_context can break python.semantic_kernel.functions.kernel_function, while a change to python.semantic_kernel.functions.kernel_function can't break python.semantic_kernel.filters.functions.function_invocation_context.
Position
Below the diagonal: python.semantic_kernel.functions.kernel_function uses a module listed above it, which is the healthy direction.
python.semantic_kernel.functions.kernel_function uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.functions.kernel_function, while a change to python.semantic_kernel.functions.kernel_function can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.functions.kernel_function uses a module listed above it, which is the healthy direction.
python.semantic_kernel.memory.memory_store_base uses python.semantic_kernel.memory.memory_record, so a change to python.semantic_kernel.memory.memory_record can break python.semantic_kernel.memory.memory_store_base, while a change to python.semantic_kernel.memory.memory_store_base can't break python.semantic_kernel.memory.memory_record.
Position
Below the diagonal: python.semantic_kernel.memory.memory_store_base uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.processes.kernel_process.kernel_process_step uses a type in python.semantic_kernel.kernel_pydantic.
python.semantic_kernel.processes.kernel_process.kernel_process_step uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.processes.kernel_process.kernel_process_step, while a change to python.semantic_kernel.processes.kernel_process.kernel_process_step can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.processes.kernel_process.kernel_process_step uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.processes.kernel_process.kernel_process_step_context uses a type in python.semantic_kernel.kernel_pydantic.
python.semantic_kernel.processes.kernel_process.kernel_process_step_context uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.processes.kernel_process.kernel_process_step_context, while a change to python.semantic_kernel.processes.kernel_process.kernel_process_step_context can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.processes.kernel_process.kernel_process_step_context uses a module listed above it, which is the healthy direction.
python.semantic_kernel.services.ai_service_client_base uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.services.ai_service_client_base, while a change to python.semantic_kernel.services.ai_service_client_base can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.services.ai_service_client_base uses a module listed above it, which is the healthy direction.
Microsoft.SemanticKernel.ChatCompletion uses Microsoft.SemanticKernel.Services, so a change to Microsoft.SemanticKernel.Services can break Microsoft.SemanticKernel.ChatCompletion, while a change to Microsoft.SemanticKernel.ChatCompletion can't break Microsoft.SemanticKernel.Services.
Position
Below the diagonal: Microsoft.SemanticKernel.ChatCompletion uses a module listed above it, which is the healthy direction.
21→33 Microsoft.SemanticKernel.ChatCompletion uses Microsoft.SemanticKernelpart of a loop✕
Connections
31 pairs of types, where a type in Microsoft.SemanticKernel.ChatCompletion uses a type in Microsoft.SemanticKernel. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Microsoft.SemanticKernel.ChatCompletion uses Microsoft.SemanticKernel, so a change to Microsoft.SemanticKernel can break Microsoft.SemanticKernel.ChatCompletion, while a change to Microsoft.SemanticKernel.ChatCompletion can't break Microsoft.SemanticKernel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
Microsoft.SemanticKernel.Embeddings uses Microsoft.SemanticKernel.Services, so a change to Microsoft.SemanticKernel.Services can break Microsoft.SemanticKernel.Embeddings, while a change to Microsoft.SemanticKernel.Embeddings can't break Microsoft.SemanticKernel.Services.
Position
Below the diagonal: Microsoft.SemanticKernel.Embeddings uses a module listed above it, which is the healthy direction.
22→33 Microsoft.SemanticKernel.Embeddings uses Microsoft.SemanticKernelpart of a loop✕
Connections
3 pairs of types, where a type in Microsoft.SemanticKernel.Embeddings uses a type in Microsoft.SemanticKernel.
Microsoft.SemanticKernel.Embeddings uses Microsoft.SemanticKernel, so a change to Microsoft.SemanticKernel can break Microsoft.SemanticKernel.Embeddings, while a change to Microsoft.SemanticKernel.Embeddings can't break Microsoft.SemanticKernel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
1 pair of types, where a type in python.semantic_kernel.connectors.ai.chat_completion_client_base uses a type in python.semantic_kernel.services.ai_service_client_base.
python.semantic_kernel.connectors.ai.chat_completion_client_base uses python.semantic_kernel.services.ai_service_client_base, so a change to python.semantic_kernel.services.ai_service_client_base can break python.semantic_kernel.connectors.ai.chat_completion_client_base, while a change to python.semantic_kernel.connectors.ai.chat_completion_client_base can't break python.semantic_kernel.services.ai_service_client_base.
Position
Below the diagonal: python.semantic_kernel.connectors.ai.chat_completion_client_base uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.connectors.ai.embedding_generator_base uses a type in python.semantic_kernel.services.ai_service_client_base.
python.semantic_kernel.connectors.ai.embedding_generator_base uses python.semantic_kernel.services.ai_service_client_base, so a change to python.semantic_kernel.services.ai_service_client_base can break python.semantic_kernel.connectors.ai.embedding_generator_base, while a change to python.semantic_kernel.connectors.ai.embedding_generator_base can't break python.semantic_kernel.services.ai_service_client_base.
Position
Below the diagonal: python.semantic_kernel.connectors.ai.embedding_generator_base uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler uses a type in python.semantic_kernel.kernel_pydantic.
python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler, while a change to python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler uses a type in python.semantic_kernel.connectors.ai.prompt_execution_settings.
python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler uses python.semantic_kernel.connectors.ai.prompt_execution_settings, so a change to python.semantic_kernel.connectors.ai.prompt_execution_settings can break python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler, while a change to python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler can't break python.semantic_kernel.connectors.ai.prompt_execution_settings.
Position
Below the diagonal: python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler uses a module listed above it, which is the healthy direction.
python.semantic_kernel.contents.chat_message_content uses python.semantic_kernel.contents.kernel_content, so a change to python.semantic_kernel.contents.kernel_content can break python.semantic_kernel.contents.chat_message_content, while a change to python.semantic_kernel.contents.chat_message_content can't break python.semantic_kernel.contents.kernel_content.
Position
Below the diagonal: python.semantic_kernel.contents.chat_message_content uses a module listed above it, which is the healthy direction.
Microsoft.SemanticKernel.Agents uses Microsoft.SemanticKernel.ChatCompletion, so a change to Microsoft.SemanticKernel.ChatCompletion can break Microsoft.SemanticKernel.Agents, while a change to Microsoft.SemanticKernel.Agents can't break Microsoft.SemanticKernel.ChatCompletion.
Position
Below the diagonal: Microsoft.SemanticKernel.Agents uses a module listed above it, which is the healthy direction.
27→33 Microsoft.SemanticKernel.Agents uses Microsoft.SemanticKernelpart of a loop✕
Connections
54 pairs of types, where a type in Microsoft.SemanticKernel.Agents uses a type in Microsoft.SemanticKernel. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Microsoft.SemanticKernel.Agents uses Microsoft.SemanticKernel, so a change to Microsoft.SemanticKernel can break Microsoft.SemanticKernel.Agents, while a change to Microsoft.SemanticKernel.Agents can't break Microsoft.SemanticKernel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
Microsoft.SemanticKernel.Connectors.OpenAI uses Microsoft.SemanticKernel.ChatCompletion, so a change to Microsoft.SemanticKernel.ChatCompletion can break Microsoft.SemanticKernel.Connectors.OpenAI, while a change to Microsoft.SemanticKernel.Connectors.OpenAI can't break Microsoft.SemanticKernel.ChatCompletion.
Position
Below the diagonal: Microsoft.SemanticKernel.Connectors.OpenAI uses a module listed above it, which is the healthy direction.
Microsoft.SemanticKernel.Connectors.OpenAI uses Microsoft.SemanticKernel.Embeddings, so a change to Microsoft.SemanticKernel.Embeddings can break Microsoft.SemanticKernel.Connectors.OpenAI, while a change to Microsoft.SemanticKernel.Connectors.OpenAI can't break Microsoft.SemanticKernel.Embeddings.
Position
Below the diagonal: Microsoft.SemanticKernel.Connectors.OpenAI uses a module listed above it, which is the healthy direction.
28→33 Microsoft.SemanticKernel.Connectors.OpenAI uses Microsoft.SemanticKernelpart of a loop✕
Connections
48 pairs of types, where a type in Microsoft.SemanticKernel.Connectors.OpenAI uses a type in Microsoft.SemanticKernel. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Microsoft.SemanticKernel.Connectors.OpenAI uses Microsoft.SemanticKernel, so a change to Microsoft.SemanticKernel can break Microsoft.SemanticKernel.Connectors.OpenAI, while a change to Microsoft.SemanticKernel.Connectors.OpenAI can't break Microsoft.SemanticKernel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
1 pair of types, where a type in python.semantic_kernel.connectors.ai.open_ai.services.azure_config_base uses a type in python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler.
python.semantic_kernel.connectors.ai.open_ai.services.azure_config_base uses python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler, so a change to python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler can break python.semantic_kernel.connectors.ai.open_ai.services.azure_config_base, while a change to python.semantic_kernel.connectors.ai.open_ai.services.azure_config_base can't break python.semantic_kernel.connectors.ai.open_ai.services.open_ai_handler.
Position
Below the diagonal: python.semantic_kernel.connectors.ai.open_ai.services.azure_config_base uses a module listed above it, which is the healthy direction.
python.semantic_kernel.contents.chat_history uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.contents.chat_history, while a change to python.semantic_kernel.contents.chat_history can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.contents.chat_history uses a module listed above it, which is the healthy direction.
python.semantic_kernel.contents.chat_history uses python.semantic_kernel.contents.chat_message_content, so a change to python.semantic_kernel.contents.chat_message_content can break python.semantic_kernel.contents.chat_history, while a change to python.semantic_kernel.contents.chat_history can't break python.semantic_kernel.contents.chat_message_content.
Position
Below the diagonal: python.semantic_kernel.contents.chat_history uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.contents.streaming_chat_message_content uses a type in python.semantic_kernel.contents.chat_message_content.
python.semantic_kernel.contents.streaming_chat_message_content uses python.semantic_kernel.contents.chat_message_content, so a change to python.semantic_kernel.contents.chat_message_content can break python.semantic_kernel.contents.streaming_chat_message_content, while a change to python.semantic_kernel.contents.streaming_chat_message_content can't break python.semantic_kernel.contents.chat_message_content.
Position
Below the diagonal: python.semantic_kernel.contents.streaming_chat_message_content uses a module listed above it, which is the healthy direction.
python.semantic_kernel.data.vector uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.data.vector, while a change to python.semantic_kernel.data.vector can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.data.vector uses a module listed above it, which is the healthy direction.
python.semantic_kernel.data.vector uses python.semantic_kernel.functions.kernel_function, so a change to python.semantic_kernel.functions.kernel_function can break python.semantic_kernel.data.vector, while a change to python.semantic_kernel.data.vector can't break python.semantic_kernel.functions.kernel_function.
Position
Below the diagonal: python.semantic_kernel.data.vector uses a module listed above it, which is the healthy direction.
python.semantic_kernel.data.vector uses python.semantic_kernel.connectors.ai.embedding_generator_base, so a change to python.semantic_kernel.connectors.ai.embedding_generator_base can break python.semantic_kernel.data.vector, while a change to python.semantic_kernel.data.vector can't break python.semantic_kernel.connectors.ai.embedding_generator_base.
Position
Below the diagonal: python.semantic_kernel.data.vector uses a module listed above it, which is the healthy direction.
Microsoft.SemanticKernel uses Microsoft.SemanticKernel.Services, so a change to Microsoft.SemanticKernel.Services can break Microsoft.SemanticKernel, while a change to Microsoft.SemanticKernel can't break Microsoft.SemanticKernel.Services.
Position
Below the diagonal: Microsoft.SemanticKernel uses a module listed above it, which is the healthy direction.
Microsoft.SemanticKernel uses Microsoft.SemanticKernel.ChatCompletion, so a change to Microsoft.SemanticKernel.ChatCompletion can break Microsoft.SemanticKernel, while a change to Microsoft.SemanticKernel can't break Microsoft.SemanticKernel.ChatCompletion.
Position
Below the diagonal: Microsoft.SemanticKernel uses a module listed above it, which is the healthy direction.
Microsoft.SemanticKernel uses Microsoft.SemanticKernel.Agents, so a change to Microsoft.SemanticKernel.Agents can break Microsoft.SemanticKernel, while a change to Microsoft.SemanticKernel can't break Microsoft.SemanticKernel.Agents.
Position
Below the diagonal: Microsoft.SemanticKernel uses a module listed above it, which is the healthy direction.
Microsoft.SemanticKernel uses Microsoft.SemanticKernel.Connectors.OpenAI, so a change to Microsoft.SemanticKernel.Connectors.OpenAI can break Microsoft.SemanticKernel, while a change to Microsoft.SemanticKernel can't break Microsoft.SemanticKernel.Connectors.OpenAI.
Position
Below the diagonal: Microsoft.SemanticKernel uses a module listed above it, which is the healthy direction.
python.semantic_kernel.kernel uses python.semantic_kernel.contents.chat_history, so a change to python.semantic_kernel.contents.chat_history can break python.semantic_kernel.kernel, while a change to python.semantic_kernel.kernel can't break python.semantic_kernel.contents.chat_history.
Position
Below the diagonal: python.semantic_kernel.kernel uses a module listed above it, which is the healthy direction.
27 pairs of types, where a type in Microsoft.SemanticKernel.Agents.Orchestration uses a type in Microsoft.SemanticKernel.Agents.Runtime. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Microsoft.SemanticKernel.Agents.Orchestration uses Microsoft.SemanticKernel.Agents.Runtime, so a change to Microsoft.SemanticKernel.Agents.Runtime can break Microsoft.SemanticKernel.Agents.Orchestration, while a change to Microsoft.SemanticKernel.Agents.Orchestration can't break Microsoft.SemanticKernel.Agents.Runtime.
Position
Below the diagonal: Microsoft.SemanticKernel.Agents.Orchestration uses a module listed above it, which is the healthy direction.
Microsoft.SemanticKernel.Agents.Orchestration uses Microsoft.SemanticKernel.Agents.Runtime.Core, so a change to Microsoft.SemanticKernel.Agents.Runtime.Core can break Microsoft.SemanticKernel.Agents.Orchestration, while a change to Microsoft.SemanticKernel.Agents.Orchestration can't break Microsoft.SemanticKernel.Agents.Runtime.Core.
Position
Below the diagonal: Microsoft.SemanticKernel.Agents.Orchestration uses a module listed above it, which is the healthy direction.
Microsoft.SemanticKernel.Agents.Orchestration uses Microsoft.SemanticKernel.Agents, so a change to Microsoft.SemanticKernel.Agents can break Microsoft.SemanticKernel.Agents.Orchestration, while a change to Microsoft.SemanticKernel.Agents.Orchestration can't break Microsoft.SemanticKernel.Agents.
Position
Below the diagonal: Microsoft.SemanticKernel.Agents.Orchestration uses a module listed above it, which is the healthy direction.
Microsoft.SemanticKernel.Agents.Orchestration uses Microsoft.SemanticKernel, so a change to Microsoft.SemanticKernel can break Microsoft.SemanticKernel.Agents.Orchestration, while a change to Microsoft.SemanticKernel.Agents.Orchestration can't break Microsoft.SemanticKernel.
Position
Below the diagonal: Microsoft.SemanticKernel.Agents.Orchestration uses a module listed above it, which is the healthy direction.
python.semantic_kernel.agents.agent uses python.semantic_kernel.agents.channels.agent_channel, so a change to python.semantic_kernel.agents.channels.agent_channel can break python.semantic_kernel.agents.agent, while a change to python.semantic_kernel.agents.agent can't break python.semantic_kernel.agents.channels.agent_channel.
Position
Below the diagonal: python.semantic_kernel.agents.agent uses a module listed above it, which is the healthy direction.
python.semantic_kernel.agents.agent uses python.semantic_kernel.functions.kernel_arguments, so a change to python.semantic_kernel.functions.kernel_arguments can break python.semantic_kernel.agents.agent, while a change to python.semantic_kernel.agents.agent can't break python.semantic_kernel.functions.kernel_arguments.
Position
Below the diagonal: python.semantic_kernel.agents.agent uses a module listed above it, which is the healthy direction.
python.semantic_kernel.agents.agent uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.agents.agent, while a change to python.semantic_kernel.agents.agent can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.agents.agent uses a module listed above it, which is the healthy direction.
python.semantic_kernel.agents.agent uses python.semantic_kernel.contents.chat_message_content, so a change to python.semantic_kernel.contents.chat_message_content can break python.semantic_kernel.agents.agent, while a change to python.semantic_kernel.agents.agent can't break python.semantic_kernel.contents.chat_message_content.
Position
Below the diagonal: python.semantic_kernel.agents.agent uses a module listed above it, which is the healthy direction.
python.semantic_kernel.agents.agent uses python.semantic_kernel.kernel, so a change to python.semantic_kernel.kernel can break python.semantic_kernel.agents.agent, while a change to python.semantic_kernel.agents.agent can't break python.semantic_kernel.kernel.
Position
Below the diagonal: python.semantic_kernel.agents.agent uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.agents.orchestration.agent_actor_base uses a type in python.semantic_kernel.agents.runtime.core.message_context.
python.semantic_kernel.agents.orchestration.agent_actor_base uses python.semantic_kernel.agents.runtime.core.message_context, so a change to python.semantic_kernel.agents.runtime.core.message_context can break python.semantic_kernel.agents.orchestration.agent_actor_base, while a change to python.semantic_kernel.agents.orchestration.agent_actor_base can't break python.semantic_kernel.agents.runtime.core.message_context.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.agent_actor_base uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.agents.orchestration.agent_actor_base uses a type in python.semantic_kernel.contents.chat_message_content.
python.semantic_kernel.agents.orchestration.agent_actor_base uses python.semantic_kernel.contents.chat_message_content, so a change to python.semantic_kernel.contents.chat_message_content can break python.semantic_kernel.agents.orchestration.agent_actor_base, while a change to python.semantic_kernel.agents.orchestration.agent_actor_base can't break python.semantic_kernel.contents.chat_message_content.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.agent_actor_base uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.agents.orchestration.agent_actor_base uses a type in python.semantic_kernel.contents.streaming_chat_message_content.
python.semantic_kernel.agents.orchestration.agent_actor_base uses python.semantic_kernel.contents.streaming_chat_message_content, so a change to python.semantic_kernel.contents.streaming_chat_message_content can break python.semantic_kernel.agents.orchestration.agent_actor_base, while a change to python.semantic_kernel.agents.orchestration.agent_actor_base can't break python.semantic_kernel.contents.streaming_chat_message_content.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.agent_actor_base uses a module listed above it, which is the healthy direction.
python.semantic_kernel.agents.orchestration.agent_actor_base uses python.semantic_kernel.agents.agent, so a change to python.semantic_kernel.agents.agent can break python.semantic_kernel.agents.orchestration.agent_actor_base, while a change to python.semantic_kernel.agents.orchestration.agent_actor_base can't break python.semantic_kernel.agents.agent.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.agent_actor_base uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in python.semantic_kernel.agents.orchestration.group_chat uses a type in python.semantic_kernel.agents.runtime.core.message_context.
python.semantic_kernel.agents.orchestration.group_chat uses python.semantic_kernel.agents.runtime.core.message_context, so a change to python.semantic_kernel.agents.runtime.core.message_context can break python.semantic_kernel.agents.orchestration.group_chat, while a change to python.semantic_kernel.agents.orchestration.group_chat can't break python.semantic_kernel.agents.runtime.core.message_context.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.group_chat uses a module listed above it, which is the healthy direction.
python.semantic_kernel.agents.orchestration.group_chat uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.agents.orchestration.group_chat, while a change to python.semantic_kernel.agents.orchestration.group_chat can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.group_chat uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.agents.orchestration.group_chat uses a type in python.semantic_kernel.agents.runtime.core.core_runtime.
python.semantic_kernel.agents.orchestration.group_chat uses python.semantic_kernel.agents.runtime.core.core_runtime, so a change to python.semantic_kernel.agents.runtime.core.core_runtime can break python.semantic_kernel.agents.orchestration.group_chat, while a change to python.semantic_kernel.agents.orchestration.group_chat can't break python.semantic_kernel.agents.runtime.core.core_runtime.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.group_chat uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in python.semantic_kernel.agents.orchestration.group_chat uses a type in python.semantic_kernel.contents.chat_message_content.
python.semantic_kernel.agents.orchestration.group_chat uses python.semantic_kernel.contents.chat_message_content, so a change to python.semantic_kernel.contents.chat_message_content can break python.semantic_kernel.agents.orchestration.group_chat, while a change to python.semantic_kernel.agents.orchestration.group_chat can't break python.semantic_kernel.contents.chat_message_content.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.group_chat uses a module listed above it, which is the healthy direction.
python.semantic_kernel.agents.orchestration.group_chat uses python.semantic_kernel.contents.chat_history, so a change to python.semantic_kernel.contents.chat_history can break python.semantic_kernel.agents.orchestration.group_chat, while a change to python.semantic_kernel.agents.orchestration.group_chat can't break python.semantic_kernel.contents.chat_history.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.group_chat uses a module listed above it, which is the healthy direction.
python.semantic_kernel.agents.orchestration.group_chat uses python.semantic_kernel.agents.agent, so a change to python.semantic_kernel.agents.agent can break python.semantic_kernel.agents.orchestration.group_chat, while a change to python.semantic_kernel.agents.orchestration.group_chat can't break python.semantic_kernel.agents.agent.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.group_chat uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in python.semantic_kernel.agents.orchestration.group_chat uses a type in python.semantic_kernel.agents.orchestration.agent_actor_base.
python.semantic_kernel.agents.orchestration.group_chat uses python.semantic_kernel.agents.orchestration.agent_actor_base, so a change to python.semantic_kernel.agents.orchestration.agent_actor_base can break python.semantic_kernel.agents.orchestration.group_chat, while a change to python.semantic_kernel.agents.orchestration.group_chat can't break python.semantic_kernel.agents.orchestration.agent_actor_base.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.group_chat uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.agents.orchestration.handoffs uses a type in python.semantic_kernel.agents.runtime.core.message_context.
python.semantic_kernel.agents.orchestration.handoffs uses python.semantic_kernel.agents.runtime.core.message_context, so a change to python.semantic_kernel.agents.runtime.core.message_context can break python.semantic_kernel.agents.orchestration.handoffs, while a change to python.semantic_kernel.agents.orchestration.handoffs can't break python.semantic_kernel.agents.runtime.core.message_context.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.handoffs uses a module listed above it, which is the healthy direction.
python.semantic_kernel.agents.orchestration.handoffs uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.agents.orchestration.handoffs, while a change to python.semantic_kernel.agents.orchestration.handoffs can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.handoffs uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.agents.orchestration.handoffs uses a type in python.semantic_kernel.agents.runtime.core.core_runtime.
python.semantic_kernel.agents.orchestration.handoffs uses python.semantic_kernel.agents.runtime.core.core_runtime, so a change to python.semantic_kernel.agents.runtime.core.core_runtime can break python.semantic_kernel.agents.orchestration.handoffs, while a change to python.semantic_kernel.agents.orchestration.handoffs can't break python.semantic_kernel.agents.runtime.core.core_runtime.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.handoffs uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in python.semantic_kernel.agents.orchestration.handoffs uses a type in python.semantic_kernel.contents.chat_message_content.
python.semantic_kernel.agents.orchestration.handoffs uses python.semantic_kernel.contents.chat_message_content, so a change to python.semantic_kernel.contents.chat_message_content can break python.semantic_kernel.agents.orchestration.handoffs, while a change to python.semantic_kernel.agents.orchestration.handoffs can't break python.semantic_kernel.contents.chat_message_content.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.handoffs uses a module listed above it, which is the healthy direction.
python.semantic_kernel.agents.orchestration.handoffs uses python.semantic_kernel.agents.agent, so a change to python.semantic_kernel.agents.agent can break python.semantic_kernel.agents.orchestration.handoffs, while a change to python.semantic_kernel.agents.orchestration.handoffs can't break python.semantic_kernel.agents.agent.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.handoffs uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.agents.orchestration.handoffs uses a type in python.semantic_kernel.agents.orchestration.agent_actor_base.
python.semantic_kernel.agents.orchestration.handoffs uses python.semantic_kernel.agents.orchestration.agent_actor_base, so a change to python.semantic_kernel.agents.orchestration.agent_actor_base can break python.semantic_kernel.agents.orchestration.handoffs, while a change to python.semantic_kernel.agents.orchestration.handoffs can't break python.semantic_kernel.agents.orchestration.agent_actor_base.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.handoffs uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in python.semantic_kernel.agents.orchestration.magentic uses a type in python.semantic_kernel.agents.runtime.core.message_context.
python.semantic_kernel.agents.orchestration.magentic uses python.semantic_kernel.agents.runtime.core.message_context, so a change to python.semantic_kernel.agents.runtime.core.message_context can break python.semantic_kernel.agents.orchestration.magentic, while a change to python.semantic_kernel.agents.orchestration.magentic can't break python.semantic_kernel.agents.runtime.core.message_context.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.magentic uses a module listed above it, which is the healthy direction.
python.semantic_kernel.agents.orchestration.magentic uses python.semantic_kernel.kernel_pydantic, so a change to python.semantic_kernel.kernel_pydantic can break python.semantic_kernel.agents.orchestration.magentic, while a change to python.semantic_kernel.agents.orchestration.magentic can't break python.semantic_kernel.kernel_pydantic.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.magentic uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.agents.orchestration.magentic uses a type in python.semantic_kernel.agents.runtime.core.core_runtime.
python.semantic_kernel.agents.orchestration.magentic uses python.semantic_kernel.agents.runtime.core.core_runtime, so a change to python.semantic_kernel.agents.runtime.core.core_runtime can break python.semantic_kernel.agents.orchestration.magentic, while a change to python.semantic_kernel.agents.orchestration.magentic can't break python.semantic_kernel.agents.runtime.core.core_runtime.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.magentic uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.agents.orchestration.magentic uses a type in python.semantic_kernel.connectors.ai.prompt_execution_settings.
python.semantic_kernel.agents.orchestration.magentic uses python.semantic_kernel.connectors.ai.prompt_execution_settings, so a change to python.semantic_kernel.connectors.ai.prompt_execution_settings can break python.semantic_kernel.agents.orchestration.magentic, while a change to python.semantic_kernel.agents.orchestration.magentic can't break python.semantic_kernel.connectors.ai.prompt_execution_settings.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.magentic uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in python.semantic_kernel.agents.orchestration.magentic uses a type in python.semantic_kernel.connectors.ai.chat_completion_client_base.
python.semantic_kernel.agents.orchestration.magentic uses python.semantic_kernel.connectors.ai.chat_completion_client_base, so a change to python.semantic_kernel.connectors.ai.chat_completion_client_base can break python.semantic_kernel.agents.orchestration.magentic, while a change to python.semantic_kernel.agents.orchestration.magentic can't break python.semantic_kernel.connectors.ai.chat_completion_client_base.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.magentic uses a module listed above it, which is the healthy direction.
4 pairs of types, where a type in python.semantic_kernel.agents.orchestration.magentic uses a type in python.semantic_kernel.contents.chat_message_content.
python.semantic_kernel.agents.orchestration.magentic uses python.semantic_kernel.contents.chat_message_content, so a change to python.semantic_kernel.contents.chat_message_content can break python.semantic_kernel.agents.orchestration.magentic, while a change to python.semantic_kernel.agents.orchestration.magentic can't break python.semantic_kernel.contents.chat_message_content.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.magentic uses a module listed above it, which is the healthy direction.
python.semantic_kernel.agents.orchestration.magentic uses python.semantic_kernel.agents.agent, so a change to python.semantic_kernel.agents.agent can break python.semantic_kernel.agents.orchestration.magentic, while a change to python.semantic_kernel.agents.orchestration.magentic can't break python.semantic_kernel.agents.agent.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.magentic uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in python.semantic_kernel.agents.orchestration.magentic uses a type in python.semantic_kernel.agents.orchestration.agent_actor_base.
python.semantic_kernel.agents.orchestration.magentic uses python.semantic_kernel.agents.orchestration.agent_actor_base, so a change to python.semantic_kernel.agents.orchestration.agent_actor_base can break python.semantic_kernel.agents.orchestration.magentic, while a change to python.semantic_kernel.agents.orchestration.magentic can't break python.semantic_kernel.agents.orchestration.agent_actor_base.
Position
Below the diagonal: python.semantic_kernel.agents.orchestration.magentic uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 52% · Adequate · gated by D17 ·
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 category
Findings
Severity
A05:2025 — Injection
43
High / Critical
A03:2025 — Software Supply Chain Failures
29
High / Critical
Roadmap
First, stabilize the build by resolving all prerelease dependencies and addressing the single vulnerable package to ensure security and stability. Next, clean up explicit debt by removing unnecessary NoWarn suppressions in project files, particularly within Directory.Build.props and connector projects. Then, replace file-scoped pragma disables with modern code structures, focusing on Program.cs and key service files. Finally, refactor write-only private fields to improve code clarity and maintainability.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Vulnerable finding(s) in Dependency Hygiene.
Add a benchmarking harness for the hot paths and run it in CI to catch regressions (for .NET, a BenchmarkDotNet project with [MemoryDiagnoser] to track allocations).
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 — 319
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 — 1404
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 — 1180
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 7
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. 78 of 85 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 7 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 — 85 dimensions across the health lenses
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
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, 2577 of 2903 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.)
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.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
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 MEASURED: the analyzer environment could not build/run the test suite (a target framework / SDK band or targeting pack the analyzer image doesn't carry). This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero. We track the analyzer-image gap so it can be closed; in the meantime, commit the Cobertura/OpenCover/lcov report your CI already produces and real coverage will be read. You can widen what we reach: optional: commit the Cobertura/OpenCover/lcov report your CI already produces, and the real number is read on the next scan.
D10 Test Quality — 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. The 4,764 test(s) behind this row are the ones the C# collector could read, and this repository also carries at least 324 test source file(s) (.py) that it cannot: it parses C# syntax and matches C# test attributes, so a vitest/jest/JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
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 a Python REDACTED/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its Python dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D17 Explicit Debt — 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. The C# workspace loaded this repository's projects but reported a load failure, and the dead-code reference search is unreliable over a graph that did not load cleanly, so it was skipped. The other debt markers on this row were read; dead symbols were not, and their absence from the score is not a finding that the code has none. First load diagnostic: Failure: Msbuild failed when processing the file 'dotnet/samples/Concepts/Concepts.csproj' with message: The URL of repository remote 'origin' is invalid: ''.
D17 Explicit Debt — 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. The 1,273 deducted marker(s) and the 8.5/KLoC density on this row were taken over this repository's .NET projects ALONE: .py (101,941 lines, 44% of production source) went unread, because every marker collector on this path is reached through a C# workspace. A read-only sweep of that source finds at least 36 task marker(s) (TODO/FIXME/HACK/XXX) across 27 file(s) that this score does not count — a floor, since only line comments are read there and D17's other eight marker kinds (suppressions, NoWarn, editorconfig severities, empty catches, commented-out code, Obsolete, dead code, preprocessor branches) need a compiler we do not have for that language. The debt in that source is UNMEASURED — its absence from the score above is a gap in this analyzer's language coverage, not a finding that the code carries none.
D23 Boundary Type-Coupling — 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. Large codebase (122,627 production LoC in the .NET projects) with no declared bounded contexts — cross-boundary type coupling is unassessed Bounded contexts cannot be inferred from a codebase that is not physically organised by them (D-321), so with none declared there are no boundaries for the coupling pass to measure across. You can widen what we reach: name this codebase's bounded contexts (≥2 module groups, e.g. per subsystem) so cross-boundary type coupling can 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"]`.
D27 Navigability — 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. Tracing effort is measured over resolved call sites, and all 2527 sampled here came from .cs files. This repository's .py source is a material share of its production lines and contributed none, so the score above is a verdict about the part that was read. Not a finding that the unread half navigates well — it is unmeasured.
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. `dotnet/src/Agents/Abstractions/AggregatorAgent.cs`, `dotnet/src/Agents/Abstractions/AggregatorChannel.cs`, `dotnet/src/Agents/Abstractions/Internal/ChannelReference.cs`, `dotnet/src/Agents/Abstractions/Serialization/ChatMessageReference.cs`, `dotnet/src/Agents/AzureAI/AzureAIChannel.cs`, … (+71 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.
D39 IL Efficiency — 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. IL NOT MEASURED: the analyzer's own build of this repository failed for an ENVIRONMENT reason (exit 1) — MSBuild's engine or the CLR gave up, or our image does not carry the SDK band/targeting pack this repository needs. This is OUR limitation, not a defect in the repo, and it is not a statement that this repository fails to build. D18 owns the question of whether this repository builds; it was not answered here.
AXR1 Runtime accessibility — 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. Render strategy: boot via AspireAppHost (dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.AppHost/ChatWithAgent.AppHost.csproj). the Aspire AppHost did not expose a crawlable HTTP endpoint in time (or only the dashboard) — no runtime evidence.
IC1 Incompleteness & stubs — 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. 338 further occurrence(s) are not listed individually; the score already reflects all 378.
X2 Cancellation propagation — 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. 278 further occurrence(s) are not listed individually; the score already reflects all 318.
Repo exclusion declarations: 1 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
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.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D11 Test Reliability: Flakiness is inferred from history/markers — Watchdog runs the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
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.
D18 Solution Shape: Build integrity reflects whether the solution compiled in this environment — a build that needs a private feed, a specific SDK, or a generated file absent from the repo can read as broken when it is merely unreproducible here.
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.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
D24 Comment Value: Comment value (WHY vs WHAT) is an LLM judgement over a bounded sample — it is advisory and cannot weigh a comment against the precise code change it was written to explain.
D25 ADR Conformance: ADR conformance is the LLM-scored fraction of sampled code that follows recorded decisions — it checks the decisions that were written down and the slices it sampled, not unrecorded rules or the whole tree.
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.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
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.
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".
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 (7): D19, D20, D21, D22, D24, D25, 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.
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.
99 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was PromptExecutionSettingsExtensions.ToChatOptions at 63. A further 5 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 OpenApiTypeConverter.Convert at 27 — they are counted neither in the figure above nor in this dimension's score. 5 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: dotnet/src/Functions/Functions.OpenApi/Serialization/OpenApiTypeConverter.cs (OpenApiTypeConverter.Convert at 27), dotnet/src/Agents/Bedrock/Extensions/BedrockFunctionSchemaExtensions.cs (BedrockFunctionSchemaExtensions.ToAmazonType at 24), dotnet/src/Extensions/PromptTemplates.Handlebars/HandlebarsPromptTemplate.cs (HandlebarsPromptTemplate.IsSafeType at 18), dotnet/src/Extensions/PromptTemplates.Liquid/LiquidPromptTemplate.cs (LiquidPromptTemplate.IsSafeType at 18), dotnet/src/Functions/Functions.Grpc/GrpcOperationRunner.cs (GrpcOperationRunner.GetNetType at 17). 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.
+ 94 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 14 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with PromptExecutionSettingsExtensions.ToChatOptions (cyclomatic 63), AgentThreadActions._process_stream_events (cyclomatic 56), OracleCollection._lambda_parser (cyclomatic 52). — 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 14 together lifts Cyclomatic Complexity from 6.5 to about 7.3/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 192 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 120 down to 120 or less in Cognitive Complexity — start with AgentThreadActions._process_stream_events (cognitive 165), FlowExecutor.ExecuteFlowAsync (cognitive 151). — 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 2 together lifts Cognitive Complexity from 5.5 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.6 / 10Strong✓ 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.
Resolve the 26 FileTooLong finding(s) in God Classes — start with vector.py, agent_thread_actions.py, responses_agent_thread_actions.py. — One of this dimension's main actionable groups (26 warning-level).
Resolve the 9 MethodTooLong finding(s) in God Classes — start with FlowExecutor.cs, PromptExecutionSettingsExtensions.cs, CodeTokenizer.cs. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 6 ClassTooLong finding(s) in God Classes — start with KernelFunctionFromMethod.cs, MistralClient.cs, GeminiChatCompletionClient.cs. — One of this dimension's main actionable groups (6 warning-level).
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.
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.
549 duplicated block group(s) detected. A further 44 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 186 of the 593 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.
Members sharing a duplicated core (4 members, 50+ identical tokens) · ×17dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:135
+ 189 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 26 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with Program.cs (4), AzureOpenAIKernelBuilderExtensions.cs (3), OllamaServiceCollectionExtensions.DependencyInjection.cs. — One of this dimension's main actionable groups (26 warning-level).
Resolve the 25 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with KernelExtensions.cs (2), vector.py (2), Program.cs (2). — One of this dimension's main actionable groups (25 warning-level).
Resolve the 24 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with agent_thread_actions.py (3), OllamaServiceCollectionExtensions.DependencyInjection.cs (2), BraveTextSearch.cs (2). — One of this dimension's main actionable groups (24 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Stronggated by 1 serious finding✓ 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.
Off the main sequence: Connectors.OpenAI(net10.0)dotnet/src/Connectors/Connectors.OpenAI/Connectors.OpenAI.csproj:1
Off the main sequence: SemanticKernel.Core(net10.0) · ×4dotnet/src/SemanticKernel.Core/SemanticKernel.Core.csproj:1
What to do
Resolve the 1 Off the main sequence finding(s) in Coupling — start with Connectors.OpenAI.csproj. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
All 50 mechanizable ADR(s) are enforced: 48 by analyzers, 2 by tests. Cycles found: 0.
✓ On the Gold path — maintain.
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D9 · Test Distribution9.9 / 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.
8076 test methods: 7476 unit, 561 integration, 0 BDD, 39 e2e. The Python suite contributes 3284 test function(s) across 273 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.9 / 10Stronggated by 46 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
294 skipped (294 with a documented reason), 45 zero-assertion, 1 depending on a live external host, 25 mock references across 4764 tests. Measured on the C# suite only — at least 324 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: RunAsync · ×45dotnet/samples/Concepts/Functions/MethodFunctions.cs:9
Depends on a live external host: ValidateExpectedEmbeddingsForAllMiniLML6V2Asyncdotnet/src/IntegrationTests/Connectors/Onnx/BertOnnxTextEmbeddingGenerationServiceTests.cs:120
Resolve the 45 No assertions finding(s) in Test Quality — start with SafeChatPrompts.cs (8), TextChunkerUsage.cs (3), OpenApiPlugin_PayloadHandling.cs (3). — One of this dimension's main actionable groups (45 warning-level).
Resolve the 1 Depends on a live external host finding(s) in Test Quality — start with BertOnnxTextEmbeddingGenerationServiceTests.cs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests pass reliably, with no flakiness.
Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.
0 flaky across 2 measured tier(s). unit: measured (0 flaky); integration: not included — too large to re-run within its budget; other: not included — too large to re-run within its budget; Python (python, 275 test files): measured (0 flaky).
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.
133 outdated, 1 vulnerable, 6 deprecated, 13 prerelease packages. Those are the NuGet packages; this repository's npm dependencies were read too — 132 outdated of 228 package(s) across 3 lockfile(s).
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 13 Prerelease dependency finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (13 warning-level).
Resolve the 1 Vulnerable finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 6 Deprecated finding(s) in Dependency Hygiene — start with REDACTED (6). — One of this dimension's main actionable groups (6 warning-level).
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
0 of 249 packages use a banned license. ★ DEPTH: this repository's MSBuild projects declare 170 direct `PackageReference`(s), and 80 further package(s) were reached beyond them by closing the graph over nuget.org's own nuspec dependency graph — so a banned licence pulled in only by a dependency's OWN dependencies is inside this verdict. A package whose licence nuget.org could not be asked for is not graded, and version ranges are taken at their lower bound, so this is the closure as that graph states it rather than a restored consumer's exact resolution. ★ COVERAGE OF THIS VERDICT: it grades this repository's NuGet package dependencies and nothing else. The repository also declares a Python REDACTED/requirements.txt (pip/uv/Poetry), 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.
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.
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.
14 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is dotnet/src/Plugins/Plugins.MsGraph/CloudDrivePlugin.cs. Counted over 593 of the 1108 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
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.
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.
1273 deducted debt markers + unmeasured dead symbols across 122627 LoC in the .NET projects (8.5/KLoC) → score 0.0. Dead code not measured: the solution did not load cleanly, so the reference search was skipped. Measured on the .NET source only: .py (44% of production source) was not read, and carries at least 36 uncounted task marker(s) in 27 file(s).
NoWarnInCsproj — 12 warning codes suppressed in one element · ×121dotnet/src/SemanticKernel.UnitTests/SemanticKernel.UnitTests.csproj:9
FileScopedPragmaDisable repeated across 15 files · ×2dotnet/src/Agents/Abstractions/Logging/AgentChatLogMessages.cs:10
+ 18 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 121 NoWarnInCsproj finding(s) in Explicit Debt — start with Directory.Build.props (19), Connectors.OpenAI.csproj (3), Connectors.AzureOpenAI.csproj (3). — One of this dimension's main actionable groups (121 issue-level).
Resolve the 113 FileScopedPragmaDisable finding(s) in Explicit Debt — start with Program.cs (13), BertOnnxTextEmbeddingGenerationService.cs (4), ChatMessageContentTests.cs (3). — One of this dimension's main actionable groups (113 issue-level).
Resolve the 32 WriteOnlyPrivateField finding(s) in Explicit Debt — start with DocumentGenerationService.cs (2), GrpcOperationExtensionsTests.cs (2), WebPluginTests.cs (2). — One of this dimension's main actionable groups (32 issue-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the solution is laid out in a sensible, conventional structure.
Method: Solution structure: project count, decomposition, shell-project detection, build success (confirmed failures cap the score); traced to actual .sln files and binaries. Deterministic.
243 projects, 9450 source files, 280598 hand-written lines of code (122627 production / 157971 test — the split is derived per file: test is what its project, its own path, or a compile-guarded region marks as test, and a file carrying no test signal counts as production), plus 135 generated (machine-written code — designer, scaffolded and tool-emitted files — excluded from quality), 630 inter-project edges. Measured across 3 solutions loaded as one workspace: `dotnet/SK-dotnet.slnx`, `dotnet/MEVD.slnx`, `dotnet/samples/Demos/CopilotAgentPlugins/CopilotAgentPluginsDemoSample/CopilotAgentPluginsDemoSample.sln`.
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.
The repository's root README is excellent: it states the project name (Semantic Kernel), its successor (Microsoft Agent Framework), a strong licensing banner, links to migration guides, and an overview of what the project does. The dotnet/README documents that directory (the semantic-kernel-java repo) rather than the main repository; each README in the set is focused on its own tier and clearly states what it contains. There are no visible defects among the 126 READMEs. The repository's READMEs and architecture/Docs markdown files are comprehensive: the 126 READMEs document their respective directories (e.g. dotnet/samples/Concepts/, dotnet/samples/GettingStartedWithAgents/) rather than the root project, so each one is judged only against its own directory; the architecture/Docs set covers design and implementation with 116 markdown files plus XML coverage across 240 documents. The visible content is clear: a Semantic Kernel migration guide (What's Changed?, Benefits of Migration, Key Changes), an extensive Concepts table of contents listing every SK feature, and GettingStartedWithAgents examples showing how to create agents, use plugins, enable telemetry, and run tests. The repository's READMEs and architecture/Docs markdown files are well documented: 126 READMEs (each for its own directory) plus 116 architecture/design docs cover the project. The XML-doc coverage is strong across many modules, with one gap at OnnxSimpleRAG (0/3). All visible documents are complete per their outlines and serve as guides; there is no single missing section to flag. The repository's READMEs are well written for their directories: each one states what it documents (e.g. the getting started with processes examples, Python documentation examples, or a prompt template engine reference) and gives usage notes plus code samples. The architecture/Docs markdown files (116) cover design topics such as process orchestration, Dapr integration, and model compatibility; the XML-doc coverage is strong across many modules (e.g. 90% for SemanticKernel.Abstractions net10.0).
Resolve the 15 Low XML-doc coverage finding(s) in Documentation Quality — start with AotCompatibility.csproj, FunctionInvocationApproval.csproj, HomeAutomation.csproj. — One of this dimension's main actionable groups (15 warning-level).
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR QualityStrong◐ 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.
Evaluated 73 ADR(s) individually; mean quality 8.2/10 (consistently complete and clear). 2 flagged with a specific gap.
Consequences/trade-offs (e.g. cost of keeping chat-completion fallback) are not present in the visible portion before the clip markerdocs/decisions/0038-completion-service-selection.md
Decision outcome (when the decision is implemented) is marked 'TBD' and not yet stateddocs/decisions/0066-concepts-guidelines.md
ADR has no Consequences section · ×51docs/decisions/0072-context-based-function-selection.md:11detected by adr-integrity
ADR decides a question another record already decided · ×31docs/decisions/0002-java-folder-structure.md:9detected by adr-integrity
ADR has no Decision and Consequences section · ×7docs/decisions/0054-processes.md:11detected by adr-integrity
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 51 ADR has no Consequences section finding(s) in ADR Quality — start with 0072-context-based-function-selection.md, 0068-structured-data-connector.md, 0067-hybrid-search.md. — One of this dimension's main actionable groups (51 recommendation-level).
Resolve the 1 Consequences/trade-offs (e.g. cost of keeping chat-completion fallback)… finding(s) in ADR Quality — start with 0038-completion-service-selection.md. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Decision outcome (when the decision is implemented) is marked 'TBD' and… finding(s) in ADR Quality — start with 0066-concepts-guidelines.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.
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.
0 naming inconsistencies across 200 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyWeak◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
Duplicate configuration types with identical fields. `AuthServerSettings` and `ServerSettings` (in legacy_as_server) have the exact same fields (host, port, server_url, auth_callback_path). This suggests `ServerSettings` is a legacy duplicate or `AuthServerSettings` is a renamed version without removing the old one.
Confusingly similar provider classes with different naming and slightly different constructor signatures. `SimpleAuthProvider` takes `auth_callback_path` while `SimpleOAuthProvider` takes `auth_callback_url`. The intent appears to be the same (handling OAuth callbacks), but the naming (`Provider` vs `OAuthProvider`) and parameter names (`path` vs `url`) are inconsistent.
Ambiguous entry points in the same module. `main.main()` and `main.cli()` are both exposed. It is unclear if one is deprecated, if they serve different purposes (e.g., programmatic vs CLI), or if one is redundant.
Inconsistent main entry point signatures across modules. `legacy_as_server.main` and `server.main` both serve as CLI entry points but have different parameters. `server.main` requires `auth_server` and `oauth_strict`, while `legacy_as_server.main` does not. This creates confusion for users trying to start the service.
What to do
Resolve the 1 Duplicate configuration types with identical fields.… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Confusingly similar provider classes with different naming and slightly… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Ambiguous entry points in the same module. `main.main()` and… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D24 · Comment ValueExemplary◐ Sampled · advisory
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Judged by language model at low temperature (0.0-0.1) on deterministically sampled inline comments with surrounding code; findings verified back to sampled comments by substring match. Advisory, sampled.
What it measures: Whether the code actually follows the decisions recorded in the project's ADRs.
Method: Judged by language model at low temperature against ADRs plus a deterministic structural code summary; findings linked to repo-rooted ADR paths for traceability. Advisory.
1 of 153 projects flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
✓ On the Gold path — maintain.
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D27 · Navigability7.8 / 10Strong✓ Tool-verified
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
86 % of calls cross a namespace and 4 % go through an interface, but 87 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: large — vertical-slice locality expected. Measured over the .cs source only — this repository's .py was not sampled for call sites, so this score covers part of the tree, not all of it.
Resolve the 2 Pass-through layer finding(s) in Navigability — start with HttpResponseStream.cs, GoogleAIEmbeddingGenerator.cs. — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d27_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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).
43 finding(s): 0 critical, 13 high, 29 medium, 1 low. 3 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 545 file(s) — `dotnet/samples/Concepts/Agents/AzureAIAgent_FileManipulation.cs` (line 13), `dotnet/samples/Concepts/Agents/AzureAIAgent_Streaming.cs` (line 14), `dotnet/samples/Concepts/Agents/ChatCompletion_ContextualFunctionSelection.cs` (line 23, lines 163–221), `dotnet/samples/Concepts/Agents/ChatCompletion_FunctionTermination.cs` (line 14, lines 272–273, line 286), `dotnet/samples/Concepts/Agents/ChatCompletion_HistoryReducer.cs` (line 14), … (+540 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. In 467 of those file(s) — `dotnet/samples/Concepts/Agents/AzureAIAgent_FileManipulation.cs`, `dotnet/samples/Concepts/Agents/AzureAIAgent_Streaming.cs`, `dotnet/samples/Concepts/Agents/ChatCompletion_ContextualFunctionSelection.cs`, `dotnet/samples/Concepts/Agents/ChatCompletion_FunctionTermination.cs`, `dotnet/samples/Concepts/Agents/ChatCompletion_HistoryReducer.cs`, … (+462 more) — the break is a C# primary constructor, which semgrep's grammar cannot parse and which hides the type from every rule scoped to it; those files were re-scanned from a shadow copy with the constructor's parameter list blanked (line and column preserving), which restores the type to the rules, and 0 additional row(s) came from that pass. Only the header's own parameter list is unread in them. In 44 of those file(s) — `dotnet/samples/Concepts/Agents/ChatCompletion_ContextualFunctionSelection.cs`, `dotnet/samples/Concepts/Agents/ComplexChat_NestedShopper.cs`, `dotnet/samples/Concepts/ChatCompletion/AzureOpenAI_ChatCompletionStreaming.cs`, `dotnet/samples/Concepts/ChatCompletion/Ollama_ChatCompletion.cs`, `dotnet/samples/Concepts/ChatCompletion/Ollama_ChatCompletionStreaming.cs`, … (+39 more) — the break is at a TYPE DECLARATION (a C# primary constructor semgrep's grammar cannot parse), so the loss is wider than the named lines: rules scoped to that type see no type to scope to and are blind over its whole body, while rules matching statements keep working there. Absence of a type-scoped finding in those types is not evidence of anything. Separately, one or more rules could not re-parse an embedded snippet in 6 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
+ 9 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
No action in Static Analysis (SAST) — all 3 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 (3 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 6 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (6). — One of this dimension's main actionable groups (6 issue-level).
Resolve the 3 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
318 of 593 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs. Counted over 593 of the 1108 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Most significant orphaned file · ×3dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:1
Concentrated knowledge decay
What to do
Resolve the 315 Orphaned file finding(s) in Knowledge Freshness — start with AgentDefinitionExtensions.cs (3), RunPollingOptions.cs (2), AssistantThreadActions.cs. — One of this dimension's main actionable groups (315 recommendation-level).
Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with MistralClient.cs, Workflow.cs, AgentThreadActions.cs. — One of this dimension's main actionable groups (3 recommendation-level).
Resolve the 1 Concentrated knowledge decay 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.
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.
Resolve the 2 Change coupling finding(s) in Change Coupling — start with AzureOpenAIChatCompletionService.cs, HuggingFaceTextEmbeddingGenerationService.cs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 4 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
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.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 153 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.
Other · Architecture — Whether any singleton service captures a scoped/transient dependency — a silent lifetime/threading bug.
Method: Roslyn scan: DI registrations parsed from AddSingleton/Scoped/Transient; each singleton checked for captured shorter-lifetime dependencies. Exhaustive, deterministic.
`Worker` is registered as a SINGLETON but its constructor takes `Kernel kernel`, which is registered as Transient. The singleton captures one instance of the transient dependency forever — defeating its lifetime (a per-request DbContext shared across all requests is a classic data-corruption/threading bug). Make the singleton resolve `Kernel` per-use (inject `IServiceScopeFactory` or a factory func), or align the lifetimes. — dotnet/samples/Demos/HomeAutomation/Worker.cs:16
What to do
Don't inject scoped/transient services into singletons; resolve them per-use via IServiceScopeFactory or a factory delegate, or align the lifetimes.
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.
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.
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.
`MyLightPlugin` is a singleton (one shared instance) but mutates instance state outside any lock (_turnedOn; e.g. `_turnedOn` at line 20). — dotnet/samples/Demos/HomeAutomation/Plugins/MyLightPlugin.cs:11
`AudioPlaybackService` is a singleton (one shared instance) but mutates instance state outside any lock (_waveOut, _isPlaying; e.g. `_waveOut` at line 31). — dotnet/samples/Demos/VoiceChat/Services/AudioPlaybackService.cs:6
`VadService` is a singleton (one shared instance) but mutates instance state outside any lock (_preroll, _inSpeech, _speech, _silenceFrames; e.g. `_preroll` at line 74). — dotnet/samples/Demos/VoiceChat/Services/VadService.cs:5
`ResourceTemplateDefinition` is a singleton (one shared instance) but mutates instance state outside any lock (_kernelFunction, Kernel, _regex; e.g. `_kernelFunction` at line 58). — dotnet/samples/Demos/ModelContextProtocolClientServer/MCPServer/Resources/ResourceTemplateDefinition.cs:13
`ResourceDefinition` is a singleton (one shared instance) but mutates instance state outside any lock (_kernelFunction, Kernel; e.g. `_kernelFunction` at line 79). — dotnet/samples/Demos/ModelContextProtocolClientServer/MCPServer/Resources/ResourceDefinition.cs:12
`CopilotStudioTokenHandler` is a singleton (one shared instance) but mutates instance state outside any lock (_clientApplication; e.g. `_clientApplication` at line 71). — dotnet/src/Agents/Copilot/CopilotStudioTokenHandler.cs:24
`LocalEventProxyChannel` is a singleton (one shared instance) but mutates instance state outside any lock (_hubConnection; e.g. `_hubConnection` at line 24). — dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/LocalEventProxyChannel.cs:8
`DocumentGenerationGrpcClient` is a singleton (one shared instance) but mutates instance state outside any lock (_grpcChannel, _grpcClient; e.g. `_grpcChannel` at line 23). — dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Grpc/Clients/DocumentGenerationGrpcClient.cs:15
What to do
Keep singletons stateless or back their state with thread-safe types (Concurrent*/Immutable*); otherwise concurrent callers race.
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.
The namespaces (global) ↔ Microsoft.Extensions.AI ↔ Microsoft.SemanticKernel ↔ Microsoft.SemanticKernel.Agents ↔ Microsoft.SemanticKernel.Agents.Chat ↔ Microsoft.SemanticKernel.Agents.Internal ↔ Microsoft.SemanticKernel.Agents.Serialization ↔ Microsoft.SemanticKernel.AudioToText ↔ Microsoft.SemanticKernel.ChatCompletion ↔ Microsoft.SemanticKernel.Connectors.FunctionCalling ↔ Microsoft.SemanticKernel.Connectors.Google ↔ Microsoft.SemanticKernel.Connectors.Google.Core ↔ Microsoft.SemanticKernel.Connectors.Onnx ↔ Microsoft.SemanticKernel.Connectors.OpenAI ↔ Microsoft.SemanticKernel.Data ↔ Microsoft.SemanticKernel.Embeddings ↔ Microsoft.SemanticKernel.Functions ↔ Microsoft.SemanticKernel.Memory ↔ Microsoft.SemanticKernel.Plugins.OpenApi ↔ Microsoft.SemanticKernel.Plugins.OpenApi.Extensions ↔ Microsoft.SemanticKernel.Plugins.Web.Bing ↔ Microsoft.SemanticKernel.Plugins.Web.Brave ↔ Microsoft.SemanticKernel.Plugins.Web.Google ↔ Microsoft.SemanticKernel.Plugins.Web.Tavily ↔ Microsoft.SemanticKernel.Process ↔ Microsoft.SemanticKernel.Process.Internal ↔ Microsoft.SemanticKernel.Process.Runtime ↔ Microsoft.SemanticKernel.PromptTemplates.Handlebars ↔ Microsoft.SemanticKernel.Services ↔ Microsoft.SemanticKernel.TemplateEngine ↔ Microsoft.SemanticKernel.Text ↔ Microsoft.SemanticKernel.TextGeneration ↔ Microsoft.SemanticKernel.TextToAudio ↔ Microsoft.SemanticKernel.TextToImage depend on each other. The lightest dependency in the cycle is (global) → Microsoft.SemanticKernel (ClientResultExceptionExtensions → Microsoft.SemanticKernel.HttpOperationException, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — dotnet/src/InternalUtilities/openai/Extensions/ClientResultExceptionExtensions.cs:6
The namespaces Microsoft.SemanticKernel.Agents.Runtime.Core ↔ Microsoft.SemanticKernel.Agents.Runtime.Core.Internal depend on each other. The lightest dependency in the cycle is Microsoft.SemanticKernel.Agents.Runtime.Core → Microsoft.SemanticKernel.Agents.Runtime.Core.Internal (Microsoft.SemanticKernel.Agents.Runtime.Core.BaseAgent → Microsoft.SemanticKernel.Agents.Runtime.Core.Internal.HandlerInvoker, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — dotnet/src/Agents/Runtime/Core/BaseAgent.cs:11
The namespaces Microsoft.SemanticKernel.Connectors.Amazon ↔ Microsoft.SemanticKernel.Connectors.Amazon.Core depend on each other. The lightest dependency in the cycle is Microsoft.SemanticKernel.Connectors.Amazon → Microsoft.SemanticKernel.Connectors.Amazon.Core (Microsoft.SemanticKernel.Connectors.Amazon.BedrockChatCompletionService → Microsoft.SemanticKernel.Connectors.Amazon.Core.BedrockChatCompletionClient, 3 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — dotnet/src/Connectors/Connectors.Amazon/Bedrock/Services/BedrockChatCompletionService.cs:9
The namespaces Microsoft.SemanticKernel.Connectors.HuggingFace ↔ Microsoft.SemanticKernel.Connectors.HuggingFace.Core depend on each other. The lightest dependency in the cycle is Microsoft.SemanticKernel.Connectors.HuggingFace.Core → Microsoft.SemanticKernel.Connectors.HuggingFace (Microsoft.SemanticKernel.Connectors.HuggingFace.Core.ChatCompletionRequest → Microsoft.SemanticKernel.Connectors.HuggingFace.HuggingFacePromptExecutionSettings, 4 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionRequest.cs:13
The namespaces Microsoft.SemanticKernel.Connectors.MistralAI ↔ Microsoft.SemanticKernel.Connectors.MistralAI.Client depend on each other. The lightest dependency in the cycle is Microsoft.SemanticKernel.Connectors.MistralAI.Client → Microsoft.SemanticKernel.Connectors.MistralAI (Microsoft.SemanticKernel.Connectors.MistralAI.Client.MistralClient → Microsoft.SemanticKernel.Connectors.MistralAI.MistralAIPromptExecutionSettings, 2 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:28
The namespaces Microsoft.SemanticKernel.Experimental.Orchestration ↔ Microsoft.SemanticKernel.Experimental.Orchestration.Abstractions ↔ Microsoft.SemanticKernel.Experimental.Orchestration.Execution depend on each other. The lightest dependency in the cycle is Microsoft.SemanticKernel.Experimental.Orchestration → Microsoft.SemanticKernel.Experimental.Orchestration.Execution (Microsoft.SemanticKernel.Experimental.Orchestration.FlowStatusProvider → Microsoft.SemanticKernel.Experimental.Orchestration.Execution.ExecutionState, 2 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — dotnet/src/Experimental/Orchestration.Flow/Execution/FlowStatusProvider.cs:10
What to do
Break namespace cycles inside a project by moving the shared type to a namespace both sides can use, or by inverting the back edge behind an interface.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
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.
Do you agree with this assessment?
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.
Do you agree with this assessment?
C1 · Data Protection6.5 / 10Adequate✓ Tool-verified
Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.
Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.
What to do
Strengthen data-at-rest protection: vault your keys (Azure Key Vault / AWS KMS / IDataProtector key ring) and encrypt the most sensitive columns (EF HasConversion encryption or provider-native column encryption) — partial coverage still leaves gaps.
Do you agree with this assessment?
C2 · Access Controls7.0 / 10Strong✓ Tool-verified
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Authorization IS enforced here (by imperative guard methods that throw on violation) — this is NOT a claim that the code is unprotected. What's missing is a NAMED rule set: the guards encode the access rules inline, so the rules can't be listed, reviewed or tested apart from the call sites that apply them. Recommendation, not a defect.
What to do
Name the access rules — give each one a named predicate/policy object your guards consult, so the rule set can be reviewed and unit-tested independently of the call sites that enforce it.
Other · Event-Driven — Whether event handlers stay asynchronous (no blocking remote HTTP/gRPC calls awaited inside a handler).
Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.
Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in 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.
A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface. (×12) — dotnet/samples/Demos/VoiceChat/Pipeline/PipelineEvents.cs:21, dotnet/samples/Demos/VoiceChat/Pipeline/PipelineEvents.cs:26, dotnet/samples/Demos/VoiceChat/Pipeline/PipelineEvents.cs:41, …
What to do
Finish or delete NotImplementedException stubs and replace placeholder literals before shipping.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords: members that only throw a "not implemented" exception, methods that take inputs and return a constant, async methods that never await, dead `if (false)` / `#if false` branches, and skeleton types most of whose members are holes. A real, objective slice of technical debt.
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.
`GetAgentCardAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — dotnet/src/Agents/A2A/A2AHostAgent.cs:93
`InvokeAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — dotnet/src/Agents/Abstractions/AggregatorAgent.cs:48
`InvokeStreamingAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — dotnet/src/Agents/Abstractions/AggregatorAgent.cs:59
`WriteYaml` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×3) — dotnet/src/Agents/Yaml/AgentMetadataTypeConverter.cs:58, dotnet/src/Agents/Yaml/ModelConfigurationTypeConverter.cs:58, dotnet/src/Functions/Functions.Yaml/PromptExecutionSettingsTypeConverter.cs:61
`GenerateEmbeddingsAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — dotnet/src/Connectors/Connectors.Onnx/BertOnnxTextEmbeddingGenerationService.cs:188
A branch guarded by a literal `false` can never execute — left-over disabled code. Remove it or restore the real condition. — dotnet/src/Experimental/Process.Core/Internal/KernelProcessStateMetadataExtension.cs:82
`Initialize` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ExternalMessageBufferActorWrapper.cs:33
`Uninitialize` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ExternalMessageBufferActorWrapper.cs:40
`GetExternalMessageChannelAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — dotnet/src/Experimental/Process.Runtime.Dapr/DaprKernelProcessContext.cs:83
`RenderAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. (×2) — dotnet/src/Extensions/PromptTemplates.Handlebars/HandlebarsPromptTemplate.cs:43, dotnet/src/Extensions/PromptTemplates.Liquid/LiquidPromptTemplate.cs:95
A test is skipped ("Setup and run TextToAudioAsync before running this test.") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it. — dotnet/samples/Concepts/AudioToText/OpenAI_AudioToText.cs:18
A test is skipped ("Setup credentials") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it. (×2) — dotnet/samples/Concepts/Plugins/CreatePluginFromOpenApiSpec_Jira.cs:36, dotnet/samples/Concepts/Plugins/ImportPluginFromGrpc.cs:11
A test is skipped ("Run it only after filling the template below") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it. — dotnet/samples/Concepts/Plugins/CreatePluginFromOpenApiSpec_Klarna.cs:16
A test is skipped ("Requires ChatGPT Retrieval Plugin and selected vector DB server up and running") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it. — dotnet/samples/Concepts/RAG/WithPlugins.cs:79
A test is skipped ("Setup Credentials") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it. — dotnet/samples/Concepts/Search/BingAndGooglePlugins.cs:18
A test is skipped ("Requires local model or Huggingface Pro subscription") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it. — dotnet/samples/Concepts/TextGeneration/HuggingFace_TextGeneration.cs:82
A test is skipped ("Uncomment the line to write the audio file output before running this test.") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it. — dotnet/samples/Concepts/TextToAudio/OpenAI_TextToAudio.cs:16
A test is skipped ("Generating the Image can take too long and often break the test") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it. — dotnet/samples/Concepts/TextToImage/OpenAI_TextToImageLegacy.cs:83
A test is skipped ("This test is skipped because it requires a valid KnowledgeBaseId.") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it. — dotnet/samples/GettingStartedWithAgents/BedrockAgent/Step05_BedrockAgent_FileSearch.cs:41
A test is skipped ("Not 100% reliable for github workflows, but useful for dev testing.") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it. — dotnet/src/Agents/UnitTests/AgentChatTests.cs:97
A test is skipped ("For manual verification only") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it. (×3) — dotnet/src/Connectors/Connectors.Amazon.UnitTests/Services/BedrockChatCompletionServiceTests.cs:78, dotnet/src/Connectors/Connectors.Amazon.UnitTests/Services/BedrockTextEmbeddingGenerationServiceTests.cs:77, dotnet/src/Connectors/Connectors.Amazon.UnitTests/Services/BedrockTextGenerationServiceTests.cs:81
A test is skipped ("AutoFunctionInvocationFilter is not supported yet") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it. — dotnet/src/Connectors/Connectors.Ollama.UnitTests/Services/OllamaChatCompletionTests.cs:699
A test is skipped ("Not working running in the console") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it. — dotnet/src/Connectors/Connectors.OpenAI.UnitTests/Services/OpenAIChatCompletionServiceTests.cs:1068
A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers). (×11) — dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:311, dotnet/src/Experimental/Process.Abstractions/KernelProcessEdge.cs:55, dotnet/src/Experimental/Process.Core/ProcessStepBuilder.cs:203, …
What to do
Finish or delete the unfinished stubs (NotImplementedException / empty / constant-returning bodies) — they are dead surface that looks live.
Clear the softer debt: remove commented-out code and dead branches, re-enable or delete skipped tests, and replace blanket warning suppressions with targeted ones.
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
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add a README to the 115 of 153 project(s) that lack one — worth up to 1.5 pts.
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.
Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
Only 50/153 projects share a common root namespace — the code's module identity is inconsistent.
What to do
Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.
Adopt a consistent root-namespace convention (a shared prefix, e.g. Acme.*); short project-file/directory names are fine as long as the RootNamespace is uniform.
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 advertises a microservices architecture, but the repo is a single project with no service manifests — searched for: `microservice`, `service-mesh`, `istio`. 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:28
CONTRIBUTING.md runs `yarn lint:fix`, but no package.json declares a `lint:fix` script. 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:112
README.md installs the package `Microsoft.SemanticKernel` (`dotnet add package Microsoft.SemanticKernel`), but no project or props file references 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.md:61
README.md installs the package `Microsoft.SemanticKernel.Agents.Core` (`dotnet add package Microsoft.SemanticKernel.Agents.Core`), but no project or props file references 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.md:62
dotnet/src/IntegrationTests/README.md names `IntegrationTests/Connectors/Weaviate`, but no file or folder `IntegrationTests/Connectors/Weaviate` 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. — dotnet/src/IntegrationTests/README.md:20
dotnet/src/Agents/Copilot/README.md installs the package `Microsoft.SemanticKernel.Agents.CopilotStudio` (`dotnet add package Microsoft.SemanticKernel.Agents.CopilotStudio --prerelease`), but no project or props file references 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. — dotnet/src/Agents/Copilot/README.md:14
What to do
Reconcile the README with reality: README advertises a microservices architecture, but the repo is a single project with no service manifests; CONTRIBUTING.md runs `yarn lint:fix`, but no package.json declares a `lint:fix` script; README.md installs the package `Microsoft.SemanticKernel` (`dotnet add package Microsoft.SemanticKernel`), but no project or props file references it; README.md installs the package `Microsoft.SemanticKernel.Agents.Core` (`dotnet add package Microsoft.SemanticKernel.Agents.Core`), but no project or props file references it; dotnet/src/IntegrationTests/README.md names `IntegrationTests/Connectors/Weaviate`, but no file or folder `IntegrationTests/Connectors/Weaviate` exists.
Only 63/94 service-like projects use logging (pure contract/DTO projects are excluded — they have nothing to log). Of those 94, 45 ship a process this repository operates; the rest are libraries their consumer hosts, where the logging decision belongs to the host.
`REDACTED` reports through `Console.Write…` at line 108 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — REDACTED:108
`REDACTED` reports through `Console.Write…` at line 121 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — REDACTED:121
`REDACTED` reports through `Console.Write…` at line 135 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — REDACTED:135
`REDACTED` reports through `Console.Write…` at line 156 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — REDACTED:156
`REDACTED` reports through `Console.Write…` at line 168 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — REDACTED:168
`REDACTED` reports through `Console.Write…` at line 174 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — REDACTED:174
`dotnet/src/Plugins/Plugins.StructuredData.EntityFramework/StructuredDataService.cs` reports through `Console.Write…` at line 131 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — dotnet/src/Plugins/Plugins.StructuredData.EntityFramework/StructuredDataService.cs:131
`dotnet/src/Plugins/Plugins.StructuredData.EntityFramework/StructuredDataService.cs` reports through `Console.Write…` at line 178 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — dotnet/src/Plugins/Plugins.StructuredData.EntityFramework/StructuredDataService.cs:178
What to do
Extend structured logging across the projects you operate, and give the library ones a diagnostics seam instead — an `EventSource`/`ActivitySource` the host can subscribe to, or an optional logger on your options object — rather than taking a logging dependency on your consumers' behalf.
Replace `Console.Write…` in service code with the project's injected `ILogger<T>` (message templates with named properties), so delivery outcomes and failures reach the log pipeline with a level and a category.
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` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
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.
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.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
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.
No benchmark suite was found by the two searches this check runs. FIRST, a BenchmarkDotNet package reference in any project file — every project the workspace loaded, plus a walk of project files on disk that never loaded, because a benchmark suite is exactly the project a partial load drops. SECOND, a script harness: a file whose name contains `benchmark` and ends `.py`, `.sh`, `.ps1`, `.bash`, `.rb`, `.js` or `.mjs`, credited ONLY when this repository's CI text also mentions benchmarks — a harness no pipeline runs is read as a fixture, deliberately. Neither search can see a benchmark suite in another ecosystem's idiom (a Go `testing.B` file, a JMH or criterion project, a pytest-benchmark run), so this is 'no benchmark found by those two searches', not a verdict that the repository has none. Where code is performance-sensitive, a benchmark guards against silent regressions — but it's a bonus here, not a deduction.
What to do
Add a benchmarking harness for the hot paths and run it in CI to catch regressions (for .NET, a BenchmarkDotNet project with [MemoryDiagnoser] to track allocations).
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 475 use(s) across 128,163 production line(s) (~3.7/1k). More Span/Memory, pooling (ArrayPool/ObjectPool), stackalloc and ValueTask on the allocation-heavy paths climbs this toward 10.
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.
4 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
`.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). (×4) — dotnet/src/Agents/Runtime/Abstractions/AgentProxy.cs:82, dotnet/src/Connectors/Connectors.Onnx/BertOnnxTextEmbeddingGenerationService.cs:80, dotnet/src/Connectors/Connectors.Onnx/BertOnnxTextEmbeddingGenerationService.cs:94, …
What to do
Make the call chain async end-to-end and await it — never block on a Task with .Wait()/.GetAwaiter().GetResult().
Other · Security — Transport security, security headers, secure cookies, input validation, middleware order and crypto hygiene (presence, not runtime).
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.
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 configured — defense in depth, even when a reverse proxy could set them. (−2.0 on this card.)
This web host's pipeline is composed here and adds no security response header (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, a frame policy) to what it serves. (×11) — dotnet/samples/Demos/A2AClientServer/A2AServer/Program.cs:26, dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/Program.cs:33, dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.Web/Program.cs:10, …
What to do
Add security response headers (Content-Security-Policy first, then Strict-Transport-Security, X-Content-Type-Options and a frame policy) — defense in depth, even when a reverse proxy could set them.
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.
Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process. (×2) — dotnet/src/Agents/Runtime/Abstractions/AgentProxy.cs:82, dotnet/src/Extensions/PromptTemplates.Handlebars/Helpers/KernelHelpers/KernelFunctionHelpers.cs:208
`Thread.Sleep` parks the thread for the whole delay: no other work runs on it, and under load the pool must grow to make up for it. `await Task.Delay(…)` suspends only this method. (×3) — dotnet/src/Experimental/Process.IntegrationTests.Resources/ProcessCycleTestResources.cs:167, dotnet/src/Experimental/Process.IntegrationTests.Resources/ProcessCycleTestResources.cs:177, dotnet/src/Experimental/Process.IntegrationTests.Resources/ProcessCycleTestResources.cs:187
`File.ReadAllBytes` blocks the thread on I/O while `File.ReadAllBytesAsync` exists to wait without one — inside a method that is already `async`, await the twin. — dotnet/src/Plugins/Plugins.Core/CodeInterpreter/SessionsPythonPlugin.cs:136
`File.WriteAllBytes` blocks the thread on I/O while `File.WriteAllBytesAsync` exists to wait without one — inside a method that is already `async`, await the twin. — dotnet/src/Plugins/Plugins.Core/CodeInterpreter/SessionsPythonPlugin.cs:183
`async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained. — dotnet/samples/Demos/HuggingFaceImageToText/FormMain.cs:100
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.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
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.
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.
Do you agree with this assessment?
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.
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.
Do you agree with this assessment?
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.
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.
`semaphore` is a `SemaphoreSlim`, which implements `IDisposable`, and it is created here (line 31). Every use of it in `GetAudioChunksAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var semaphore = …;`), which releases it at the end of the scope on every path including a throw. — dotnet/samples/Demos/VoiceChat/Services/AudioSourceService.cs:31
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.
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.
Other · Code Health — Whether async methods accept a CancellationToken so work can be cancelled (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. 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 question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 528/843 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one. (×4) — dotnet/samples/Demos/AmazonBedrockModels/Program.cs:37, dotnet/samples/Demos/AmazonBedrockModels/Program.cs:77, dotnet/samples/Demos/AmazonBedrockModels/Program.cs:113, …
No CancellationToken parameter — this work can't be stopped early once started. (×29) — dotnet/samples/Demos/AotCompatibility/KernelFunctionSamples.cs:23, dotnet/samples/Demos/AotCompatibility/KernelPluginSamples.cs:24, dotnet/samples/Demos/AotCompatibility/KernelPluginSamples.cs:55, …
No CancellationToken parameter, and the token `context.CancellationToken` carries reaches none of the calls here that take one — this work can't be stopped early once started. Pass `context.CancellationToken` on, or take a CancellationToken. (×6) — dotnet/samples/Demos/ContentSafety/Filters/AttackDetectionFilter.cs:17, dotnet/samples/Demos/ContentSafety/Filters/TextModerationFilter.cs:20, dotnet/samples/Demos/QualityCheck/QualityCheckWithFilters/Filters/BertSummarizationEvaluationFilter.cs:20, …
What to do
Thread a CancellationToken through async methods so work stops promptly on cancellation.
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 `ArgumentNullException` 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.
The guard on line 43 rejects `caller` and line 45 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(caller)` is true of a value that is NOT null: it is satisfied by an EMPTY `caller`, and on that path `caller` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows the empty case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` for the empty case, or split the guard and throw each on its own condition. — dotnet/samples/Demos/TelemetryWithAppInsights/TestConfiguration.cs:45
What to do
Each finding names the throw and the test in its own condition that is true of a NON-null value. Confirm from the two, then throw the exception that describes what was actually wrong: `ArgumentException` for a value that arrived empty, or the .NET 8 helpers that spell the whole guard in one line and pick the type for you — `ArgumentException.ThrowIfNullOrEmpty(s)` / `ThrowIfNullOrWhiteSpace(s)` for strings, `ArgumentNullException.ThrowIfNull(x)` followed by `ArgumentOutOfRangeException.ThrowIfZero(x.Count)` for a collection. Splitting the two conditions is usually clearer than picking one exception for both: they are different failures and the caller may want to handle them differently.
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.
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.
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.
Do you agree with this assessment?
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.
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.
`MistralService` looks up `"max_tokens"` and falls back to `TopK` when the caller supplies none — but line 25 of this same type looks up `"max_tokens"` and falls back to `MaxTokens`, which is the member that key names. The two cannot both be right: every caller who configures `MaxTokens` and passes no `"max_tokens"` override silently gets `TopK` instead, and nothing reports that the value was ignored. Fall back to `MaxTokens` here as line 25 does — or, if `TopK` genuinely is the intended source, look it up under its own key so the two sites stop disagreeing. (×2) — dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:66, dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:111
`CrewAIEnterprise` takes `pollingInterval` from the caller and stores it in `_pollingInterval` on line 49, defaulting to `TimeSpan.FromSeconds(1)` when none is supplied — but `_pollingInterval` is never read anywhere in the type, and line 139 spells `TimeSpan.FromSeconds(1)` out again where that field's value belongs. Every caller that passes `pollingInterval` therefore gets `TimeSpan.FromSeconds(1)` regardless, and nothing in the type reports that its argument was ignored. Read `_pollingInterval` at line 139 — or, if the value genuinely is fixed, delete `pollingInterval` and `_pollingInterval` together so the signature stops advertising a knob that does nothing. — dotnet/src/Plugins/Plugins.AI/CrewAI/CrewAIEnterprise.cs:139
`TaskListPlugin` takes `jsonSerializerOptions` from the caller and stores it in `_jsonSerializerOptions` on line 41, defaulting to `s_options` when none is supplied — but `_jsonSerializerOptions` is never read anywhere in the type, and line 104 spells `s_options` out again where that field's value belongs. Every caller that passes `jsonSerializerOptions` therefore gets `s_options` regardless, and nothing in the type reports that its argument was ignored. Read `_jsonSerializerOptions` at line 104 — or, if the value genuinely is fixed, delete `jsonSerializerOptions` and `_jsonSerializerOptions` together so the signature stops advertising a knob that does nothing. — dotnet/src/Plugins/Plugins.MsGraph/TaskListPlugin.cs:104
What to do
Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
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.
`GetAudioChunksAsync` hands values from the `waveIn.DataAvailable +=` callback to the body waiting on them through `chunks`, a `Queue<…>` — the callback calls `chunks.Enqueue(…)` on line 45, and the body touches it at line 60. Those two spans provably run on different flows: this body `await`s `semaphore`, which nothing but the callback raises, so the callback cannot be the flow that is waiting for it. The touch is in a loop that waits on `semaphore` on every pass: each wait orders the ONE write it pairs with, and the callback's next write runs while this pass is still reading. `Queue<…>` states that a single writer requires exclusive access to it, and there is none here — `semaphore` is a `SemaphoreSlim`, which orders how MANY items exist and takes no exclusion over the collection's own head, tail and backing array. Two threads therefore mutate those at once, and the failure is not a lost item but a corrupted structure: a torn resize loses or duplicates entries, and an interleaved index update can return an element that was never written. Move the handoff onto something built to be crossed — `System.Collections.Concurrent.ConcurrentQueue<T>` keeps `semaphore` and the shape of the code exactly as they are, and `System.Threading.Channels.Channel<T>` replaces `semaphore` as well — or take a `lock` over every access to `chunks` on both sides. — dotnet/samples/Demos/VoiceChat/Services/AudioSourceService.cs:45
What to do
Hand values between a callback and the body waiting on it through a type built to be crossed — `System.Collections.Concurrent.ConcurrentQueue<T>` drops in beside the existing signal, and `System.Threading.Channels.Channel<T>` replaces the signal as well — or take a `lock` over every access to the shared collection on both sides. A counting semaphore beside it orders how MANY items exist and takes no exclusion over the collection's own internal state.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `foreach` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is enumerating invalidates the enumerator it is holding, so the next `MoveNext` throws `InvalidOperationException` and the remaining items 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.
Do you agree with this assessment?
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.
Do you agree with this assessment?
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.
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.
`catch (Exception)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch. — dotnet/samples/Demos/AotCompatibility/Program.cs:48
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×12) — dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettingsExtensions.cs:240, dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettingsExtensions.cs:253, dotnet/src/SemanticKernel.Abstractions/Functions/KernelFunction.cs:675, …
`catch (JsonException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch. — dotnet/src/Experimental/Orchestration.Flow/Execution/ReActEngine.cs:351
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
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.
Do you agree with this assessment?
X32 · Type resolved by simple name across every loaded assembly10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a plugin lookup names the type it means — searching every assembly loaded into the process for a candidate whose SIMPLE name equals a string supplied at runtime, and taking the first one found, is decided by assembly LOAD ORDER rather than by this source, so the same name can resolve to a different type on the next run.
Method: Roslyn syntax only, no semantic model: every invocation of `First`/`FirstOrDefault`/`Single`/`SingleOrDefault` whose OWN expression subtree contains both a `GetAssemblies()` call and a `GetTypes()`/`GetExportedTypes()` call — a single-element pick out of every type loaded into the process. A nested selector in the same chain sees no `GetAssemblies()` in its own subtree and is outside the population, so one lookup counts once however many links its chain has. A finding additionally needs both remaining halves: the selector must be `First`/`FirstOrDefault` (`Single`/`SingleOrDefault` reports the ambiguity rather than resolving it, and is counted and never reported), and the chain must carry an `==` comparison of `<lambda parameter>.Name` against something that is not a literal. The receiver must be a plain identifier bound by one of the chain’s own lambdas, which places `assembly.GetName().Name == "X"` outside the rule by construction. One exemption: a `.Name` test joined by `&&` to a `FullName`/`AssemblyQualifiedName` test on the same identifier is spared; joined by `||` it is not. Deterministic, provable per finding. Advisory.
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.
Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it. (×7) — dotnet/samples/Demos/VoiceChat/Pipeline/VoiceChatPipeline.cs:105, dotnet/samples/Demos/VoiceChat/Pipeline/VoiceChatPipeline.cs:112, dotnet/samples/Demos/VoiceChat/Services/AudioPlaybackService.cs:40, …
Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
This method contradicts itself about `executionSettings`: line 53 tests it for null before doing anything with it — the author's own statement that null is an input this code expects — but that `if` scopes only the block beneath it, and line 63 then dereferences `executionSettings` as `executionSettings.ToChatOptions` AFTER the block has closed, where the guard no longer applies. A null `executionSettings` skips the guarded body and reaches that line anyway, throwing NullReferenceException on exactly the input the guard was written for. If the dereference belongs to the guarded work, move it inside the block; if `executionSettings` truly cannot be null by then, the guard above is misleading and should go. — dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/ChatClientChatCompletionService.cs:63
This method contradicts itself about `executionSettings`: line 87 tests it for null before doing anything with it — the author's own statement that null is an input this code expects — but that `if` scopes only the block beneath it, and line 96 then dereferences `executionSettings` as `executionSettings.ToChatOptions` AFTER the block has closed, where the guard no longer applies. A null `executionSettings` skips the guarded body and reaches that line anyway, throwing NullReferenceException on exactly the input the guard was written for. If the dereference belongs to the guarded work, move it inside the block; if `executionSettings` truly cannot be null by then, the guard above is misleading and should go. — dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/ChatClientChatCompletionService.cs:96
This method contradicts itself about `trimmedParts`: line 175 writes `trimmedParts?.Length`, which says `trimmedParts` can be null, but line 177 then dereferences it directly with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `trimmedParts` truly cannot be null here, the `?.` is misleading. Settle it one way — test `trimmedParts` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — dotnet/src/SemanticKernel.Core/TemplateEngine/Blocks/NamedArgBlock.cs:177
This method contradicts itself about `mediaTypeMetadata`: line 478 writes `mediaTypeMetadata?.Schema`, which says `mediaTypeMetadata` can be null, but line 476 then dereferences it directly as `mediaTypeMetadata.Schema` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `mediaTypeMetadata` truly cannot be null here, the `?.` is misleading. Settle it one way — test `mediaTypeMetadata` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — dotnet/src/Functions/Functions.OpenApi/OpenApi/OpenApiDocumentParser.cs:476
~1.4 `!` suppressions per 1k syntax nodes — 664 suppression(s) across the 478695 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide.
What to do
Where a method uses `?.` on a symbol and then dereferences it directly, settle the question once: test it before the first use and handle null, or drop the `?.`.
Where a method null-tests a symbol and then uses it after the guarded block closes, move the trailing work inside the block — the guard skips its body on null, it does not stop the method.
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
Do you agree with this assessment?
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.
Unscored — 3 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.
P12 CI test-gate honesty — 1 observation(s) recorded · 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.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 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 — Repo shows no audit-logging mechanism (IAuditable, an immutable audit log, an EF SaveChanges interceptor) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
C4 Data Retention — Repo shows no data-retention / TTL / cleanup mechanism for personal data — absence of evidence is not evidence of a working control. Define retention periods and a purge/cleanup job (or TTL) in code, or document where retention is enforced, so this dimension can be scored.
C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 31 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.
AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
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
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the Aspire AppHost did not expose a crawlable HTTP endpoint in time (or only the dashboard) — no runtime evidence This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
D23 Boundary Type-Coupling — Cross-context type coupling could not be assessed — this codebase's bounded contexts are neither declared nor inferable.
D32 Data Compliance (PII/GDPR) — 76 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D39 IL Efficiency — IL not measured — the analyzer's build of the target did not succeed
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D8 Code Coverage — Coverage not measured — analyzer environment
DM1 Domain Modelling — applicable but not scored (3 signals for this style, 3 needed — the count is met but a required primary signal is absent): 1 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 6 strongly-typed id(s); 83 value object(s); no aggregate is declared and no domain structure surrounds the state-guarding types: not claimed as DDD
ED2 Event/command shape — no command-shaped messages detected — single-handler-per-command check not applicable
ED3 Event naming — no domain or integration events detected — event-naming check not applicable
ED4 Outbox / dual-write — no persistence writes or publishes observed in handlers — atomicity not assessable
ED5 Idempotency — 1 mutating command handler(s)/consumer(s) detected and 1 handler method(s) walked, but no persistent write was recognised in any of them — idempotency not assessed
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
P7 Outbound HTTP resilience — no outbound HTTP usage detected — no HttpClient/IHttpClientFactory/AddHttpClient in source, and no Refit/RestSharp/Flurl.Http namespace or package reference
P8 Schema migrations — no EF Core usage detected
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (Cobertura — `dotnet test --collect:"XPlat Code Coverage"` with a `coverlet.collector` PackageReference) 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.
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.
NoWarnInCsproj — 12 warning codes suppressed in one element dotnet/src/SemanticKernel.UnitTests/SemanticKernel.UnitTests.csproj:9— A single <NoWarn> suppresses 12 warning codes (CA2007;CA1861;IDE1006;VSTHRD111;SKEXP0001;SKEXP0010;SKEXP0050;SKEXP0110;SKEXP0120;SKEXP0130;MEVD9000;OPENAI001) in one stroke — one team-wide decision, not 12 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 8 warning codes suppressed in one element dotnet/src/SemanticKernel.AotTests/SemanticKernel.AotTests.csproj:12— A single <NoWarn> suppresses 8 warning codes (VSTHRD111;CA2007;CA1031;CA1812;CS1998;IDE1006;SKEXP0120;SKEXP0001) in one stroke — one team-wide decision, not 8 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 13 warning codes suppressed in one element dotnet/src/IntegrationTests/IntegrationTests.csproj:8— A single <NoWarn> suppresses 13 warning codes (CA2007;CA1861;VSTHRD111;SKEXP0001;SKEXP0010;SKEXP0040;SKEXP0050;SKEXP0060;SKEXP0080;SKEXP0110;SKEXP0130;OPENAI001;MEVD9000) in one stroke — one team-wide decision, not 13 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 16 warning codes suppressed in one element dotnet/samples/LearnResources/LearnResources.csproj:10— A single <NoWarn> suppresses 16 warning codes (CS8618;IDE0009;CA1051;CA1050;CA1707;CA2007;VSTHRD111;CS1591;RCS1110;CA5394;SKEXP0001;SKEXP0010;SKEXP0040;SKEXP0050;SKEXP0060;SKEXP0101) in one stroke — one team-wide decision, not 16 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 19 warning codes suppressed in one element dotnet/samples/GettingStartedWithVectorStores/GettingStartedWithVectorStores.csproj:10— A single <NoWarn> suppresses 19 warning codes (CS8618;IDE0009;IDE1006;CA1051;CA1050;CA1707;CA1054;CA2007;VSTHRD111;CS1591;RCS1110;RCS1243;CA5394;SKEXP0001;SKEXP0010;SKEXP0040;SKEXP0050;SKEXP0060;SKEXP0101) in one stroke — one team-wide decision, not 19 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 19 warning codes suppressed in one element dotnet/samples/GettingStartedWithTextSearch/GettingStartedWithTextSearch.csproj:10— A single <NoWarn> suppresses 19 warning codes (CS8618;IDE0009;IDE1006;CA1051;CA1050;CA1707;CA1054;CA2007;VSTHRD111;CS1591;RCS1110;RCS1243;CA5394;SKEXP0001;SKEXP0010;SKEXP0040;SKEXP0050;SKEXP0060;SKEXP0101) in one stroke — one team-wide decision, not 19 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 23 warning codes suppressed in one element dotnet/samples/GettingStartedWithProcesses/GettingStartedWithProcesses.csproj:12— A single <NoWarn> suppresses 23 warning codes (CS8618;IDE0009;IDE1006;CA1051;CA1050;CA1707;CA1054;CA2007;VSTHRD111;CS1591;RCS1110;RCS1243;CA5394;SKEXP0001;SKEXP0010;SKEXP0040;SKEXP0050;SKEXP0060;SKEXP0080;SKEXP0081;SKEXP0101;SKEXP0110;OPENAI001) in one stroke — one team-wide decision, not 23 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 22 warning codes suppressed in one element dotnet/samples/GettingStartedWithAgents/GettingStartedWithAgents.csproj:12— A single <NoWarn> suppresses 22 warning codes (NU1008;CS8618;IDE0009;IDE1006;CA1051;CA1050;CA1707;CA1054;CA2007;VSTHRD111;CS1591;RCS1110;RCS1243;CA5394;SKEXP0001;SKEXP0010;SKEXP0040;SKEXP0050;SKEXP0060;SKEXP0101;SKEXP0110;OPENAI001) in one stroke — one team-wide decision, not 22 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 19 warning codes suppressed in one element dotnet/samples/GettingStarted/GettingStarted.csproj:10— A single <NoWarn> suppresses 19 warning codes (CS8618;IDE0009;IDE1006;CA1051;CA1050;CA1707;CA1054;CA2007;VSTHRD111;CS1591;RCS1110;RCS1243;CA5394;SKEXP0001;SKEXP0010;SKEXP0040;SKEXP0050;SKEXP0060;SKEXP0101) in one stroke — one team-wide decision, not 19 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 24 warning codes suppressed in one element dotnet/samples/Concepts/Concepts.csproj:11— A single <NoWarn> suppresses 24 warning codes (CS8618;IDE0009;IDE1006;CA1051;CA1050;CA1707;CA1054;CA2007;VSTHRD111;CS1591;RCS1110;RCS1243;CA5394;SKEXP0001;SKEXP0010;SKEXP0020;SKEXP0040;SKEXP0050;SKEXP0060;SKEXP0101;SKEXP0110;OPENAI001;CA1724;MEVD9000) in one stroke — one team-wide decision, not 24 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 8 warning codes suppressed in one element dotnet/src/Functions/Functions.UnitTests/Functions.UnitTests.csproj:10— A single <NoWarn> suppresses 8 warning codes (CA2007;CA1861;CA1869;VSTHRD111;CS1591;CS0618;SKEXP0040;SKEXP0001) in one stroke — one team-wide decision, not 8 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 8 warning codes suppressed in one element dotnet/src/Functions/Functions.Prompty.UnitTests/Functions.Prompty.UnitTests.csproj:10— A single <NoWarn> suppresses 8 warning codes (CS1591;CA2007;CA1861;CA1869;VSTHRD111;SKEXP0040;SKEXP0010;SKEXP0001) in one stroke — one team-wide decision, not 8 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 10 warning codes suppressed in one element dotnet/src/Experimental/Process.Utilities.UnitTests/Process.Utilities.UnitTests.csproj:9— A single <NoWarn> suppresses 10 warning codes (CA2007;CA1812;CA1861;CA1063;VSTHRD111;SKEXP0001;SKEXP0050;SKEXP0080;SKEXP0110;OPENAI001) in one stroke — one team-wide decision, not 10 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 11 warning codes suppressed in one element dotnet/src/Experimental/Process.UnitTests/Process.UnitTests.csproj:9— A single <NoWarn> suppresses 11 warning codes (CA2007;CA1812;CA1861;CA1063;VSTHRD111;SKEXP0001;SKEXP0050;SKEXP0080;SKEXP0110;OPENAI001;CA1024) in one stroke — one team-wide decision, not 11 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 10 warning codes suppressed in one element dotnet/src/Experimental/Process.Runtime.Dapr.UnitTests/Process.Runtime.Dapr.UnitTests.csproj:10— A single <NoWarn> suppresses 10 warning codes (CA2007;CA1812;CA1861;CA1063;VSTHRD111;SKEXP0001;SKEXP0050;SKEXP0080;SKEXP0110;OPENAI001) in one stroke — one team-wide decision, not 10 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 10 warning codes suppressed in one element dotnet/src/Experimental/Process.IntegrationTests.Shared/Process.IntegrationTests.Shared.csproj:9— A single <NoWarn> suppresses 10 warning codes (CA2007;CA1812;CA1861;CA1063;VSTHRD111;SKEXP0001;SKEXP0050;SKEXP0080;SKEXP0110;OPENAI001) in one stroke — one team-wide decision, not 10 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 10 warning codes suppressed in one element dotnet/src/Experimental/Process.IntegrationTests.Resources/Process.IntegrationTests.Resources.csproj:9— A single <NoWarn> suppresses 10 warning codes (CA2007;CA1812;CA1861;CA1063;VSTHRD111;SKEXP0001;SKEXP0050;SKEXP0080;SKEXP0110;OPENAI001) in one stroke — one team-wide decision, not 10 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 10 warning codes suppressed in one element dotnet/src/Experimental/Process.IntegrationTestRunner.Local/Process.IntegrationTestRunner.Local.csproj:8— A single <NoWarn> suppresses 10 warning codes (CA2007;CA1812;CA1861;CA1063;VSTHRD111;SKEXP0001;SKEXP0050;SKEXP0080;SKEXP0110;OPENAI001) in one stroke — one team-wide decision, not 10 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 10 warning codes suppressed in one element dotnet/src/Experimental/Process.IntegrationTestRunner.Dapr/Process.IntegrationTestRunner.Dapr.csproj:10— A single <NoWarn> suppresses 10 warning codes (CA2007;CA1861;VSTHRD111;SKEXP0001;SKEXP0010;SKEXP0040;SKEXP0050;SKEXP0060;SKEXP0080;SKEXP0110) in one stroke — one team-wide decision, not 10 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 10 warning codes suppressed in one element dotnet/src/Experimental/Process.IntegrationTestHost.Dapr/Process.IntegrationTestHost.Dapr.csproj:10— A single <NoWarn> suppresses 10 warning codes (CA2007;CA1861;VSTHRD111;SKEXP0001;SKEXP0010;SKEXP0040;SKEXP0050;SKEXP0060;SKEXP0080;SKEXP0110) in one stroke — one team-wide decision, not 10 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 13 warning codes suppressed in one element dotnet/src/Connectors/Connectors.OpenAI.UnitTests/Connectors.OpenAI.UnitTests.csproj:10— A single <NoWarn> suppresses 13 warning codes (SKEXP0001;SKEXP0010;CS1591;IDE1006;RCS1261;CA1031;CA1308;CA1861;CA2007;CA2234;VSTHRD111;CA1812;OPENAI001) in one stroke — one team-wide decision, not 13 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 11 warning codes suppressed in one element dotnet/src/Connectors/Connectors.Onnx.UnitTests/Connectors.Onnx.UnitTests.csproj:10— A single <NoWarn> suppresses 11 warning codes (SKEXP0001;CS1591;IDE1006;RCS1261;CA1031;CA1308;CA1861;CA2007;CA2234;VSTHRD111;SYSLIB1222) in one stroke — one team-wide decision, not 11 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 10 warning codes suppressed in one element dotnet/src/Connectors/Connectors.HuggingFace.UnitTests/Connectors.HuggingFace.UnitTests.csproj:11— A single <NoWarn> suppresses 10 warning codes (CA2007;CA1806;CA1869;CA1861;IDE0300;VSTHRD111;SKEXP0001;SKEXP0010;SKEXP0070;SKEXP0050) in one stroke — one team-wide decision, not 10 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 9 warning codes suppressed in one element dotnet/src/Connectors/Connectors.Google.UnitTests/Connectors.Google.UnitTests.csproj:11— A single <NoWarn> suppresses 9 warning codes (CA2007;CA1806;CA1869;CA1861;IDE0300;VSTHRD111;SKEXP0001;SKEXP0010;SKEXP0050) in one stroke — one team-wide decision, not 9 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 10 warning codes suppressed in one element dotnet/src/Connectors/Connectors.AzureOpenAI.UnitTests/Connectors.AzureOpenAI.UnitTests.csproj:11— A single <NoWarn> suppresses 10 warning codes (SKEXP0001;SKEXP0010;CA2007;CA1806;CA1869;CA1861;IDE0300;VSTHRD111;IDE1006;OPENAI001) in one stroke — one team-wide decision, not 10 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
FileScopedPragmaDisable dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step01_Basics/Program.cs:10— #pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs:12— #pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step03_ToolCall/Program.cs:11— #pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:11— #pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step01_Basics/Program.cs:9— #pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs:11— #pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step03_ToolCall/Program.cs:10— #pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs:10— #pragma warning disable OPENAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/Agents/ChatCompletion_ContextualFunctionSelection.cs:13— #pragma warning disable SKEXP0130 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/Agents/ChatCompletion_Mem0.cs:10— #pragma warning disable SKEXP0130 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/Agents/ChatCompletion_Rag.cs:14— #pragma warning disable SKEXP0130 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/Agents/ChatCompletion_Whiteboard.cs:13— #pragma warning disable SKEXP0130 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/Agents/OpenAIResponseAgent_Whiteboard.cs:14— #pragma warning disable SKEXP0130 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/Memory/HuggingFace_EmbeddingGeneration.cs:7— #pragma warning disable format // Format item can be simplified — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/Memory/OpenAI_EmbeddingGeneration.cs:7— #pragma warning disable format // Format item can be simplified — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/TextGeneration/HuggingFace_TextGeneration.cs:7— #pragma warning disable format // Format item can be simplified — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/TextGeneration/Ollama_TextGeneration.cs:7— #pragma warning disable format // Format item can be simplified — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/TextGeneration/Ollama_TextGenerationStreaming.cs:6— #pragma warning disable format // Format item can be simplified — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/Memory/HuggingFace_EmbeddingGeneration.cs:8— #pragma warning disable CA1861 // Avoid constant arrays as arguments — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/Memory/OpenAI_EmbeddingGeneration.cs:8— #pragma warning disable CA1861 // Avoid constant arrays as arguments — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/TextGeneration/HuggingFace_TextGeneration.cs:8— #pragma warning disable CA1861 // Avoid constant arrays as arguments — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/TextGeneration/Ollama_TextGeneration.cs:8— #pragma warning disable CA1861 // Avoid constant arrays as arguments — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/TextGeneration/Ollama_TextGenerationStreaming.cs:7— #pragma warning disable CA1861 // Avoid constant arrays as arguments — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Concepts/Plugins/CopilotAgentBasedPlugins.cs:275— #pragma warning disable SKEXP0050 — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable dotnet/samples/Demos/AIModelRouter/CustomRouter.cs:3— #pragma warning disable SKEXP0001 — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
WriteOnlyPrivateField dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/Controllers/AgentCompletionsController.cs:24— private ILogger<AgentCompletionsController> _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.Configuration/HostConfig.cs:33— private ConfigurationManager _configurationManager — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Grpc/Services/DocumentGenerationService.cs:20— private ILogger<DocumentGenerationService> _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Grpc/Services/DocumentGenerationService.cs:21— private Kernel _kernel — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField REDACTED:15— private Kernel _kernel — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Experimental/Process.IntegrationTestHost.Dapr/Controllers/ProcessTestController.cs:21— private Kernel _kernel — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Experimental/Process.LocalRuntime/LocalKernelProcessContext.cs:13— private Kernel _kernel — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Plugins/Plugins.UnitTests/Web/Bing/BingTextSearchTests.cs:1111— private Kernel _kernel — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Plugins/Plugins.UnitTests/Web/Brave/BraveTextSearchTests.cs:400— private Kernel _kernel — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Plugins/Plugins.UnitTests/Web/Google/GoogleTextSearchTests.cs:904— private Kernel _kernel — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Plugins/Plugins.UnitTests/Web/Tavily/TavilyTextSearchTests.cs:507— private Kernel _kernel — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/samples/Demos/VectorStoreRAG/RAGChatService.cs:30— private Task? _chatLoop — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Agents/A2A/A2AAgentThread.cs:47— private A2AClient _client — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Connectors/Connectors.AzureAIInference.UnitTests/Services/AzureAIInferenceChatCompletionServiceTests.cs:34— private Mock<ILoggerFactory> _mockLoggerFactory — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Connectors/Connectors.OpenAI.UnitTests/Services/OpenAITextToImageServiceTests.cs:25— private Mock<ILoggerFactory> _mockLoggerFactory — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Connectors/Connectors.Google.UnitTests/Core/Gemini/Clients/GeminiChatClientFunctionCallingTests.cs:27— private GeminiFunction _timePluginDate — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Connectors/Connectors.OpenAI/Services/OpenAIFileService.cs:40— private ILogger _logger — assigned 2 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Experimental/Process.UnitTests/KernelProcessSerializationTests.cs:231— private StepState? _state — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Extensions/Extensions.UnitTests/PromptTemplates/Handlebars/Helpers/KernelSystemHelpersTests.cs:299— private KernelArguments _arguments — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Extensions/PromptTemplates.Handlebars/HandlebarsPromptTemplate.cs:62— private ILogger _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Plugins/Plugins.Web/Google/GoogleConnector.cs:21— private ILogger _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:313— private ILogger _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/SemanticKernel.Core/PromptTemplate/KernelPromptTemplate.cs:60— private ILogger _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Functions/Functions.UnitTests/Grpc/Extensions/GrpcOperationExtensionsTests.cs:11— private GrpcOperationDataContractType _request — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField dotnet/src/Functions/Functions.UnitTests/Grpc/Extensions/GrpcOperationExtensionsTests.cs:15— private GrpcOperation _operation — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
EmptyCatchBlock dotnet/samples/Demos/CopilotAgentPlugins/CopilotAgentPluginsDemoSample/Logging/SemanticKernelLogger.cs:77— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock dotnet/src/Connectors/Connectors.AzureAIInference/Core/RequestFailedExceptionExtensions.cs:29— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock dotnet/src/Experimental/Orchestration.Flow/Model/FlowStep.cs:111— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock dotnet/src/Experimental/Process.Core/WorkflowSerializer.cs:53— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock dotnet/src/InternalUtilities/azure/workflow/UriExtensions.cs:104— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock dotnet/src/InternalUtilities/src/Http/HttpClientProvider.cs:111— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock dotnet/src/InternalUtilities/src/System/PathUtilities.cs:149— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock dotnet/src/InternalUtilities/src/System/PathUtilities.cs:152— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettingsExtensions.cs:240— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettingsExtensions.cs:253— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock dotnet/src/SemanticKernel.Abstractions/Functions/KernelFunction.cs:675— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock dotnet/src/SemanticKernel.Abstractions/Functions/KernelFunctionLogMessages.cs:143— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
Namespace dependency cycle dotnet/src/InternalUtilities/openai/Extensions/ClientResultExceptionExtensions.cs:6— The namespaces (global) ↔ Microsoft.Extensions.AI ↔ Microsoft.SemanticKernel ↔ Microsoft.SemanticKernel.Agents ↔ Microsoft.SemanticKernel.Agents.Chat ↔ Microsoft.SemanticKernel.Agents.Internal ↔ Microsoft.SemanticKernel.Agents.Serialization ↔ Microsoft.SemanticKernel.AudioToText ↔ Microsoft.SemanticKernel.ChatCompletion ↔ Microsoft.SemanticKernel.Connectors.FunctionCalling ↔ Microsoft.SemanticKernel.Connectors.Google ↔ Microsoft.SemanticKernel.Connectors.Google.Core ↔ Microsoft.SemanticKernel.Connectors.Onnx ↔ Microsoft.SemanticKernel.Connectors.OpenAI ↔ Microsoft.SemanticKernel.Data ↔ Microsoft.SemanticKernel.Embeddings ↔ Microsoft.SemanticKernel.Functions ↔ Microsoft.SemanticKernel.Memory ↔ Microsoft.SemanticKernel.Plugins.OpenApi ↔ Microsoft.SemanticKernel.Plugins.OpenApi.Extensions ↔ Microsoft.SemanticKernel.Plugins.Web.Bing ↔ Microsoft.SemanticKernel.Plugins.Web.Brave ↔ Microsoft.SemanticKernel.Plugins.Web.Google ↔ Microsoft.SemanticKernel.Plugins.Web.Tavily ↔ Microsoft.SemanticKernel.Process ↔ Microsoft.SemanticKernel.Process.Internal ↔ Microsoft.SemanticKernel.Process.Runtime ↔ Microsoft.SemanticKernel.PromptTemplates.Handlebars ↔ Microsoft.SemanticKernel.Services ↔ Microsoft.SemanticKernel.TemplateEngine ↔ Microsoft.SemanticKernel.Text ↔ Microsoft.SemanticKernel.TextGeneration ↔ Microsoft.SemanticKernel.TextToAudio ↔ Microsoft.SemanticKernel.TextToImage depend on each other. The lightest dependency in the cycle is (global) → Microsoft.SemanticKernel (ClientResultExceptionExtensions → Microsoft.SemanticKernel.HttpOperationException, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
Namespace dependency cycle dotnet/src/Agents/Runtime/Core/BaseAgent.cs:11— The namespaces Microsoft.SemanticKernel.Agents.Runtime.Core ↔ Microsoft.SemanticKernel.Agents.Runtime.Core.Internal depend on each other. The lightest dependency in the cycle is Microsoft.SemanticKernel.Agents.Runtime.Core → Microsoft.SemanticKernel.Agents.Runtime.Core.Internal (Microsoft.SemanticKernel.Agents.Runtime.Core.BaseAgent → Microsoft.SemanticKernel.Agents.Runtime.Core.Internal.HandlerInvoker, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
Namespace dependency cycle dotnet/src/Connectors/Connectors.Amazon/Bedrock/Services/BedrockChatCompletionService.cs:9— The namespaces Microsoft.SemanticKernel.Connectors.Amazon ↔ Microsoft.SemanticKernel.Connectors.Amazon.Core depend on each other. The lightest dependency in the cycle is Microsoft.SemanticKernel.Connectors.Amazon → Microsoft.SemanticKernel.Connectors.Amazon.Core (Microsoft.SemanticKernel.Connectors.Amazon.BedrockChatCompletionService → Microsoft.SemanticKernel.Connectors.Amazon.Core.BedrockChatCompletionClient, 3 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
Namespace dependency cycle dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionRequest.cs:13— The namespaces Microsoft.SemanticKernel.Connectors.HuggingFace ↔ Microsoft.SemanticKernel.Connectors.HuggingFace.Core depend on each other. The lightest dependency in the cycle is Microsoft.SemanticKernel.Connectors.HuggingFace.Core → Microsoft.SemanticKernel.Connectors.HuggingFace (Microsoft.SemanticKernel.Connectors.HuggingFace.Core.ChatCompletionRequest → Microsoft.SemanticKernel.Connectors.HuggingFace.HuggingFacePromptExecutionSettings, 4 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
Namespace dependency cycle dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:28— The namespaces Microsoft.SemanticKernel.Connectors.MistralAI ↔ Microsoft.SemanticKernel.Connectors.MistralAI.Client depend on each other. The lightest dependency in the cycle is Microsoft.SemanticKernel.Connectors.MistralAI.Client → Microsoft.SemanticKernel.Connectors.MistralAI (Microsoft.SemanticKernel.Connectors.MistralAI.Client.MistralClient → Microsoft.SemanticKernel.Connectors.MistralAI.MistralAIPromptExecutionSettings, 2 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
Namespace dependency cycle dotnet/src/Experimental/Orchestration.Flow/Execution/FlowStatusProvider.cs:10— The namespaces Microsoft.SemanticKernel.Experimental.Orchestration ↔ Microsoft.SemanticKernel.Experimental.Orchestration.Abstractions ↔ Microsoft.SemanticKernel.Experimental.Orchestration.Execution depend on each other. The lightest dependency in the cycle is Microsoft.SemanticKernel.Experimental.Orchestration → Microsoft.SemanticKernel.Experimental.Orchestration.Execution (Microsoft.SemanticKernel.Experimental.Orchestration.FlowStatusProvider → Microsoft.SemanticKernel.Experimental.Orchestration.Execution.ExecutionState, 2 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
FileScopedPragmaDisable repeated across 15 files dotnet/src/Agents/Abstractions/Logging/AgentChatLogMessages.cs:10— The identical FileScopedPragmaDisable (`#pragma warning disable SYSLIB1006 // Multiple logging methods cannot use the same event id within a class`) appears in 15 files (15 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 15 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
FileScopedPragmaDisable repeated across 15 files dotnet/src/IntegrationTests/Agents/AggregatorAgentTests.cs:19— The identical FileScopedPragmaDisable (`#pragma warning disable xUnit1004 // Contains test methods used in manual verification. Disable warning for this file only.`) appears in 15 files (15 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 15 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
NoWarnInCsproj repeated across 38 files dotnet/src/Plugins/Plugins.UnitTests/Plugins.UnitTests.csproj:11— The identical NoWarnInCsproj (`CA2007`) appears in 38 files (38 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 38 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
NoWarnInCsproj repeated across 38 files dotnet/src/Plugins/Plugins.UnitTests/Plugins.UnitTests.csproj:11— The identical NoWarnInCsproj (`VSTHRD111`) appears in 38 files (38 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 38 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
Captive dependency: singleton Worker captures transient Kernel dotnet/samples/Demos/HomeAutomation/Worker.cs:16— `Worker` is registered as a SINGLETON but its constructor takes `Kernel kernel`, which is registered as Transient. The singleton captures one instance of the transient dependency forever — defeating its lifetime (a per-request DbContext shared across all requests is a classic data-corruption/threading bug). Make the singleton resolve `Kernel` per-use (inject `IServiceScopeFactory` or a factory func), or align the lifetimes.
FileScopedPragmaDisable repeated across 13 files dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs:10— The identical FileScopedPragmaDisable (`#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.`) appears in 13 files (13 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 13 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
NoWarnInCsproj repeated across 36 files dotnet/src/SemanticKernel.Core/SemanticKernel.Core.csproj:9— The identical NoWarnInCsproj (`SKEXP0001`) appears in 36 files (36 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 36 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
NoWarnInCsproj repeated across 11 files dotnet/src/Extensions/PromptTemplates.Liquid.UnitTests/PromptTemplates.Liquid.UnitTests.csproj:10— The identical NoWarnInCsproj (`CS1591`) appears in 11 files (11 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 11 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
NoWarnInCsproj repeated across 13 files dotnet/src/Agents/Yaml/Agents.Yaml.csproj:8— The identical NoWarnInCsproj (`SKEXP0110`) appears in 13 files (13 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 13 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
NoWarnInCsproj repeated across 21 files dotnet/samples/AgentFrameworkMigration/Playground/SemanticKernelBasic/SemanticKernelBasic.csproj:8— The identical NoWarnInCsproj (`CA1707`) appears in 21 files (21 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 21 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
CoverageExclusion dotnet/src/Agents/Abstractions/Logging/AgentChatLogMessages.cs:19— class AgentChatLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/Abstractions/Logging/AggregatorAgentLogMessages.cs:17— class AggregatorAgentLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/AzureAI/Logging/AgentThreadActionsLogMessages.cs:19— class AgentThreadActionsLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/AzureAI/Logging/AzureAIAgentLogMessages.cs:16— class AzureAIAgentLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/Core/Internal/CoreKernelArgumentsExtensions.cs:12— class CoreKernelArgumentsExtensions — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/Core/Logging/AgentGroupChatLogMessages.cs:20— class AgentGroupChatLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/Core/Logging/AggregatorTerminationStrategyLogMessages.cs:16— class AggregatorTerminationStrategyLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/Core/Logging/ChatCompletionAgentLogMessages.cs:17— class ChatCompletionAgentLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/Core/Logging/KernelFunctionSelectionStrategyLogMessages.cs:17— class KernelFunctionStrategyLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/Core/Logging/KernelFunctionTerminationStrategyLogMessages.cs:17— class KernelFunctionTerminationStrategyLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/Core/Logging/RegExTerminationStrategyLogMessages.cs:17— class RegExTerminationStrategyLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/Core/Logging/SequentialSelectionStrategyLogMessages.cs:16— class SequentialSelectionStrategyLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/Core/Logging/TerminationStrategyLogMessages.cs:17— class TerminationStrategyLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/Magentic/Logging/MagenticOrchestrationLogMessages.cs:18— class MagenticOrchestrationLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/OpenAI/Definition/OpenAIAssistantAgentFactory.cs:13— class OpenAIAssistantAgentFactory — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/OpenAI/Extensions/AgentDefinitionExtensions.cs:18— class AgentDefinitionExtensions — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/OpenAI/Extensions/ModelConnectionExtensions.cs:12— class ModelConnectionExtensions — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/OpenAI/Extensions/StreamingResponseOutputTextDeltaUpdateExtensions.cs:9— class StreamingResponseOutputTextDeltaUpdateExtensions — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:353— method InvokeStreamingAsync — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:636— method GenerateStreamingMessageContent — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:678— method GenerateStreamingCodeInterpreterContent — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:737— method GenerateStreamingAnnotationContent — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/OpenAI/Internal/ResponseThreadActions.cs:21— class ResponseThreadActions — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/OpenAI/Logging/AssistantThreadActionsLogMessages.cs:19— class AssistantThreadActionsLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
CoverageExclusion dotnet/src/Agents/OpenAI/Logging/OpenAIAssistantAgentLogMessages.cs:16— class OpenAIAssistantAgentLogMessages — this shipped code is lifted out of the coverage measurement, so it is not that the code is reported as untested: it is not reported at all. The excluded lines leave the denominator, which means the percentage the team publishes goes UP when code stops being covered, and the gap is invisible in the artefact that would otherwise disclose it. Nothing here is written by a compiler or a build — the attribute is only ever typed by an author — so it is a standing decision, and the only record of it is this line. Test what it covers and delete the attribute; where the code genuinely cannot be exercised (a debugger display, a platform branch this build cannot reach), narrow the exclusion to the smallest declaration that is really untestable rather than the type around it, so members added later are not silently excluded too. If it is correct as it stands, say why — in the attribute's own Justification, or in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
TodoComment dotnet/samples/Concepts/Agents/DeclarativeAgents.cs:71— //TODO: this eventually needs to be added to all CAP or DA but we're still discussing where should those facilitators live — 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.
TodoComment dotnet/samples/Demos/CopilotAgentPlugins/CopilotAgentPluginsDemoSample/DemoCommand.cs:512— //TODO: this eventually needs to be added to all CAP or DA but we're still discussing where should those facilitators live — 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.
TodoComment dotnet/src/Agents/Abstractions/AggregatorAgent.cs:54— // TODO: Need to determine the correct approach here. — 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.
TodoComment dotnet/src/Agents/Abstractions/AggregatorAgent.cs:65— // TODO: Need to determine the correct approach here. — 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.
TodoComment dotnet/src/Agents/AzureAI/Extensions/AgentDefinitionExtensions.cs:103— // TODO: Implement — 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.
TodoComment dotnet/src/Agents/OpenAI/Extensions/AgentDefinitionExtensions.cs:48— // TODO: Implement — 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.
TodoComment dotnet/src/Agents/OpenAI/Extensions/AgentDefinitionExtensions.cs:102— // TODO: Implement — 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.
TodoComment dotnet/src/Agents/OpenAI/Extensions/AgentDefinitionExtensions.cs:114— // TODO: Implement — 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.
TodoComment dotnet/src/Agents/OpenAI/Extensions/AgentDefinitionExtensions.cs:87— // TODO: Verify that the fileIds are strings — 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.
TodoComment dotnet/src/Agents/Runtime/Abstractions/IAgent.cs:35— // TODO: How do we express this properly in .NET? — 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.
TodoComment dotnet/src/Agents/Runtime/Abstractions/TopicId.cs:123— // TODO: Implement < for wildcard matching (type, *) — 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.
TodoComment dotnet/src/Agents/Runtime/Core/AgentsAppBuilder.cs:80— // TODO: Expose skipClassSubscriptions and skipDirectMessageSubscription as parameters? — 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.
TodoComment dotnet/src/Agents/Runtime/InProcess/InProcessRuntime.cs:96— // TODO: Do we want detach semantics? — 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.
TodoComment dotnet/src/Agents/Runtime/InProcess/InProcessRuntime.cs:453— // TODO: Bind tracing — 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.
TodoComment dotnet/src/Agents/Runtime/InProcess/InProcessRuntime.cs:461— // TODO: Bind tracing — 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.
TodoComment dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:808— // TODO: Currently SK doesn't support prompt feedback/finish status, so we just throw an exception. I told SK team that we need to support it: https://github.com/microsoft/semantic-kernel/issues/4621
TodoComment dotnet/src/Connectors/Connectors.Google/Core/GoogleAI/GoogleAIEmbeddingRequest.cs:73— // todo: enum — 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.
TodoComment dotnet/src/Connectors/Connectors.Google/Core/VertexAI/VertexAIEmbeddingRequest.cs:42— // todo: enum — 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.
TodoComment dotnet/src/Connectors/Connectors.Google/Extensions/GoogleAIKernelBuilderExtensions.cs:34— // todo: change beta to stable when stable version will be available — 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.
TodoComment dotnet/src/Connectors/Connectors.Google/Extensions/GoogleAIKernelBuilderExtensions.cs:68— // todo: change beta to stable when stable version will be available — 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.
TodoComment dotnet/src/Connectors/Connectors.Google/Extensions/GoogleAIKernelBuilderExtensions.cs:103— // todo: change beta to stable when stable version will be available — 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.
TodoComment dotnet/src/Connectors/Connectors.Google/Extensions/GoogleAIServiceCollectionExtensions.DependencyInjection.cs:35— // todo: change beta to stable when stable version will be available — 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.
TodoComment dotnet/src/Connectors/Connectors.Google/Extensions/GoogleAIServiceCollectionExtensions.cs:31— // todo: change beta to stable when stable version will be available — 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.
TodoComment dotnet/src/Connectors/Connectors.Google/Extensions/GoogleAIServiceCollectionExtensions.cs:63— // todo: change beta to stable when stable version will be available — 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.
TodoComment dotnet/src/Connectors/Connectors.Google/Services/GoogleAIEmbeddingGenerator.cs:33— // todo: change beta to stable when stable version will be available — 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.
No assertions: RunAsync dotnet/samples/Concepts/Functions/MethodFunctions.cs:9— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: AccessUnderlyingMethodAttributes dotnet/samples/Concepts/Functions/MethodFunctions_Advanced.cs:37— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: RunExample dotnet/samples/Concepts/Memory/TextChunkerUsage.cs:13— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: RunExampleWithTokenCounter dotnet/samples/Concepts/Memory/TextChunkerUsage.cs:24— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: RunExampleWithHeader dotnet/samples/Concepts/Memory/TextChunkerUsage.cs:40— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: UsingCrewAIEnterpriseAsync dotnet/samples/Concepts/Plugins/CrewAI_Plugin.cs:17— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: ImportOperationsBasedOnMethodAsync dotnet/samples/Concepts/Plugins/OpenApiPlugin_Filtering.cs:113— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: InvokeOpenApiFunctionWithArgumentsForPayloadOneOfAsync dotnet/samples/Concepts/Plugins/OpenApiPlugin_PayloadHandling.cs:292— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: InvokeOpenApiFunctionWithArgumentsForPayloadAllOfAsync dotnet/samples/Concepts/Plugins/OpenApiPlugin_PayloadHandling.cs:321— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: InvokeOpenApiFunctionWithArgumentsForPayloadAnyOfAsync dotnet/samples/Concepts/Plugins/OpenApiPlugin_PayloadHandling.cs:351— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: DownloadSKLogoAsync dotnet/samples/Concepts/Plugins/WebPlugins.cs:15— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: UnsafeInputVariableAsync dotnet/samples/Concepts/PromptTemplates/SafeChatPrompts.cs:155— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: SafeInputVariableAsync dotnet/samples/Concepts/PromptTemplates/SafeChatPrompts.cs:172— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: EmptyInputVariableAsync dotnet/samples/Concepts/PromptTemplates/SafeChatPrompts.cs:189— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: HtmlEncodedTextAsync dotnet/samples/Concepts/PromptTemplates/SafeChatPrompts.cs:202— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: CDataSectionAsync dotnet/samples/Concepts/PromptTemplates/SafeChatPrompts.cs:215— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TextContentAsync dotnet/samples/Concepts/PromptTemplates/SafeChatPrompts.cs:228— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: PlainTextAsync dotnet/samples/Concepts/PromptTemplates/SafeChatPrompts.cs:243— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: EncodedTextAsync dotnet/samples/Concepts/PromptTemplates/SafeChatPrompts.cs:256— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: UsingTavilyTextSearchAndIncludeEverything dotnet/samples/Concepts/Search/Tavily_TextSearch.cs:92— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: CustomTextGenerationAsync dotnet/samples/Concepts/TextGeneration/Custom_TextGenerationService.cs:49— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: CustomTextGenerationStreamAsync dotnet/samples/Concepts/TextGeneration/Custom_TextGenerationService.cs:63— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: AzureOpenAITextGenerationStreamAsync dotnet/samples/Concepts/TextGeneration/OpenAI_TextGenerationStreaming.cs:21— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: OpenAITextGenerationStreamAsync dotnet/samples/Concepts/TextGeneration/OpenAI_TextGenerationStreaming.cs:35— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: UseA2AAgentStreaming dotnet/samples/GettingStartedWithAgents/A2A/Step01_A2AAgent.cs:36— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
+ 20 more in this group — see findings.md.
X2 · Cancellation propagation· Async method without CancellationToken · ×35
Async method without CancellationToken: CreateFunctionFromLambda dotnet/samples/Demos/AotCompatibility/KernelFunctionSamples.cs:23— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: CreatePluginFromType dotnet/samples/Demos/AotCompatibility/KernelPluginSamples.cs:24— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: ImportPluginFromType dotnet/samples/Demos/AotCompatibility/KernelPluginSamples.cs:55— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: AddPluginFromType dotnet/samples/Demos/AotCompatibility/KernelPluginSamples.cs:86— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: GetChatMessageContent dotnet/samples/Demos/AotCompatibility/OnnxChatCompletionSamples.cs:18— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: GetStreamingChatMessageContents dotnet/samples/Demos/AotCompatibility/OnnxChatCompletionSamples.cs:51— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: BookTableAsync dotnet/samples/Demos/BookingRestaurant/BookingsPlugin.cs:38— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: ListReservationsAsync dotnet/samples/Demos/BookingRestaurant/BookingsPlugin.cs:116— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: CancelReservationAsync dotnet/samples/Demos/BookingRestaurant/BookingsPlugin.cs:132— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: PostAsync REDACTED:25— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: OnPromptRenderAsync dotnet/samples/Demos/ContentSafety/Filters/AttackDetectionFilter.cs:17— No CancellationToken parameter, and the token `context.CancellationToken` carries reaches none of the calls here that take one — this work can't be stopped early once started. Pass `context.CancellationToken` on, or take a CancellationToken.
Async method without CancellationToken: OnPromptRenderAsync dotnet/samples/Demos/ContentSafety/Filters/TextModerationFilter.cs:20— No CancellationToken parameter, and the token `context.CancellationToken` carries reaches none of the calls here that take one — this work can't be stopped early once started. Pass `context.CancellationToken` on, or take a CancellationToken.
Async method without CancellationToken: DetectAttackAsync dotnet/samples/Demos/ContentSafety/Services/PromptShield/PromptShieldService.cs:26— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: PostAsync REDACTED:32— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: PrintWelcomeMessageAsync REDACTED:106— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: DoItAsync REDACTED:119— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: DoItAsync REDACTED:133— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: DoItAsync REDACTED:161— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: OnFunctionInvocationAsync dotnet/samples/Demos/QualityCheck/QualityCheckWithFilters/Filters/BertSummarizationEvaluationFilter.cs:20— No CancellationToken parameter, and the token `context.CancellationToken` carries reaches none of the calls here that take one — this work can't be stopped early once started. Pass `context.CancellationToken` on, or take a CancellationToken.
Async method without CancellationToken: OnFunctionInvocationAsync dotnet/samples/Demos/QualityCheck/QualityCheckWithFilters/Filters/BleuSummarizationEvaluationFilter.cs:20— No CancellationToken parameter, and the token `context.CancellationToken` carries reaches none of the calls here that take one — this work can't be stopped early once started. Pass `context.CancellationToken` on, or take a CancellationToken.
Async method without CancellationToken: OnFunctionInvocationAsync dotnet/samples/Demos/QualityCheck/QualityCheckWithFilters/Filters/CometTranslationEvaluationFilter.cs:19— No CancellationToken parameter, and the token `context.CancellationToken` carries reaches none of the calls here that take one — this work can't be stopped early once started. Pass `context.CancellationToken` on, or take a CancellationToken.
Async method without CancellationToken: OnFunctionInvocationAsync dotnet/samples/Demos/QualityCheck/QualityCheckWithFilters/Filters/MeteorSummarizationEvaluationFilter.cs:19— No CancellationToken parameter, and the token `context.CancellationToken` carries reaches none of the calls here that take one — this work can't be stopped early once started. Pass `context.CancellationToken` on, or take a CancellationToken.
Async method without CancellationToken: SummarizationEvaluationAsync dotnet/samples/Demos/QualityCheck/QualityCheckWithFilters/Program.cs:72— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: TranslationEvaluationAsync dotnet/samples/Demos/QualityCheck/QualityCheckWithFilters/Program.cs:132— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: InvokeAsync dotnet/samples/Demos/QualityCheck/QualityCheckWithFilters/Program.cs:198— No CancellationToken parameter — this work can't be stopped early once started.
FileTooLong: data/vector.py python/semantic_kernel/data/vector.py— FileTooLong — 1150 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 650 over it, 2.30× 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: azure_ai/agent_thread_actions.py python/semantic_kernel/agents/azure_ai/agent_thread_actions.py— FileTooLong — 934 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 434 over it, 1.87× 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: open_ai/responses_agent_thread_actions.py python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py— FileTooLong — 879 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 379 over it, 1.76× 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: connectors/mcp.py python/semantic_kernel/connectors/mcp.py— FileTooLong — 832 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 332 over it, 1.66× 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: connectors/sql_server.py python/semantic_kernel/connectors/sql_server.py— FileTooLong — 762 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 262 over it, 1.52× 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: open_ai/openai_responses_agent.py python/semantic_kernel/agents/open_ai/openai_responses_agent.py— FileTooLong — 750 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 250 over it, 1.50× 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: connectors/azure_cosmos_db.py python/semantic_kernel/connectors/azure_cosmos_db.py— FileTooLong — 749 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 249 over it, 1.50× 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: connectors/oracle.py python/semantic_kernel/connectors/oracle.py— FileTooLong — 738 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 238 over it, 1.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: services/_open_ai_realtime.py python/semantic_kernel/connectors/ai/open_ai/services/_open_ai_realtime.py— FileTooLong — 735 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 235 over it, 1.47× 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: azure_ai/agent_content_generation.py python/semantic_kernel/agents/azure_ai/agent_content_generation.py— FileTooLong — 701 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 201 over it, 1.40× 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: open_ai/openai_assistant_agent.py python/semantic_kernel/agents/open_ai/openai_assistant_agent.py— FileTooLong — 685 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 185 over it, 1.37× 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: connectors/in_memory.py python/semantic_kernel/connectors/in_memory.py— FileTooLong — 676 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 176 over it, 1.35× 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: open_ai/assistant_thread_actions.py python/semantic_kernel/agents/open_ai/assistant_thread_actions.py— FileTooLong — 673 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 173 over it, 1.35× 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: connectors/redis.py python/semantic_kernel/connectors/redis.py— FileTooLong — 662 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 162 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: azure_ai/azure_ai_agent.py python/semantic_kernel/agents/azure_ai/azure_ai_agent.py— FileTooLong — 653 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 153 over it, 1.31× 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: Core/ClientCore.ChatCompletion.cs dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs— FileTooLong — 647 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 147 over it, 1.29× 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: connectors/azure_ai_search.py python/semantic_kernel/connectors/azure_ai_search.py— FileTooLong — 646 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 146 over it, 1.29× 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: connectors/postgres.py python/semantic_kernel/connectors/postgres.py— FileTooLong — 642 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 142 over it, 1.28× 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: in_process/in_process_runtime.py python/semantic_kernel/agents/runtime/in_process/in_process_runtime.py— FileTooLong — 601 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 101 over it, 1.20× 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: connectors/weaviate.py python/semantic_kernel/connectors/weaviate.py— FileTooLong — 587 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 87 over it, 1.17× 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: agents/agent.py python/semantic_kernel/agents/agent.py— FileTooLong — 566 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 66 over it, 1.13× 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: Functions/KernelFunctionFromMethod.cs dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs— FileTooLong — 553 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 53 over it, 1.11× 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: connectors/pinecone.py python/semantic_kernel/connectors/pinecone.py— FileTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 28 over it, 1.06× 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: Clients/GeminiChatCompletionClient.cs dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs— 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: Client/MistralClient.cs dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs— FileTooLong — 515 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 15 over it, 1.03× 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.
Duplicated block (9 lines × 2) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:151— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:151-159 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:273-281 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs` and `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 109 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 × 2) dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchServiceCollectionExtensions.cs:71— dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchServiceCollectionExtensions.cs:71-79 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchServiceCollectionExtensions.cs:118-126 — 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 `dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchServiceCollectionExtensions.cs: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.
Duplicated block (9 lines × 2) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromPrompt.cs:801— dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromPrompt.cs:801-809 | dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromPrompt.cs:866-874 — 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 `dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromPrompt.cs:801` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) dotnet/src/Agents/Core/Chat/KernelFunctionSelectionStrategy.cs:83— dotnet/src/Agents/Core/Chat/KernelFunctionSelectionStrategy.cs:83-91 | dotnet/src/Agents/Core/Chat/KernelFunctionTerminationStrategy.cs:78-86 — 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 (9 lines × 2) dotnet/src/Connectors/Connectors.AzureAIInference/Extensions/AzureAIInferenceServiceCollectionExtensions.DependencyInjection.cs:114— dotnet/src/Connectors/Connectors.AzureAIInference/Extensions/AzureAIInferenceServiceCollectionExtensions.DependencyInjection.cs:114-122 | dotnet/src/Connectors/Connectors.AzureAIInference/Extensions/AzureAIInferenceServiceCollectionExtensions.DependencyInjection.cs:162-170 — 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 `dotnet/src/Connectors/Connectors.AzureAIInference/Extensions/AzureAIInferenceServiceCollectionExtensions.DependencyInjection.cs:114` 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) dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:741— dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:741-749 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs:440-448 — before extracting anything, compare `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs` and `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 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 `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:741` 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) dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:785— dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:785-793 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs:481-489 — before extracting anything, compare `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs` and `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 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 `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:785` 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) dotnet/samples/Demos/OpenAIRealtime/Program.cs:317— dotnet/samples/Demos/OpenAIRealtime/Program.cs:317-325 | dotnet/src/InternalUtilities/src/Functions/FunctionName.cs:58-66 — 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 `fullyQualifiedName` to `string? PluginName) ParseFunctionName(string` in one and `string` 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) dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:184— dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:184-192 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:226-234 — 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 `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:184` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs:210— dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs:210-218 | dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs:275-283 — before extracting anything, compare `dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs` and `dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 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 `dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs:210` 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) dotnet/src/Agents/Core/AgentGroupChat.cs:151— dotnet/src/Agents/Core/AgentGroupChat.cs:151-159 | dotnet/src/Agents/Core/AgentGroupChat.cs:180-188 — 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 `dotnet/src/Agents/Core/AgentGroupChat.cs:151` 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) dotnet/src/Plugins/Plugins.Web/Bing/BingConnector.cs:113— dotnet/src/Plugins/Plugins.Web/Bing/BingConnector.cs:113-121 | dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:430-438 — 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 `dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:430` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) dotnet/src/Plugins/Plugins.Web/Brave/BraveConnector.cs:151— dotnet/src/Plugins/Plugins.Web/Brave/BraveConnector.cs:151-159 | dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:476-484 — 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 `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:476` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) dotnet/src/Agents/Bedrock/Extensions/BedrockAgentInvokeExtensions.cs:232— dotnet/src/Agents/Bedrock/Extensions/BedrockAgentInvokeExtensions.cs:232-240 | dotnet/src/Agents/OpenAI/Internal/ResponseThreadActions.cs:327-335 — 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. 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 (9 lines × 2) python/semantic_kernel/connectors/memory_stores/redis/utils.py:66— python/semantic_kernel/connectors/memory_stores/redis/utils.py:66-74 | python/semantic_kernel/connectors/memory_stores/redis/utils.py:95-103 — 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 `python/semantic_kernel/connectors/memory_stores/redis/utils.py:66` 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 (9 lines × 2) python/semantic_kernel/connectors/postgres.py:502— python/semantic_kernel/connectors/postgres.py:502-510 | python/semantic_kernel/connectors/postgres.py:590-598 — 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) python/semantic_kernel/functions/kernel_function_from_prompt.py:217— python/semantic_kernel/functions/kernel_function_from_prompt.py:217-225 | python/semantic_kernel/functions/kernel_function_from_prompt.py:231-239 — 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 `python/semantic_kernel/functions/kernel_function_from_prompt.py:217` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:373— python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:373-381 | python/semantic_kernel/processes/local_runtime/local_step.py:165-173 — before extracting anything, compare `python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py` and `python/semantic_kernel/processes/local_runtime/local_step.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 130 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) python/semantic_kernel/connectors/memory.py:49— python/semantic_kernel/connectors/memory.py:49-57 | python/semantic_kernel/connectors/search.py:20-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 both call sites, so a change lands once.
Duplicated block (9 lines × 2) python/semantic_kernel/connectors/ai/bedrock/services/model_provider/bedrock_cohere.py:38— python/semantic_kernel/connectors/ai/bedrock/services/model_provider/bedrock_cohere.py:38-46 | python/semantic_kernel/connectors/ai/bedrock/services/model_provider/bedrock_mistralai.py:31-39 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:309— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:309-317 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:184-192 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py` and `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 235 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) python/semantic_kernel/agents/orchestration/concurrent.py:64— python/semantic_kernel/agents/orchestration/concurrent.py:64-81 | python/semantic_kernel/agents/orchestration/sequential.py:56-64 — 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 (9 lines × 2) dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs:27— dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs:27-35 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs:46-54 — 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) dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:74— dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:74-82 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs:69-77 — before extracting anything, compare `dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs` and `dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:74` 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) dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step01_Concurrent/Program.cs:51— dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step01_Concurrent/Program.cs:51-59 | dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step02_Sequential/Program.cs:52-60 — `dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step01_Concurrent/Program.cs` and `dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step02_Sequential/Program.cs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 43 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (11 lines × 2) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:183— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:183-193 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:306-316 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs` and `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 109 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 (11 lines × 2) dotnet/src/SemanticKernel.Core/KernelExtensions.cs:1292— dotnet/src/SemanticKernel.Core/KernelExtensions.cs:1292-1302 | dotnet/src/SemanticKernel.Core/KernelExtensions.cs:1382-1392 — 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 (11 lines × 2) dotnet/src/SemanticKernel.Core/KernelExtensions.cs:1517— dotnet/src/SemanticKernel.Core/KernelExtensions.cs:1517-1527 | dotnet/src/SemanticKernel.Core/KernelExtensions.cs:1613-1623 — 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 (11 lines × 2) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionMetadataFactory.cs:32— dotnet/src/SemanticKernel.Core/Functions/KernelFunctionMetadataFactory.cs:32-42 | dotnet/src/SemanticKernel.Core/Functions/KernelFunctionMetadataFactory.cs:67-77 — 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 `dotnet/src/SemanticKernel.Core/Functions/KernelFunctionMetadataFactory.cs:32` 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 (11 lines × 2) dotnet/src/Agents/Core/AgentGroupChat.cs:69— dotnet/src/Agents/Core/AgentGroupChat.cs:69-79 | dotnet/src/Agents/Core/AgentGroupChat.cs:107-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 `dotnet/src/Agents/Core/AgentGroupChat.cs:69` 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 (11 lines × 2) dotnet/src/Agents/OpenAI/Extensions/OpenAIResponseExtensions.cs:83— dotnet/src/Agents/OpenAI/Extensions/OpenAIResponseExtensions.cs:83-93 | dotnet/src/Agents/OpenAI/Extensions/OpenAIResponseExtensions.cs:115-125 — 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 (11 lines × 2) dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:179— dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:179-189 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:745-756 — 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 (11 lines × 2) dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIServiceCollectionExtensions.DependencyInjection.cs:51— dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIServiceCollectionExtensions.DependencyInjection.cs:51-61 | dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIServiceCollectionExtensions.DependencyInjection.cs:93-103 — 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 `dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIServiceCollectionExtensions.DependencyInjection.cs:51` 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 (11 lines × 2) dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs:112— dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs:112-122 | dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionStreamResponse.cs:106-116 — before extracting anything, compare `dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs` and `dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionStreamResponse.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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 `dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs:112` 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 (11 lines × 2) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:424— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:424-434 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:369-379 — 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) python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:127— python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:127-137 | python/semantic_kernel/agents/open_ai/azure_responses_agent.py:134-144 — before extracting anything, compare `python/semantic_kernel/agents/open_ai/azure_assistant_agent.py` and `python/semantic_kernel/agents/open_ai/azure_responses_agent.py` as WHOLE FILES: this scan already matched 3 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.
Duplicated block (11 lines × 2) python/semantic_kernel/agents/runtime/in_process/in_process_runtime.py:562— python/semantic_kernel/agents/runtime/in_process/in_process_runtime.py:562-572 | python/semantic_kernel/agents/runtime/in_process/in_process_runtime.py:628-638 — 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 `python/semantic_kernel/agents/runtime/in_process/in_process_runtime.py:562` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) python/semantic_kernel/connectors/ai/azure_ai_inference/services/azure_ai_inference_chat_completion.py:139— python/semantic_kernel/connectors/ai/azure_ai_inference/services/azure_ai_inference_chat_completion.py:139-149 | python/semantic_kernel/connectors/ai/azure_ai_inference/services/azure_ai_inference_chat_completion.py:168-178 — 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 (11 lines × 2) python/semantic_kernel/connectors/ai/open_ai/services/open_ai_realtime.py:103— python/semantic_kernel/connectors/ai/open_ai/services/open_ai_realtime.py:103-113 | python/semantic_kernel/connectors/ai/open_ai/services/open_ai_realtime.py:180-190 — 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 (11 lines × 2) python/semantic_kernel/connectors/redis.py:100— python/semantic_kernel/connectors/redis.py:100-110 | python/semantic_kernel/connectors/redis.py:127-137 — 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 `python/semantic_kernel/connectors/redis.py:100` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 2) python/semantic_kernel/contents/history_reducer/chat_history_summarization_reducer.py:87— python/semantic_kernel/contents/history_reducer/chat_history_summarization_reducer.py:87-101 | python/semantic_kernel/contents/history_reducer/chat_history_truncation_reducer.py:41-51 — 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 `python/semantic_kernel/contents/history_reducer/chat_history_summarization_reducer.py:87` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on 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.
Duplicated block (11 lines × 2) python/semantic_kernel/data/vector.py:1099— python/semantic_kernel/data/vector.py:1099-1109 | python/semantic_kernel/kernel.py:507-517 — 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 before the matched lines, `python/semantic_kernel/kernel.py:505` calls `tolist` and `python/semantic_kernel/data/vector.py:1097` 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 (11 lines × 2) python/semantic_kernel/data/vector.py:1116— python/semantic_kernel/data/vector.py:1116-1126 | python/semantic_kernel/kernel.py:534-544 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) python/semantic_kernel/agents/autogen/autogen_conversable_agent.py:83— python/semantic_kernel/agents/autogen/autogen_conversable_agent.py:83-93 | python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:95-105 — 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) python/semantic_kernel/connectors/ai/bedrock/services/bedrock_text_completion.py:146— python/semantic_kernel/connectors/ai/bedrock/services/bedrock_text_completion.py:146-156 | python/semantic_kernel/connectors/ai/bedrock/services/bedrock_text_embedding.py:125-135 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) python/semantic_kernel/connectors/ai/function_calling_utils.py:29— python/semantic_kernel/connectors/ai/function_calling_utils.py:29-39 | python/semantic_kernel/connectors/ai/open_ai/services/_open_ai_realtime.py:105-115 — 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) dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:28— dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:28-38 | dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:49-59 — 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 (11 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step02_ToolCall/Program.cs:50— dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step02_ToolCall/Program.cs:50-60 | dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step03_DependencyInjection/Program.cs:52-62 — 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) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_code_interpreter.py:42— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_code_interpreter.py:42-52 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_file_search.py:38-48 — 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 (11 lines × 2) python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_code_interpreter.py:37— python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_code_interpreter.py:37-47 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_file_search.py:38-48 — 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 (12 lines × 2) dotnet/src/Connectors/Connectors.AzureAIInference/Services/AzureAIInferenceChatCompletionService.cs:43— dotnet/src/Connectors/Connectors.AzureAIInference/Services/AzureAIInferenceChatCompletionService.cs:43-54 | dotnet/src/Connectors/Connectors.AzureAIInference/Services/AzureAIInferenceChatCompletionService.cs:73-84 — 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 `dotnet/src/Connectors/Connectors.AzureAIInference/Services/AzureAIInferenceChatCompletionService.cs:43` 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 (12 lines × 2) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:38— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:38-49 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:156-167 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs` and `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 109 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:143— dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:143-154 | dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:279-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 `dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:143` 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) dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:299— dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:299-310 | dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs:297-308 — before extracting anything, compare `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs` and `dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 137 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 `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:299` 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 (12 lines × 2) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:49— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:49-60 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:93-104 — 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 (12 lines × 2) dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIKernelBuilderExtensions.cs:51— dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIKernelBuilderExtensions.cs:51-62 | dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIKernelBuilderExtensions.cs:91-102 — 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 (12 lines × 2) dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIKernelBuilderExtensions.cs:139— dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIKernelBuilderExtensions.cs:139-150 | dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIKernelBuilderExtensions.cs:183-194 — 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 `dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIKernelBuilderExtensions.cs:139` 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) dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:375— dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:375-386 | dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs:368-379 — before extracting anything, compare `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs` and `dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 137 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) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:273— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:273-284 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:308-319 — 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 `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:273` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:151— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:151-162 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:185-196 — 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 `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:151` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) dotnet/src/Plugins/Plugins.Web/Bing/BingConnector.cs:65— dotnet/src/Plugins/Plugins.Web/Bing/BingConnector.cs:65-76 | dotnet/src/Plugins/Plugins.Web/Brave/BraveConnector.cs:72-83 — 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 (12 lines × 2) dotnet/src/Agents/Abstractions/Internal/KeyEncoder.cs:21— dotnet/src/Agents/Abstractions/Internal/KeyEncoder.cs:21-32 | dotnet/src/Experimental/Process.Core/ListenForBuilder.cs:101-112 — 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. 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) dotnet/src/Agents/Abstractions/Internal/KeyEncoder.cs:21— dotnet/src/Agents/Abstractions/Internal/KeyEncoder.cs:21-32 | dotnet/src/Experimental/Process.Core/ListenForBuilder.cs:101-112 — 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. 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) dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs:107— dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs:107-118 | dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs:500-511 — before extracting anything, compare `dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs` and `dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 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) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:234— python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:234-245 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:262-273 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py` and `python/semantic_kernel/agents/open_ai/assistant_thread_actions.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 204 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. 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) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:1138— python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:1138-1149 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:673-684 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py` and `python/semantic_kernel/agents/open_ai/assistant_thread_actions.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 204 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `agent` to `"AzureAIAgent"` in one and `"OpenAIAssistantAgent"` 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 (12 lines × 2) python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:127— python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:127-138 | python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:157-168 — 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 (12 lines × 2) python/semantic_kernel/utils/telemetry/agent_diagnostics/decorators.py:104— python/semantic_kernel/utils/telemetry/agent_diagnostics/decorators.py:104-115 | python/semantic_kernel/utils/telemetry/agent_diagnostics/decorators.py:142-153 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:1160— python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:1160-1171 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:695-706 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py` and `python/semantic_kernel/agents/open_ai/assistant_thread_actions.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 204 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:294— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:294-305 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:169-180 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py` and `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 235 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) python/semantic_kernel/agents/orchestration/group_chat.py:489— python/semantic_kernel/agents/orchestration/group_chat.py:489-500 | python/semantic_kernel/agents/orchestration/magentic.py:871-882 — 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 (12 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_prompt_templating.py:34— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_prompt_templating.py:34-45 | python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_prompt_templating.py:35-46 — 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 `agent` to `AzureAIAgent` in one and `ChatCompletionAgent` 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 (12 lines × 2) python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py:87— python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py:87-100 | python/samples/concepts/agents/openai_responses/responses_agent_message_callback_streaming.py:77-88 — 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 `python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py:87` 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 lines × 2) python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py:127— python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py:127-138 | python/samples/getting_started_with_agents/multi_agent_orchestration/step4c_handoff_mix_agent_types.py:168-179 — 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) dotnet/src/SemanticKernel.Core/KernelExtensions.cs:1470— dotnet/src/SemanticKernel.Core/KernelExtensions.cs:1470-1479 | dotnet/src/SemanticKernel.Core/KernelExtensions.cs:1564-1573 — 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 (10 lines × 2) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:150— dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:150-159 | dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:192-201 — 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 `dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:150` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:286— dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:286-295 | dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:320-329 — 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 `dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:286` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs:62— dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs:62-71 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs:105-114 — 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 `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs:62` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:668— dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:668-677 | dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:1081-1090 — 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. 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 (10 lines × 2) dotnet/src/Connectors/Connectors.MistralAI/Services/MistralAIChatCompletionService.cs:32— dotnet/src/Connectors/Connectors.MistralAI/Services/MistralAIChatCompletionService.cs:32-41 | dotnet/src/Connectors/Connectors.MistralAI/Services/MistralAITextEmbeddingGenerationService.cs:33-42 — 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 (10 lines × 2) dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProcessActor.cs:419— dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProcessActor.cs:419-428 | dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs:462-471 — 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 `dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProcessActor.cs:419` 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) dotnet/src/Functions/Functions.Grpc/Extensions/GrpcKernelExtensions.cs:110— dotnet/src/Functions/Functions.Grpc/Extensions/GrpcKernelExtensions.cs:110-119 | dotnet/src/Functions/Functions.Grpc/Extensions/GrpcKernelExtensions.cs:140-149 — 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 `dotnet/src/Functions/Functions.Grpc/Extensions/GrpcKernelExtensions.cs:110` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:205— dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:205-214 | dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs:202-211 — before extracting anything, compare `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs` and `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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 `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:205` 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 after the matched lines, `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs:212` calls `TrimOperationDescriptions` and `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:215` 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.
Duplicated block (10 lines × 2) dotnet/src/Experimental/Process.Runtime.Dapr/Actors/EventBufferActor.cs:31— dotnet/src/Experimental/Process.Runtime.Dapr/Actors/EventBufferActor.cs:31-40 | dotnet/src/Experimental/Process.Runtime.Dapr/Actors/MessageBufferActor.cs:31-40 — 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 (10 lines × 2) dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:357— dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:357-366 | dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs:350-359 — before extracting anything, compare `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs` and `dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 137 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 (10 lines × 2) python/semantic_kernel/connectors/ai/nvidia/services/nvidia_chat_completion.py:258— python/semantic_kernel/connectors/ai/nvidia/services/nvidia_chat_completion.py:258-267 | python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py:241-250 — 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 `python/semantic_kernel/connectors/ai/nvidia/services/nvidia_chat_completion.py:258` 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) python/semantic_kernel/connectors/ai/open_ai/services/open_ai_text_to_image_base.py:128— python/semantic_kernel/connectors/ai/open_ai/services/open_ai_text_to_image_base.py:128-137 | python/semantic_kernel/connectors/ai/open_ai/services/open_ai_text_to_image_base.py:233-242 — 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 (10 lines × 2) python/semantic_kernel/connectors/oracle.py:1148— python/semantic_kernel/connectors/oracle.py:1148-1157 | python/semantic_kernel/connectors/oracle.py:1170-1179 — 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 (10 lines × 2) python/semantic_kernel/functions/kernel_function.py:266— python/semantic_kernel/functions/kernel_function.py:266-275 | python/semantic_kernel/functions/kernel_function.py:338-347 — 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 `python/semantic_kernel/functions/kernel_function.py:266` 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) python/semantic_kernel/processes/dapr_runtime/dapr_kernel_process.py:36— python/semantic_kernel/processes/dapr_runtime/dapr_kernel_process.py:36-45 | python/semantic_kernel/processes/local_runtime/local_kernel_process.py:39-48 — 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: `KernelProcessEvent` names `semantic_kernel.processes.kernel_process.kernel_process_event` in one and `semantic_kernel.processes.local_runtime.local_event` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) python/semantic_kernel/agents/autogen/autogen_conversable_agent.py:71— python/semantic_kernel/agents/autogen/autogen_conversable_agent.py:71-80 | python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:83-92 — 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 (10 lines × 2) python/semantic_kernel/connectors/azure_cosmos_db.py:534— python/semantic_kernel/connectors/azure_cosmos_db.py:534-543 | python/semantic_kernel/connectors/mongodb.py:609-618 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) dotnet/samples/Demos/AotCompatibility/KernelPluginSamples.cs:68— dotnet/samples/Demos/AotCompatibility/KernelPluginSamples.cs:68-77 | dotnet/samples/Demos/AotCompatibility/KernelPluginSamples.cs:99-108 — 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 `dotnet/samples/Demos/AotCompatibility/KernelPluginSamples.cs: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 (10 lines × 2) REDACTED:194— REDACTED:194-203 | dotnet/src/Experimental/Process.IntegrationTests.Resources/ProcessCycleTestResources.cs:102-111 — 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 (10 lines × 2) python/samples/concepts/auto_function_calling/function_calling_with_required_type.py:188— python/samples/concepts/auto_function_calling/function_calling_with_required_type.py:188-197 | python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py:207-216 — before extracting anything, compare `python/samples/concepts/auto_function_calling/function_calling_with_required_type.py` and `python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) python/samples/concepts/processes/cycles_with_fan_in.py:108— python/samples/concepts/processes/cycles_with_fan_in.py:108-117 | python/samples/demos/process_with_dapr/process/process.py:33-42 — 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 before the matched lines, `python/samples/demos/process_with_dapr/process/process.py:27` calls `add_step`, `CStepState` and `python/samples/concepts/processes/cycles_with_fan_in.py:105` 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.
BarePragmaDisable dotnet/samples/Concepts/ChatCompletion/AzureOpenAIWithData_ChatCompletion.cs:225— #pragma warning disable AOAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/samples/Concepts/Plugins/ApiManifestBasedPlugins.cs:107— #pragma warning disable SKEXP0050 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/samples/Concepts/Plugins/ApiManifestBasedPlugins.cs:123— #pragma warning disable SKEXP0040 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/samples/Concepts/Plugins/CopilotAgentBasedPlugins.cs:238— #pragma warning disable SKEXP0040 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/samples/Demos/CopilotAgentPlugins/CopilotAgentPluginsDemoSample/DemoCommand.cs:497— #pragma warning disable SKEXP0040 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.Web/Extensions/HttpClientBuilderExtensions.cs:12— #pragma warning disable EXTEXP0001 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/samples/Demos/CopilotAgentPlugins/CopilotAgentPluginsDemoSample/DemoCommand.cs:241— #pragma warning disable SKEXP0001 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/samples/Demos/CopilotAgentPlugins/CopilotAgentPluginsDemoSample/DemoCommand.cs:285— #pragma warning disable SKEXP0001 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/samples/Demos/CopilotAgentPlugins/CopilotAgentPluginsDemoSample/DemoCommand.cs:323— #pragma warning disable SKEXP0001 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/src/Agents/Core/Internal/ChatMessageForPrompt.cs:27— #pragma warning disable SKEXP0001 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/src/Connectors/Connectors.HuggingFace.UnitTests/Services/HuggingFaceImageToTextTests.cs:32— #pragma warning disable SKEXP0010 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/src/Connectors/Connectors.OpenAI.UnitTests/Services/OpenAIChatCompletionServiceTests.cs:1994— #pragma warning disable CS8618, CA1812 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/src/Experimental/Process.IntegrationTests.Resources/ProcessCycleTestResources.cs:12— #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/src/IntegrationTests/Connectors/Google/Gemini/GeminiFunctionCallingTests.cs:468— #pragma warning disable CA1024 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/src/IntegrationTests/Connectors/Onnx/BertOnnxTextEmbeddingGenerationServiceTests.cs:301— #pragma warning disable CA1031 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/src/InternalUtilities/src/EmptyCollections/EmptyReadonlyDictionary.cs:8— #pragma warning disable CA1716 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/src/Plugins/Plugins.Web/Brave/BraveSearchResponse.cs:319— #pragma warning disable CA1056 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/src/Plugins/Plugins.Web/Brave/BraveSearchResponse.cs:441— #pragma warning disable CA1056 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/src/Plugins/Plugins.Web/Brave/BraveWebResult.cs:33— #pragma warning disable CA1056 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable dotnet/src/SemanticKernel.Abstractions/Functions/KernelFunction.cs:50— #pragma warning disable CA1051 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×17
Members sharing a duplicated core (4 members, 50+ identical tokens) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:135— dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:135-159 | dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:175-201 | dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:275-295 | dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:308-329 — 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) dotnet/src/Agents/Bedrock/BedrockAgent.cs:109— dotnet/src/Agents/Bedrock/BedrockAgent.cs:109-162 | dotnet/src/Agents/Bedrock/BedrockAgent.cs:196-229 | dotnet/src/Agents/Bedrock/BedrockAgent.cs:261-314 | dotnet/src/Agents/Bedrock/BedrockAgent.cs:350-391 — 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) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:33— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:33-52 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:67-88 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:151-171 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:186-208 — 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) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:146— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:146-163 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:178-199 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:268-285 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:301-322 — 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) dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:569— dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:569-587 | dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:639-657 | dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:395-413 | dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs:645-663 — 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) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:134— python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:134-460 | python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:487-579 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:162-368 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:396-573 — 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) python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:65— python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:65-139 | python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:158-230 | python/semantic_kernel/agents/open_ai/azure_responses_agent.py:72-146 | python/semantic_kernel/agents/open_ai/azure_responses_agent.py:165-237 — 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) python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:296— python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:296-338 | python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:350-402 | python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:235-277 | python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:289-341 — 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) python/semantic_kernel/connectors/ai/open_ai/services/open_ai_audio_to_text.py:73— python/semantic_kernel/connectors/ai/open_ai/services/open_ai_audio_to_text.py:73-85 | python/semantic_kernel/connectors/ai/open_ai/services/open_ai_text_embedding.py:78-90 | python/semantic_kernel/connectors/ai/open_ai/services/open_ai_text_to_audio.py:73-85 | python/semantic_kernel/connectors/ai/open_ai/services/open_ai_text_to_image.py:73-85 — 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) python/semantic_kernel/connectors/memory_stores/azure_cosmosdb/mongo_vcore_store_api.py:209— python/semantic_kernel/connectors/memory_stores/azure_cosmosdb/mongo_vcore_store_api.py:209-220 | python/semantic_kernel/connectors/memory_stores/azure_cosmosdb/mongo_vcore_store_api.py:224-239 | python/semantic_kernel/connectors/memory_stores/azure_cosmosdb_no_sql/azure_cosmosdb_no_sql_memory_store.py:110-118 | python/semantic_kernel/connectors/memory_stores/azure_cosmosdb_no_sql/azure_cosmosdb_no_sql_memory_store.py:122-137 — 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) dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:25— dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:25-43 | dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:46-66 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs:24-40 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs:43-61 — 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) dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs:68— dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs:68-88 | dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs:99-119 | dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Processes/Steps/GenerateDocumentationStep.cs:68-88 | dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Processes/Steps/GenerateDocumentationStep.cs:99-119 — 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) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py:63— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py:63-89 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter_streaming.py:63-89 | python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter.py:64-90 | python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter_streaming.py:64-90 — 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) python/samples/concepts/agents/openai_responses/responses_agent_binary_content_upload.py:76— python/samples/concepts/agents/openai_responses/responses_agent_binary_content_upload.py:76-184 | python/samples/concepts/agents/openai_responses/responses_agent_plugins_streaming.py:55-96 | python/samples/concepts/agents/openai_responses/responses_agent_reasoning_streaming.py:108-161 | python/samples/concepts/agents/openai_responses/responses_agent_web_search_streaming.py:28-69 — 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) python/samples/concepts/agents/openai_responses/responses_agent_file_search_streaming.py:32— python/samples/concepts/agents/openai_responses/responses_agent_file_search_streaming.py:32-91 | python/samples/getting_started_with_agents/openai_assistant/step3_assistant_vision.py:21-85 | python/samples/getting_started_with_agents/openai_assistant/step5_assistant_tool_file_search.py:27-77 | python/samples/getting_started_with_agents/openai_responses/step5_responses_agent_file_search.py:33-90 — 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) python/samples/concepts/chat_completion/simple_chatbot.py:44— python/samples/concepts/chat_completion/simple_chatbot.py:44-71 | python/samples/concepts/chat_completion/simple_chatbot_logit_bias.py:67-94 | python/samples/concepts/chat_completion/simple_chatbot_store_metadata.py:41-68 | python/samples/concepts/chat_completion/simple_chatbot_with_image.py:62-95 — 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) python/samples/concepts/mcp/servers/menu_agent_server.py:129— python/samples/concepts/mcp/servers/menu_agent_server.py:129-171 | python/samples/concepts/mcp/servers/restaurant_booking_agent_server.py:104-145 | python/samples/demos/mcp_server/agent_as_server.py:116-223 | python/samples/demos/mcp_server/sk_mcp_server.py:100-222 — 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.
Duplicated block (15 lines × 2) dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs:110— dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs:110-124 | dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:522-536 — before extracting anything, compare `dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs` and `dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 80 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 (15 lines × 2) dotnet/src/InternalUtilities/src/Text/BoolJsonConverter.cs:30— dotnet/src/InternalUtilities/src/Text/BoolJsonConverter.cs:30-44 | dotnet/src/InternalUtilities/src/Text/OptionalBoolJsonConverter.cs:30-44 — 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 `dotnet/src/InternalUtilities/src/Text/BoolJsonConverter.cs:30` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:686— dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:686-700 | dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:681-695 — before extracting anything, compare `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs` and `dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 239 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 `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:686` 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) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:412— dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:412-426 | dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:407-421 — before extracting anything, compare `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs` and `dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 239 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 `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:412` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:38— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:38-52 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:74-88 — 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 `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:38` 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 (15 lines × 2) python/semantic_kernel/agents/bedrock/bedrock_agent_base.py:286— python/semantic_kernel/agents/bedrock/bedrock_agent_base.py:286-300 | python/semantic_kernel/agents/bedrock/bedrock_agent_base.py:314-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 `python/semantic_kernel/agents/bedrock/bedrock_agent_base.py:286` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:357— python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:357-371 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:439-453 — before extracting anything, compare `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` and `python/semantic_kernel/agents/open_ai/openai_responses_agent.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 159 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 (15 lines × 2) python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:417— python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:417-431 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:499-513 — before extracting anything, compare `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` and `python/semantic_kernel/agents/open_ai/openai_responses_agent.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 159 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:273— python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:273-287 | python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:214-228 — before extracting anything, compare `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py` and `python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) python/semantic_kernel/connectors/ai/open_ai/services/azure_realtime.py:127— python/semantic_kernel/connectors/ai/open_ai/services/azure_realtime.py:127-141 | python/semantic_kernel/connectors/ai/open_ai/services/azure_realtime.py:287-301 — 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 `python/semantic_kernel/connectors/ai/open_ai/services/azure_realtime.py:127` 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) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:334— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:334-348 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:210-224 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py` and `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 235 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `sort_order` to `Literal["asc", "desc"] = "desc"` in one and `Literal["asc", "desc"] | None = None` 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 (15 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_message_callback_streaming.py:65— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_message_callback_streaming.py:65-79 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_truncation_strategy.py:29-43 — 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 `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_message_callback_streaming.py: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.
Duplicated block (15 lines × 2) python/samples/concepts/chat_completion/simple_chatbot_with_summary_history_reducer.py:118— python/samples/concepts/chat_completion/simple_chatbot_with_summary_history_reducer.py:118-132 | python/samples/concepts/chat_completion/simple_chatbot_with_summary_history_reducer_keep_func_content.py:132-146 — before extracting anything, compare `python/samples/concepts/chat_completion/simple_chatbot_with_summary_history_reducer.py` and `python/samples/concepts/chat_completion/simple_chatbot_with_summary_history_reducer_keep_func_content.py` as WHOLE FILES: 99% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `python/samples/concepts/chat_completion/simple_chatbot_with_summary_history_reducer.py:118` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) python/samples/concepts/mcp/servers/menu_agent_server.py:56— python/samples/concepts/mcp/servers/menu_agent_server.py:56-70 | python/samples/concepts/mcp/servers/restaurant_booking_agent_server.py:57-71 — before extracting anything, compare `python/samples/concepts/mcp/servers/menu_agent_server.py` and `python/samples/concepts/mcp/servers/restaurant_booking_agent_server.py` as WHOLE FILES: this scan already matched 4 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. 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (15 lines × 2) python/samples/getting_started_with_agents/openai_assistant/step2_assistant_plugins.py:64— python/samples/getting_started_with_agents/openai_assistant/step2_assistant_plugins.py:64-79 | python/samples/getting_started_with_agents/openai_assistant/step5_assistant_tool_file_search.py:58-72 — 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 `python/samples/getting_started_with_agents/openai_assistant/step2_assistant_plugins.py: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `python/samples/getting_started_with_agents/openai_assistant/step2_assistant_plugins.py:63` calls `MenuPlugin` and `python/samples/getting_started_with_agents/openai_assistant/step5_assistant_tool_file_search.py:57` 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.
Duplicated block (15 lines × 2) python/samples/getting_started_with_processes/step03/steps/cut_food_with_sharpening_step.py:49— python/samples/getting_started_with_processes/step03/steps/cut_food_with_sharpening_step.py:49-63 | python/samples/getting_started_with_processes/step03/steps/cut_food_with_sharpening_step.py:68-82 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) python/samples/concepts/plugins/openai_function_calling_with_custom_plugin.py:26— python/samples/concepts/plugins/openai_function_calling_with_custom_plugin.py:26-40 | python/samples/concepts/structured_outputs/json_structured_outputs_function_calling.py:42-56 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:184— dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:184-196 | dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:312-324 — 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 `dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:184` 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 (13 lines × 2) dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:297— dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:297-309 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:340-352 — 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 `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:297` 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, `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:337` calls `NotNull` and `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:294` 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 (13 lines × 2) dotnet/src/Connectors/Connectors.Google/Models/Gemini/GeminiFunctionToolCall.cs:25— dotnet/src/Connectors/Connectors.Google/Models/Gemini/GeminiFunctionToolCall.cs:25-37 | dotnet/src/Connectors/Connectors.Google/Models/Gemini/GeminiFunctionToolCall.cs:56-68 — 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) dotnet/src/Agents/AzureAI/Extensions/AgentDefinitionExtensions.cs:114— dotnet/src/Agents/AzureAI/Extensions/AgentDefinitionExtensions.cs:114-126 | dotnet/src/Agents/AzureAI/Extensions/AgentDefinitionExtensions.cs:143-155 — 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 `dotnet/src/Agents/AzureAI/Extensions/AgentDefinitionExtensions.cs:114` 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 (13 lines × 2) dotnet/src/Agents/Core/ChatCompletionAgent.cs:340— dotnet/src/Agents/Core/ChatCompletionAgent.cs:340-352 | dotnet/src/Agents/Core/ChatCompletionAgent.cs:393-405 — 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) dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIServiceCollectionExtensions.cs:47— dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIServiceCollectionExtensions.cs:47-59 | dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIServiceCollectionExtensions.cs:85-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.
Duplicated block (13 lines × 2) dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIServiceCollectionExtensions.cs:131— dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIServiceCollectionExtensions.cs:131-143 | dotnet/src/Connectors/Connectors.Google/Extensions/VertexAIServiceCollectionExtensions.cs:172-184 — 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) dotnet/src/Agents/Abstractions/AgentChat.cs:246— dotnet/src/Agents/Abstractions/AgentChat.cs:246-258 | dotnet/src/Agents/Abstractions/AgentChat.cs: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 `dotnet/src/Agents/Abstractions/AgentChat.cs:246` 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 (13 lines × 2) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandService.cs:59— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandService.cs:59-71 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:88-100 — 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. 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 (13 lines × 2) dotnet/src/Plugins/Plugins.Web/Bing/BingConnector.cs:91— dotnet/src/Plugins/Plugins.Web/Bing/BingConnector.cs:91-103 | dotnet/src/Plugins/Plugins.Web/Google/GoogleConnector.cs:103-115 — 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 `dotnet/src/Plugins/Plugins.Web/Bing/BingConnector.cs:91` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) dotnet/src/Connectors/Connectors.Google/Core/Gemini/Models/GeminiRequest.cs:555— dotnet/src/Connectors/Connectors.Google/Core/Gemini/Models/GeminiRequest.cs:555-567 | dotnet/src/InternalUtilities/src/Schema/KernelJsonSchemaBuilder.cs:66-78 — 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. 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 (13 lines × 2) dotnet/src/Connectors/Connectors.Google/Core/ClientBase.cs:76— dotnet/src/Connectors/Connectors.Google/Core/ClientBase.cs:76-88 | dotnet/src/Connectors/Connectors.HuggingFace/Core/HuggingFaceClient.cs:96-109 — 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 (13 lines × 2) python/semantic_kernel/agents/open_ai/assistant_content_generation.py:70— python/semantic_kernel/agents/open_ai/assistant_content_generation.py:70-82 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:116-128 — 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 `python/semantic_kernel/agents/open_ai/assistant_content_generation.py:70` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) python/semantic_kernel/agents/orchestration/magentic.py:398— python/semantic_kernel/agents/orchestration/magentic.py:398-410 | python/semantic_kernel/agents/orchestration/magentic.py:430-442 — 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 `python/semantic_kernel/agents/orchestration/magentic.py:398` 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) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:986— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:986-999 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:720-732 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py` and `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 235 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:717` calls `str` and `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:983` 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.
Duplicated block (13 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py:123— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py:123-135 | python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter.py:121-133 — `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 76 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) python/samples/concepts/agents/openai_responses/responses_agent_reasoning.py:91— python/samples/concepts/agents/openai_responses/responses_agent_reasoning.py:91-103 | python/samples/concepts/agents/openai_responses/responses_agent_reasoning_streaming.py:92-104 — before extracting anything, compare `python/samples/concepts/agents/openai_responses/responses_agent_reasoning.py` and `python/samples/concepts/agents/openai_responses/responses_agent_reasoning_streaming.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 64 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 (19 lines × 2) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:927— dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:927-945 | dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:896-914 — before extracting anything, compare `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs` and `dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 239 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 `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:927` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (19 lines × 2) dotnet/src/Agents/Magentic/MagenticOrchestration.cs:53— dotnet/src/Agents/Magentic/MagenticOrchestration.cs:53-71 | dotnet/src/Agents/Orchestration/GroupChat/GroupChatOrchestration.cs:52-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. Read the line range as the matched WINDOW rather than a finished unit: at `dotnet/src/Agents/Magentic/MagenticOrchestration.cs:53` 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 (19 lines × 2) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:106— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:106-124 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:226-244 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs` and `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 109 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) dotnet/src/Extensions/PromptTemplates.Handlebars/HandlebarsPromptTemplate.cs:184— dotnet/src/Extensions/PromptTemplates.Handlebars/HandlebarsPromptTemplate.cs:184-202 | dotnet/src/Extensions/PromptTemplates.Liquid/LiquidPromptTemplate.cs:247-265 — 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. 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 (19 lines × 2) python/semantic_kernel/agents/azure_ai/agent_content_generation.py:528— python/semantic_kernel/agents/azure_ai/agent_content_generation.py:528-546 | python/semantic_kernel/agents/open_ai/assistant_content_generation.py:434-452 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_content_generation.py` and `python/semantic_kernel/agents/open_ai/assistant_content_generation.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 91 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 (19 lines × 2) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:205— python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:205-223 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:234-252 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py` and `python/semantic_kernel/agents/open_ai/assistant_thread_actions.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 204 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 `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:205` 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 lines × 2) python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:451— python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:451-469 | python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:490-509 — 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 (19 lines × 2) python/semantic_kernel/connectors/ai/chat_completion_client_base.py:115— python/semantic_kernel/connectors/ai/chat_completion_client_base.py:115-133 | python/semantic_kernel/connectors/ai/chat_completion_client_base.py:230-248 — 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 (19 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureOpenAI/Step01_Basics/Program.cs:57— dotnet/samples/AgentFrameworkMigration/AzureOpenAI/Step01_Basics/Program.cs:57-75 | dotnet/samples/AgentFrameworkMigration/OpenAI/Step01_Basics/Program.cs:57-75 — before extracting anything, compare `dotnet/samples/AgentFrameworkMigration/AzureOpenAI/Step01_Basics/Program.cs` and `dotnet/samples/AgentFrameworkMigration/OpenAI/Step01_Basics/Program.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 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 (19 lines × 2) dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs:69— dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs:69-87 | dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Processes/Steps/GenerateDocumentationStep.cs:69-87 — before extracting anything, compare `dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs` and `dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Processes/Steps/GenerateDocumentationStep.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 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 (19 lines × 2) dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs:100— dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs:100-118 | dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Processes/Steps/GenerateDocumentationStep.cs:100-118 — before extracting anything, compare `dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs` and `dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Processes/Steps/GenerateDocumentationStep.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 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 (19 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_code_interpreter_streaming_with_message_callback.py:35— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_code_interpreter_streaming_with_message_callback.py:35-53 | python/samples/getting_started_with_agents/azure_ai_agent/step04_azure_ai_agent_code_interpreter.py:35-53 — 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 (19 lines × 2) python/samples/concepts/auto_function_calling/chat_completion_with_auto_function_calling.py:84— python/samples/concepts/auto_function_calling/chat_completion_with_auto_function_calling.py:84-102 | python/samples/concepts/auto_function_calling/chat_completion_with_manual_function_calling.py:113-131 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) python/samples/concepts/local_models/onnx_chat_completion.py:35— python/samples/concepts/local_models/onnx_chat_completion.py:35-53 | python/samples/concepts/local_models/onnx_phi3_vision_completion.py:41-59 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) python/samples/demos/telemetry/main.py:66— python/samples/demos/telemetry/main.py:66-84 | python/samples/getting_started_with_agents/multi_agent_orchestration/observability.py:43-61 — 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 (19 lines × 2) python/samples/concepts/setup/text_completion_services.py:138— python/samples/concepts/setup/text_completion_services.py:138-157 | python/samples/concepts/setup/text_embedding_services.py:179-197 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (16 lines × 2) dotnet/src/Agents/Bedrock/BedrockAgent.cs:130— dotnet/src/Agents/Bedrock/BedrockAgent.cs:130-145 | dotnet/src/Agents/Bedrock/BedrockAgent.cs:283-298 — 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 (16 lines × 2) dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:209— dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:209-224 | dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs:206-221 — before extracting anything, compare `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs` and `dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 137 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 `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:209` 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 (16 lines × 2) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:105— dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:105-120 | dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:82-97 — before extracting anything, compare `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs` and `dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 239 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 `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:105` 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 (16 lines × 2) dotnet/src/Agents/Bedrock/BedrockAgent.cs:199— dotnet/src/Agents/Bedrock/BedrockAgent.cs:199-214 | dotnet/src/Agents/Bedrock/BedrockAgent.cs:353-368 — 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 (16 lines × 2) dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.DependencyInjection.cs:61— dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.DependencyInjection.cs:61-76 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.DependencyInjection.cs:121-136 — 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 `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.DependencyInjection.cs:61` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (16 lines × 2) dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.DependencyInjection.cs:234— dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.DependencyInjection.cs:234-249 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.DependencyInjection.cs:290-305 — 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 `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.DependencyInjection.cs:234` 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 (16 lines × 2) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:156— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:156-171 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:193-208 — 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 `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:156` 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 (16 lines × 2) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:837— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:837-852 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:944-959 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py` and `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 235 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 `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:837` 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 (16 lines × 2) python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:323— python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:323-338 | python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:262-277 — before extracting anything, compare `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py` and `python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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 `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:323` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `response` to `GenerateContentResponse` in one and `GenerationResponse` 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 (16 lines × 2) python/semantic_kernel/connectors/azure_ai_search.py:376— python/semantic_kernel/connectors/azure_ai_search.py:376-391 | python/semantic_kernel/connectors/azure_ai_search.py:409-424 — 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 (16 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs:74— dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs:74-89 | dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step02_ToolCall/Program.cs:92-107 — `dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs` and `dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step02_ToolCall/Program.cs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs:74` 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 (16 lines × 2) dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/ProofreadDocumentationStep.cs:58— dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/ProofreadDocumentationStep.cs:58-73 | dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Processes/Steps/ProofreadDocumentationStep.cs:58-73 — before extracting anything, compare `dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/ProofreadDocumentationStep.cs` and `dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Processes/Steps/ProofreadDocumentationStep.cs` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/ProofreadDocumentationStep.cs:58` 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 (16 lines × 2) dotnet/samples/Demos/ProcessFrameworkWithAspire/ProcessFramework.Aspire/ProcessFramework.Aspire.ServiceDefaults/CommonExtensions.cs:141— dotnet/samples/Demos/ProcessFrameworkWithAspire/ProcessFramework.Aspire/ProcessFramework.Aspire.ServiceDefaults/CommonExtensions.cs:141-156 | dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ServiceDefaults/CommonExtensions.cs:153-168 — before extracting anything, compare `dotnet/samples/Demos/ProcessFrameworkWithAspire/ProcessFramework.Aspire/ProcessFramework.Aspire.ServiceDefaults/CommonExtensions.cs` and `dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ServiceDefaults/CommonExtensions.cs` as WHOLE FILES: 95% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (16 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_retrieve_messages_from_thread.py:48— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_retrieve_messages_from_thread.py:48-63 | python/samples/getting_started_with_agents/azure_ai_agent/step02_azure_ai_agent_plugin.py:47-62 — before extracting anything, compare `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_retrieve_messages_from_thread.py` and `python/samples/getting_started_with_agents/azure_ai_agent/step02_azure_ai_agent_plugin.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 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 `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_retrieve_messages_from_thread.py:48` 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 (16 lines × 2) python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_summary_history_reducer_single_agent.py:44— python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_summary_history_reducer_single_agent.py:44-59 | python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_truncate_history_reducer_single_agent.py:46-61 — 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 `python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_summary_history_reducer_single_agent.py:44` 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 (16 lines × 2) python/samples/concepts/agents/openai_responses/responses_agent_message_callback.py:64— python/samples/concepts/agents/openai_responses/responses_agent_message_callback.py:64-79 | python/samples/concepts/agents/openai_responses/responses_agent_message_callback_streaming.py:64-79 — 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 `python/samples/concepts/agents/openai_responses/responses_agent_message_callback.py: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.
Duplicated block (5 lines × 2) dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs:86— dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs:86-90 | dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/DeclarativeAgentExtensions.cs:53-57 — 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) dotnet/src/Connectors/Connectors.AzureAIInference/Extensions/AzureAIInferenceServiceCollectionExtensions.DependencyInjection.cs:34— dotnet/src/Connectors/Connectors.AzureAIInference/Extensions/AzureAIInferenceServiceCollectionExtensions.DependencyInjection.cs:34-38 | dotnet/src/Connectors/Connectors.AzureAIInference/Extensions/AzureAIInferenceServiceCollectionExtensions.DependencyInjection.cs:68-72 — 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 `dotnet/src/Connectors/Connectors.AzureAIInference/Extensions/AzureAIInferenceServiceCollectionExtensions.DependencyInjection.cs:34` 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) dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.cs:57— dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.cs:57-61 | dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.cs:88-92 — 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, `dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.cs:53` calls `NotNullOrWhiteSpace` and `dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.cs:84` 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 (5 lines × 2) dotnet/src/Connectors/Connectors.OpenAI/Services/OpenAIFileService.cs:62— dotnet/src/Connectors/Connectors.OpenAI/Services/OpenAIFileService.cs:62-66 | dotnet/src/Connectors/Connectors.OpenAI/Services/OpenAIFileService.cs:85-89 — 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) dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:91— dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:91-95 | dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:110-114 — 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) dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProcessActor.cs:175— dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProcessActor.cs:175-179 | dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs:190-194 — 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) dotnet/src/InternalUtilities/src/Diagnostics/ModelDiagnostics.cs:242— dotnet/src/InternalUtilities/src/Diagnostics/ModelDiagnostics.cs:242-246 | dotnet/src/InternalUtilities/src/Diagnostics/ModelDiagnostics.cs:547-551 — 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 `dotnet/src/InternalUtilities/src/Diagnostics/ModelDiagnostics.cs:242` 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) dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/AutoFunctionChoiceBehavior.cs:40— dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/AutoFunctionChoiceBehavior.cs:40-44 | dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/RequiredFunctionChoiceBehavior.cs:43-47 — 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) python/semantic_kernel/agents/orchestration/group_chat.py:110— python/semantic_kernel/agents/orchestration/group_chat.py:110-114 | python/semantic_kernel/agents/orchestration/handoffs.py:255-259 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `message` to `GroupChatStartMessage` in one and `HandoffStartMessage` 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 (5 lines × 2) python/semantic_kernel/agents/runtime/in_process/type_prefix_subscription.py:54— python/semantic_kernel/agents/runtime/in_process/type_prefix_subscription.py:54-58 | python/semantic_kernel/agents/runtime/in_process/type_subscription.py:56-60 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 2) REDACTED:148— REDACTED:148-152 | REDACTED:63-67 — 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) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:92— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:92-96 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:84-88 — 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 `fn` to `Callable[[ToolSpec, Kernel | None], ToolDefinition]` in one and `Callable[[ToolSpec, Kernel | None], ToolParam]` 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 (5 lines × 2) python/semantic_kernel/agents/azure_ai/azure_ai_channel.py:117— python/semantic_kernel/agents/azure_ai/azure_ai_channel.py:117-121 | python/semantic_kernel/agents/channels/open_ai_assistant_channel.py:117-121 — 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) python/semantic_kernel/agents/runtime/in_process/type_prefix_subscription.py:61— python/semantic_kernel/agents/runtime/in_process/type_prefix_subscription.py:61-67 | python/semantic_kernel/agents/runtime/in_process/type_subscription.py:63-67 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on 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.
Duplicated block (5 lines × 2) python/samples/concepts/grounding/grounded.py:158— python/samples/concepts/grounding/grounded.py:158-162 | python/samples/concepts/grounding/grounded.py:164-168 — 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) python/samples/concepts/realtime/realtime_agent_with_function_calling_webrtc.py:52— python/samples/concepts/realtime/realtime_agent_with_function_calling_webrtc.py:52-56 | python/samples/concepts/realtime/realtime_agent_with_function_calling_websocket.py:41-45 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:231— dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:231-238 | dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:214-221 — before extracting anything, compare `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs` and `dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 239 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 `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:231` 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) dotnet/src/Agents/Magentic/MagenticManagerActor.cs:144— dotnet/src/Agents/Magentic/MagenticManagerActor.cs:144-151 | dotnet/src/Agents/Magentic/MagenticManagerActor.cs:168-175 — 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 `dotnet/src/Agents/Magentic/MagenticManagerActor.cs:144` 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) dotnet/src/Functions/Functions.OpenApi/Extensions/OpenApiKernelExtensions.cs:118— dotnet/src/Functions/Functions.OpenApi/Extensions/OpenApiKernelExtensions.cs:118-125 | dotnet/src/Functions/Functions.OpenApi/Extensions/OpenApiKernelExtensions.cs:157-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.
Duplicated block (8 lines × 2) dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:203— dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:203-210 | dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:258-265 — 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 `dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:203` 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 (8 lines × 2) dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:252— dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:252-259 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs:132-139 — before extracting anything, compare `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs` and `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 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 `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs: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. 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) dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:821— dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:821-828 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs:516-523 — before extracting anything, compare `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs` and `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 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 `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:821` 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) dotnet/src/Connectors/Connectors.HuggingFace/Services/HuggingFaceEmbeddingGenerator.cs:106— dotnet/src/Connectors/Connectors.HuggingFace/Services/HuggingFaceEmbeddingGenerator.cs:106-113 | dotnet/src/Connectors/Connectors.MistralAI/Services/MistralAIEmbeddingGenerator.cs:69-76 — 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. 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) python/samples/concepts/service_selector/custom_service_selector.py:29— python/samples/concepts/service_selector/custom_service_selector.py:29-36 | python/semantic_kernel/services/ai_service_selector.py:52-59 — 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 lines × 2) python/semantic_kernel/agents/orchestration/group_chat.py:504— python/semantic_kernel/agents/orchestration/group_chat.py:504-511 | python/semantic_kernel/agents/orchestration/magentic.py:885-892 — 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 (8 lines × 2) python/semantic_kernel/connectors/ai/nvidia/services/nvidia_chat_completion.py:198— python/semantic_kernel/connectors/ai/nvidia/services/nvidia_chat_completion.py:198-205 | python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py:170-177 — 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, `python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py:178` calls `hasattr`, `TextContent` and `python/semantic_kernel/connectors/ai/nvidia/services/nvidia_chat_completion.py:207` 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) python/semantic_kernel/processes/dapr_runtime/actors/event_buffer_actor.py:61— python/semantic_kernel/processes/dapr_runtime/actors/event_buffer_actor.py:61-68 | python/semantic_kernel/processes/dapr_runtime/actors/external_event_buffer_actor.py:73-80 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:206— python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:206-213 | python/semantic_kernel/processes/local_runtime/local_step.py:205-212 — before extracting anything, compare `python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py` and `python/semantic_kernel/processes/local_runtime/local_step.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 130 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 `python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:206` 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) python/semantic_kernel/processes/dapr_runtime/actors/process_actor.py:175— python/semantic_kernel/processes/dapr_runtime/actors/process_actor.py:175-182 | python/semantic_kernel/processes/local_runtime/local_process.py:108-115 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureOpenAI/Step03_DependencyInjection/Program.cs:75— dotnet/samples/AgentFrameworkMigration/AzureOpenAI/Step03_DependencyInjection/Program.cs:75-82 | dotnet/samples/AgentFrameworkMigration/OpenAI/Step03_DependencyInjection/Program.cs:74-81 — 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 `dotnet/samples/AgentFrameworkMigration/AzureOpenAI/Step03_DependencyInjection/Program.cs: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 (8 lines × 2) python/samples/concepts/search/brave_text_search_as_plugin.py:89— python/samples/concepts/search/brave_text_search_as_plugin.py:89-96 | python/samples/concepts/search/google_text_search_as_plugin.py:97-104 — 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 (7 lines × 2) dotnet/src/SemanticKernel.Abstractions/Functions/KernelParameterMetadata.cs:56— dotnet/src/SemanticKernel.Abstractions/Functions/KernelParameterMetadata.cs:56-62 | dotnet/src/SemanticKernel.Abstractions/Functions/KernelParameterMetadata.cs:73-79 — 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 (7 lines × 2) dotnet/src/SemanticKernel.Abstractions/PromptTemplate/PromptTemplateConfig.cs:238— dotnet/src/SemanticKernel.Abstractions/PromptTemplate/PromptTemplateConfig.cs:238-244 | dotnet/src/SemanticKernel.Abstractions/PromptTemplate/PromptTemplateConfig.cs:266-272 — 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 `dotnet/src/SemanticKernel.Abstractions/PromptTemplate/PromptTemplateConfig.cs:238` 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 (7 lines × 2) dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProcessActor.cs:385— dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProcessActor.cs:385-391 | dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProcessActor.cs:425-431 — 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 `dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProcessActor.cs:385` 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) dotnet/src/SemanticKernel.Abstractions/Functions/KernelParameterMetadata.cs:101— dotnet/src/SemanticKernel.Abstractions/Functions/KernelParameterMetadata.cs:101-107 | dotnet/src/SemanticKernel.Abstractions/Functions/KernelReturnParameterMetadata.cs:77-83 — 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 (7 lines × 2) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:450— python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:450-456 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:358-364 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py` and `python/semantic_kernel/agents/open_ai/assistant_thread_actions.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 204 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 `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:450` 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) python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_text_completion.py:99— python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_text_completion.py:99-105 | python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_text_completion.py:121-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.
Duplicated block (7 lines × 2) python/semantic_kernel/connectors/brave.py:157— python/semantic_kernel/connectors/brave.py:157-163 | python/semantic_kernel/connectors/google_search.py:197-203 — 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 `python/semantic_kernel/connectors/brave.py:157` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) python/semantic_kernel/connectors/brave.py:258— python/semantic_kernel/connectors/brave.py:258-264 | python/semantic_kernel/connectors/google_search.py:286-292 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `python/semantic_kernel/connectors/brave.py:254` calls `_get_url` and `python/semantic_kernel/connectors/google_search.py:283` 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 (7 lines × 2) python/semantic_kernel/agents/runtime/in_process/type_prefix_subscription.py:26— python/semantic_kernel/agents/runtime/in_process/type_prefix_subscription.py:26-32 | python/semantic_kernel/agents/runtime/in_process/type_subscription.py:22-34 — 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, `python/semantic_kernel/agents/runtime/in_process/type_prefix_subscription.py:21` calls `topic_type_prefix`, `agent_type` and `python/semantic_kernel/agents/runtime/in_process/type_subscription.py:18` 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 (7 lines × 2) python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:245— python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:245-251 | python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:186-192 — before extracting anything, compare `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py` and `python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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 (7 lines × 2) dotnet/samples/Demos/AmazonBedrockModels/Program.cs:53— dotnet/samples/Demos/AmazonBedrockModels/Program.cs:53-59 | dotnet/samples/Demos/AmazonBedrockModels/Program.cs:129-135 — 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 `dotnet/samples/Demos/AmazonBedrockModels/Program.cs:53` 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 (7 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step03_DependencyInjection/Program.cs:97— dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step03_DependencyInjection/Program.cs:97-103 | dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step03_DependencyInjection/Program.cs:135-141 — 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, `dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step03_DependencyInjection/Program.cs:92` calls `AsAIAgent` and `dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step03_DependencyInjection/Program.cs:130` 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 (7 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_as_kernel_function.py:28— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_as_kernel_function.py:28-34 | python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_as_kernel_function.py:23-29 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_file_search.py:41— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_file_search.py:41-48 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_file_manipulation.py:26-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. Read the line range as the matched WINDOW rather than a finished unit: at `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_file_search.py:41` 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) python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_message_callback.py:50— python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_message_callback.py:50-56 | python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_message_callback_streaming.py:47-53 — 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.
Prerelease dependency: Microsoft.Extensions.AI.AzureAIInference — Microsoft.Extensions.AI.AzureAIInference resolves to 10.0.0-preview.1.25559.3, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Prerelease dependency: ModelContextProtocol — ModelContextProtocol resolves to 0.4.0-preview.3, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Prerelease dependency: Microsoft.SemanticKernel.Planners.OpenAI — Microsoft.SemanticKernel.Planners.OpenAI resolves to 1.47.0-preview, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Prerelease dependency: A2A — A2A resolves to 0.3.1-preview, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Prerelease dependency: System.CommandLine — System.CommandLine resolves to 2.0.0-beta4.22272.1, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Prerelease dependency: A2A.AspNetCore — A2A.AspNetCore resolves to 0.3.1-preview, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Prerelease dependency: Aspire.Azure.AI.OpenAI — Aspire.Azure.AI.OpenAI resolves to 9.3.1-preview.1.25305.6, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Prerelease dependency: Microsoft.Agents.CopilotStudio.Client — Microsoft.Agents.CopilotStudio.Client resolves to 1.1.107-beta, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Prerelease dependency: Azure.AI.OpenAI — Azure.AI.OpenAI resolves to 2.9.0-beta.1, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Prerelease dependency: Microsoft.OpenApi.ApiManifest — Microsoft.OpenApi.ApiManifest resolves to 0.5.6-preview, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Prerelease dependency: Microsoft.Plugins.Manifest — Microsoft.Plugins.Manifest resolves to 1.0.0-rc3, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Prerelease dependency: Prompty.Core — Prompty.Core resolves to 2.0.0-beta.3, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Prerelease dependency: Milvus.Client — Milvus.Client resolves to 2.3.0-preview.1, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Duplicated block (17 lines × 2) dotnet/src/Functions/Functions.OpenApi/Model/RestApiOperation.cs:220— dotnet/src/Functions/Functions.OpenApi/Model/RestApiOperation.cs:220-236 | dotnet/src/Functions/Functions.OpenApi/Model/RestApiOperation.cs:324-340 — 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 `dotnet/src/Functions/Functions.OpenApi/Model/RestApiOperation.cs:220` 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) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaRequest.cs:31— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaRequest.cs:31-47 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/LlamaRequest.cs:20-36 — 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 before the matched lines, `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaRequest.cs:27` calls `JsonPropertyName`, `JsonIgnore` and `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/LlamaRequest.cs:17` 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 (17 lines × 2) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:492— dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:492-508 | dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:489-505 — before extracting anything, compare `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs` and `dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 239 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 `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:492` 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) dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs:12— dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs:12-28 | dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionStreamResponse.cs:12-28 — before extracting anything, compare `dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs` and `dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionStreamResponse.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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 (17 lines × 2) dotnet/src/SemanticKernel.Abstractions/AI/ChatClient/ChatClientExtensions.cs:30— dotnet/src/SemanticKernel.Abstractions/AI/ChatClient/ChatClientExtensions.cs:30-46 | dotnet/src/SemanticKernel.Abstractions/AI/ChatClient/ChatClientExtensions.cs:62-80 — 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 `dotnet/src/SemanticKernel.Abstractions/AI/ChatClient/ChatClientExtensions.cs: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:413— python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:413-429 | python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:510-526 — 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 `python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:413` 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) python/semantic_kernel/connectors/azure_ai_search.py:662— python/semantic_kernel/connectors/azure_ai_search.py:662-678 | python/semantic_kernel/connectors/azure_cosmos_db.py:892-908 — 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) REDACTED:56— REDACTED:56-72 | REDACTED:47-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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (17 lines × 2) python/samples/concepts/agents/openai_responses/responses_agent_reuse_existing_thread_id.py:34— python/samples/concepts/agents/openai_responses/responses_agent_reuse_existing_thread_id.py:34-50 | python/samples/getting_started_with_agents/openai_responses/step2_responses_agent_thread_management.py:35-51 — before extracting anything, compare `python/samples/concepts/agents/openai_responses/responses_agent_reuse_existing_thread_id.py` and `python/samples/getting_started_with_agents/openai_responses/step2_responses_agent_thread_management.py` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `python/samples/concepts/agents/openai_responses/responses_agent_reuse_existing_thread_id.py:34` 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 (17 lines × 2) python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py:149— python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py:149-165 | python/samples/concepts/auto_function_calling/functions_defined_in_yaml_prompt.py:146-162 — before extracting anything, compare `python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py` and `python/samples/concepts/auto_function_calling/functions_defined_in_yaml_prompt.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 79 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 (17 lines × 2) python/samples/concepts/mcp/azure_ai_agent_with_local_server.py:88— python/samples/concepts/mcp/azure_ai_agent_with_local_server.py:88-104 | python/samples/concepts/mcp/local_agent_with_local_server.py:92-108 — 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) python/samples/getting_started_with_processes/step03/processes/fried_fish_process.py:66— python/samples/getting_started_with_processes/step03/processes/fried_fish_process.py:66-82 | python/samples/getting_started_with_processes/step03/processes/fried_fish_process.py:102-118 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (18 lines × 2) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:217— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:217-234 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:341-358 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs` and `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 109 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 (18 lines × 2) dotnet/src/Agents/AzureAI/AzureAIAgent.cs:182— dotnet/src/Agents/AzureAI/AzureAIAgent.cs:182-199 | dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs:181-198 — before extracting anything, compare `dotnet/src/Agents/AzureAI/AzureAIAgent.cs` and `dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 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 `dotnet/src/Agents/AzureAI/AzureAIAgent.cs:182` 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, `dotnet/src/Agents/AzureAI/AzureAIAgent.cs:181` calls `ToAzureAIInvocationOptions` and `dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs:180` 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 (18 lines × 2) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:896— dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:896-913 | dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:865-882 — before extracting anything, compare `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs` and `dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 239 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 (18 lines × 2) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:75— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:75-92 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:133-150 — 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 `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:75` 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 (18 lines × 2) dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:249— dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:249-266 | dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs:246-263 — before extracting anything, compare `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs` and `dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 137 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 (18 lines × 2) python/semantic_kernel/agents/azure_ai/agent_content_generation.py:835— python/semantic_kernel/agents/azure_ai/agent_content_generation.py:835-852 | python/semantic_kernel/agents/open_ai/assistant_content_generation.py:490-507 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_content_generation.py` and `python/semantic_kernel/agents/open_ai/assistant_content_generation.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 91 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) python/semantic_kernel/connectors/ai/nvidia/services/nvidia_chat_completion.py:223— python/semantic_kernel/connectors/ai/nvidia/services/nvidia_chat_completion.py:223-240 | python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py:197-214 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step01_Basics/Program.cs:53— dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step01_Basics/Program.cs:53-70 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs:117-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. Read the line range as the matched WINDOW rather than a finished unit: at `dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step01_Basics/Program.cs:53` 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 (18 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter_streaming.py:123— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter_streaming.py:123-140 | python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter_streaming.py:121-138 — `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter_streaming.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter_streaming.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 81 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (18 lines × 2) python/samples/concepts/agents/bedrock_agent/bedrock_agent_with_kernel_function.py:47— python/samples/concepts/agents/bedrock_agent/bedrock_agent_with_kernel_function.py:47-64 | python/samples/concepts/agents/bedrock_agent/bedrock_agent_with_kernel_function_simple.py:38-55 — before extracting anything, compare `python/samples/concepts/agents/bedrock_agent/bedrock_agent_with_kernel_function.py` and `python/samples/concepts/agents/bedrock_agent/bedrock_agent_with_kernel_function_simple.py` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `python/samples/concepts/agents/bedrock_agent/bedrock_agent_with_kernel_function.py:47` 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 (18 lines × 2) python/samples/concepts/audio/01-chat_with_audio_input.py:52— python/samples/concepts/audio/01-chat_with_audio_input.py:52-69 | python/samples/concepts/audio/03-chat_with_audio_input_output.py:60-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) python/samples/concepts/mcp/azure_ai_agent_with_local_server.py:51— python/samples/concepts/mcp/azure_ai_agent_with_local_server.py:51-68 | python/samples/concepts/mcp/local_agent_with_local_server.py:47-64 — 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 `python/samples/concepts/mcp/azure_ai_agent_with_local_server.py:51` 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 before the matched lines, `python/samples/concepts/mcp/azure_ai_agent_with_local_server.py:49` calls `AzureCliCredential`, `create_client` and `python/samples/concepts/mcp/local_agent_with_local_server.py:46` 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.
Unfinished stub — throws NotImplementedException dotnet/samples/Demos/VoiceChat/Pipeline/PipelineEvents.cs:21— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/samples/Demos/VoiceChat/Pipeline/PipelineEvents.cs:26— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/samples/Demos/VoiceChat/Pipeline/PipelineEvents.cs:41— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/InternalUtilities/src/Text/ExceptionJsonConverter.cs:49— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Agents/Abstractions/AggregatorAgent.cs:48— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Agents/Abstractions/AggregatorAgent.cs:59— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Agents/Yaml/AgentMetadataTypeConverter.cs:58— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Agents/Yaml/ModelConfigurationTypeConverter.cs:58— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ExternalMessageBufferActorWrapper.cs:33— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ExternalMessageBufferActorWrapper.cs:40— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Experimental/Process.Runtime.Dapr/DaprKernelProcessContext.cs:83— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Functions/Functions.Yaml/PromptExecutionSettingsTypeConverter.cs:61— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Swallowed exception (empty catch) dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettingsExtensions.cs:240— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettingsExtensions.cs:253— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) dotnet/src/SemanticKernel.Abstractions/Functions/KernelFunction.cs:675— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) dotnet/src/SemanticKernel.Abstractions/Functions/KernelFunctionLogMessages.cs:143— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) dotnet/src/InternalUtilities/src/System/PathUtilities.cs:149— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) dotnet/src/InternalUtilities/src/System/PathUtilities.cs:152— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) dotnet/src/InternalUtilities/azure/workflow/UriExtensions.cs:104— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) dotnet/src/Connectors/Connectors.AzureAIInference/Core/RequestFailedExceptionExtensions.cs:29— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) dotnet/src/InternalUtilities/openai/Extensions/ClientResultExceptionExtensions.cs:30— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) dotnet/src/Experimental/Orchestration.Flow/Model/FlowStep.cs:111— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) dotnet/src/Experimental/Process.Core/WorkflowSerializer.cs:53— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) dotnet/samples/Demos/CopilotAgentPlugins/CopilotAgentPluginsDemoSample/Logging/SemanticKernelLogger.cs:77— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Duplicated block (22 lines × 2) dotnet/src/Experimental/Process.LocalRuntime/LocalProxy.cs:35— dotnet/src/Experimental/Process.LocalRuntime/LocalProxy.cs:35-56 | dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProxyActor.cs:34-55 — 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 (22 lines × 2) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromPrompt.cs:63— dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromPrompt.cs:63-84 | dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromPrompt.cs:123-144 — 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 `dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromPrompt.cs:63` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 2) dotnet/src/SemanticKernel.Abstractions/Contents/ActionContent.cs:21— dotnet/src/SemanticKernel.Abstractions/Contents/ActionContent.cs:21-42 | dotnet/src/SemanticKernel.Abstractions/Contents/StreamingActionContent.cs:22-49 — before extracting anything, compare `dotnet/src/SemanticKernel.Abstractions/Contents/ActionContent.cs` and `dotnet/src/SemanticKernel.Abstractions/Contents/StreamingActionContent.cs` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `dotnet/src/SemanticKernel.Abstractions/Contents/ActionContent.cs:21` 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.
Duplicated block (22 lines × 2) python/semantic_kernel/agents/group_chat/agent_group_chat.py:133— python/semantic_kernel/agents/group_chat/agent_group_chat.py:133-154 | python/semantic_kernel/agents/group_chat/agent_group_chat.py:184-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 2) python/semantic_kernel/agents/orchestration/magentic.py:295— python/semantic_kernel/agents/orchestration/magentic.py:295-316 | python/semantic_kernel/agents/orchestration/magentic.py:357-378 — 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 `python/semantic_kernel/agents/orchestration/magentic.py: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 (22 lines × 2) REDACTED:29— REDACTED:29-50 | REDACTED:32-53 — 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 (22 lines × 2) python/semantic_kernel/connectors/ai/nvidia/services/nvidia_handler.py:102— python/semantic_kernel/connectors/ai/nvidia/services/nvidia_handler.py:102-123 | python/semantic_kernel/connectors/ai/open_ai/services/open_ai_config_base.py:85-106 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (22 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureOpenAI/Step01_Basics/Program.cs:27— dotnet/samples/AgentFrameworkMigration/AzureOpenAI/Step01_Basics/Program.cs:27-48 | dotnet/samples/AgentFrameworkMigration/OpenAI/Step01_Basics/Program.cs:27-48 — before extracting anything, compare `dotnet/samples/AgentFrameworkMigration/AzureOpenAI/Step01_Basics/Program.cs` and `dotnet/samples/AgentFrameworkMigration/OpenAI/Step01_Basics/Program.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 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 `dotnet/samples/AgentFrameworkMigration/AzureOpenAI/Step01_Basics/Program.cs:27` 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 (22 lines × 2) python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter.py:102— python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter.py:102-123 | python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter_streaming.py:102-123 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter_streaming.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 99 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 (22 lines × 2) python/samples/concepts/mcp/agent_with_http_mcp_plugin.py:35— python/samples/concepts/mcp/agent_with_http_mcp_plugin.py:35-56 | python/samples/concepts/mcp/agent_with_mcp_plugin.py:41-62 — 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 `python/samples/concepts/mcp/agent_with_http_mcp_plugin.py:35` 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 before the matched lines, `python/samples/concepts/mcp/agent_with_mcp_plugin.py:40` calls `getenv` and `python/samples/concepts/mcp/agent_with_http_mcp_plugin.py:34` 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 (22 lines × 2) python/samples/concepts/structured_outputs/json_structured_outputs.py:113— python/samples/concepts/structured_outputs/json_structured_outputs.py:113-134 | python/samples/concepts/structured_outputs/json_structured_outputs_function_calling.py:140-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 `python/samples/concepts/structured_outputs/json_structured_outputs.py:113` 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) dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:153— dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:153-158 | dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:147-152 — 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. 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 (6 lines × 2) dotnet/src/SemanticKernel.Abstractions/Functions/KernelParameterMetadata.cs:134— dotnet/src/SemanticKernel.Abstractions/Functions/KernelParameterMetadata.cs:134-139 | dotnet/src/SemanticKernel.Abstractions/Functions/KernelReturnParameterMetadata.cs:92-97 — 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 (6 lines × 2) dotnet/src/Connectors/Connectors.Google/Models/Gemini/GeminiFunction.cs:26— dotnet/src/Connectors/Connectors.Google/Models/Gemini/GeminiFunction.cs:26-31 | dotnet/src/Connectors/Connectors.OpenAI/Core/OpenAIFunction.cs:20-25 — 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. 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 (6 lines × 2) dotnet/src/Plugins/Plugins.Core/HttpPlugin.cs:148— dotnet/src/Plugins/Plugins.Core/HttpPlugin.cs:148-153 | dotnet/src/Plugins/Plugins.Web/WebFileDownloadPlugin.cs:202-207 — 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. 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 (6 lines × 2) python/semantic_kernel/agents/orchestration/concurrent.py:85— python/semantic_kernel/agents/orchestration/concurrent.py:85-90 | python/semantic_kernel/agents/orchestration/sequential.py:68-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `message` to `ConcurrentRequestMessage` in one and `SequentialRequestMessage` 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 (6 lines × 2) python/semantic_kernel/agents/runtime/core/logging.py:43— python/semantic_kernel/agents/runtime/core/logging.py:43-48 | python/semantic_kernel/agents/runtime/core/logging.py:71-76 — 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 after the matched lines, `python/semantic_kernel/agents/runtime/core/logging.py:49` calls `str` and `python/semantic_kernel/agents/runtime/core/logging.py:77` 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.
Duplicated block (6 lines × 2) python/semantic_kernel/connectors/sql_server.py:1067— python/semantic_kernel/connectors/sql_server.py:1067-1072 | python/semantic_kernel/connectors/sql_server.py:1087-1092 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) REDACTED:76— REDACTED:76-81 | REDACTED:67-72 — 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:76` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) python/semantic_kernel/processes/dapr_runtime/actors/process_actor.py:73— python/semantic_kernel/processes/dapr_runtime/actors/process_actor.py:73-78 | python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:96-101 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) python/samples/concepts/memory/azure_ai_search_hotel_samples/1_interact_with_the_collection.py:48— python/samples/concepts/memory/azure_ai_search_hotel_samples/1_interact_with_the_collection.py:48-53 | python/samples/concepts/memory/azure_ai_search_hotel_samples/1_interact_with_the_collection.py:61-66 — 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 `python/samples/concepts/memory/azure_ai_search_hotel_samples/1_interact_with_the_collection.py:48` 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) python/samples/getting_started_with_processes/step03/step03a_food_preparation.py:168— python/samples/getting_started_with_processes/step03/step03a_food_preparation.py:168-173 | python/samples/getting_started_with_processes/step03/step03a_food_preparation.py:181-186 — 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.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×10
Members sharing a duplicated core (6 members, 50+ identical tokens) dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:157— dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:157-177 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:195-215 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:235-254 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:272-291 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:311-330 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:348-367 — 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.
Members sharing a duplicated core (6 members, 50+ identical tokens) dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:174— dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:174-193 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:216-235 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:739-759 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs:52-72 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs:95-115 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs:438-457 — 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.
Members sharing a duplicated core (6 members, 50+ identical tokens) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:663— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:663-743 | python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:772-852 | python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:880-968 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:765-847 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:877-959 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:988-1078 — 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.
Members sharing a duplicated core (6 members, 50+ identical tokens) python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py:40— python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py:40-95 | python/semantic_kernel/connectors/ai/open_ai/services/azure_chat_completion.py:61-119 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_completion.py:52-105 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_embedding.py:42-95 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_to_audio.py:40-95 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_to_image.py:40-95 — 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.
Members sharing a duplicated core (6 members, 50+ identical tokens) python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py:99— python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py:99-117 | python/semantic_kernel/connectors/ai/open_ai/services/azure_chat_completion.py:123-141 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_completion.py:109-127 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_embedding.py:99-117 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_to_audio.py:99-117 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_to_image.py:99-117 — 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.
Members sharing a duplicated core (6 members, 50+ identical tokens) python/semantic_kernel/connectors/chroma.py:367— python/semantic_kernel/connectors/chroma.py:367-433 | python/semantic_kernel/connectors/mongodb.py:447-511 | python/semantic_kernel/connectors/pinecone.py:498-577 | python/semantic_kernel/connectors/qdrant.py:371-438 | python/semantic_kernel/connectors/redis.py:367-486 | python/semantic_kernel/connectors/weaviate.py:411-480 — 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.
Members sharing a duplicated core (6 members, 50+ identical tokens) python/semantic_kernel/connectors/chroma.py:367— python/semantic_kernel/connectors/chroma.py:367-433 | python/semantic_kernel/connectors/mongodb.py:447-511 | python/semantic_kernel/connectors/oracle.py:1015-1186 | python/semantic_kernel/connectors/pinecone.py:498-577 | python/semantic_kernel/connectors/qdrant.py:371-438 | python/semantic_kernel/connectors/sql_server.py:586-675 — 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.
Members sharing a duplicated core (6 members, 50+ identical tokens) python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:161— python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:161-198 | python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:250-288 | python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:293-332 | python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:335-355 | python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:358-378 | python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:388-447 — 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.
Members sharing a duplicated core (6 members, 50+ identical tokens) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_with_existing_agent_id.py:23— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_with_existing_agent_id.py:23-65 | python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:39-95 | python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_with_existing_agent_id.py:23-62 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_file_search.py:38-90 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_with_existing_agent_id.py:21-61 | python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_file_search.py:36-91 — 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.
Members sharing a duplicated core (6 members, 50+ identical tokens) python/samples/concepts/auto_function_calling/chat_completion_with_manual_function_calling.py:89— python/samples/concepts/auto_function_calling/chat_completion_with_manual_function_calling.py:89-109 | python/samples/concepts/auto_function_calling/chat_completion_with_manual_function_calling_streaming.py:78-98 | python/samples/concepts/auto_function_calling/function_calling_with_required_type.py:104-120 | python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py:128-141 | python/samples/concepts/auto_function_calling/functions_defined_in_yaml_prompt.py:125-138 | python/samples/concepts/filtering/auto_function_invoke_filters.py:107-120 — 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.
Duplicated block (23 lines × 2) dotnet/src/Connectors/Connectors.AzureAIInference/Extensions/AzureAIInferenceServiceCollectionExtensions.cs:42— dotnet/src/Connectors/Connectors.AzureAIInference/Extensions/AzureAIInferenceServiceCollectionExtensions.cs:42-64 | dotnet/src/Connectors/Connectors.AzureAIInference/Extensions/AzureAIInferenceServiceCollectionExtensions.cs:88-110 — 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 (23 lines × 2) dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:151— dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:151-173 | dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:382-404 — 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 `dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:151` 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 (23 lines × 2) python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:447— python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:447-469 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:529-551 — before extracting anything, compare `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` and `python/semantic_kernel/agents/open_ai/openai_responses_agent.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 159 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 (23 lines × 2) python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:214— python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:214-236 | python/semantic_kernel/processes/local_runtime/local_step.py:213-235 — before extracting anything, compare `python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py` and `python/semantic_kernel/processes/local_runtime/local_step.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 130 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. Note first that the copies are not typed on the same thing: `KernelException` names `semantic_kernel.exceptions` in one and `semantic_kernel.exceptions.kernel_exceptions` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (23 lines × 2) python/semantic_kernel/connectors/ai/open_ai/settings/azure_open_ai_settings.py:113— python/semantic_kernel/connectors/ai/open_ai/settings/azure_open_ai_settings.py:113-135 | python/semantic_kernel/core_plugins/sessions_python_tool/sessions_python_settings.py:71-93 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (23 lines × 2) python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_streaming_token_usage.py:40— python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_streaming_token_usage.py:40-62 | python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_token_usage.py:40-62 — 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 (23 lines × 2) python/samples/concepts/agents/mixed_chat/mixed_chat_files.py:89— python/samples/concepts/agents/mixed_chat/mixed_chat_files.py:89-111 | python/samples/concepts/agents/mixed_chat/mixed_chat_images.py:89-111 — 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 `python/samples/concepts/agents/mixed_chat/mixed_chat_files.py:89` 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 (23 lines × 2) python/samples/concepts/auto_function_calling/azure_python_code_interpreter_function_calling.py:46— python/samples/concepts/auto_function_calling/azure_python_code_interpreter_function_calling.py:46-68 | python/samples/concepts/on_your_data/azure_chat_gpt_with_data_api_function_calling.py:88-110 — 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 before the matched lines, `python/samples/concepts/auto_function_calling/azure_python_code_interpreter_function_calling.py:42` calls `ChatHistory` and `python/samples/concepts/on_your_data/azure_chat_gpt_with_data_api_function_calling.py:84` 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 (23 lines × 2) python/samples/concepts/functions/agent_framework_tools.py:32— python/samples/concepts/functions/agent_framework_tools.py:32-54 | python/samples/concepts/prompt_templates/template_language.py:12-34 — 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 (23 lines × 2) python/samples/demos/mcp_server/mcp_server_with_prompts.py:57— python/samples/demos/mcp_server/mcp_server_with_prompts.py:57-79 | python/samples/demos/mcp_server/mcp_server_with_sampling.py:90-112 — before extracting anything, compare `python/samples/demos/mcp_server/mcp_server_with_prompts.py` and `python/samples/demos/mcp_server/mcp_server_with_sampling.py` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `python/samples/demos/mcp_server/mcp_server_with_sampling.py:89` calls `add_function` and `python/samples/demos/mcp_server/mcp_server_with_prompts.py:56` 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 (20 lines × 2) dotnet/src/Agents/OpenAI/Internal/ResponseThreadActions.cs:95— dotnet/src/Agents/OpenAI/Internal/ResponseThreadActions.cs:95-114 | dotnet/src/Agents/OpenAI/Internal/ResponseThreadActions.cs:269-288 — 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 `dotnet/src/Agents/OpenAI/Internal/ResponseThreadActions.cs:95` 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) dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:235— dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:235-254 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:272-291 — 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 (20 lines × 2) dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:311— dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:311-330 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:348-367 — 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 (20 lines × 2) python/semantic_kernel/kernel.py:146— python/semantic_kernel/kernel.py:146-165 | python/semantic_kernel/kernel.py:305-324 — 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 (20 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step03_DependencyInjection/Program.cs:28— dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step03_DependencyInjection/Program.cs:28-47 | dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step03_DependencyInjection/Program.cs:70-89 — 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 (20 lines × 2) dotnet/samples/Demos/AotCompatibility/OnnxChatCompletionSamples.cs:20— dotnet/samples/Demos/AotCompatibility/OnnxChatCompletionSamples.cs:20-39 | dotnet/samples/Demos/AotCompatibility/OnnxChatCompletionSamples.cs:53-72 — 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 (20 lines × 2) python/samples/concepts/agents/bedrock_agent/bedrock_agent_with_code_interpreter.py:51— python/samples/concepts/agents/bedrock_agent/bedrock_agent_with_code_interpreter.py:51-70 | python/samples/concepts/agents/bedrock_agent/bedrock_agent_with_code_interpreter_streaming.py:53-72 — before extracting anything, compare `python/samples/concepts/agents/bedrock_agent/bedrock_agent_with_code_interpreter.py` and `python/samples/concepts/agents/bedrock_agent/bedrock_agent_with_code_interpreter_streaming.py` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `python/samples/concepts/agents/bedrock_agent/bedrock_agent_with_code_interpreter.py:51` 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) python/samples/concepts/agents/bedrock_agent/bedrock_mixed_chat_agents.py:68— python/samples/concepts/agents/bedrock_agent/bedrock_mixed_chat_agents.py:68-87 | python/samples/concepts/agents/bedrock_agent/bedrock_mixed_chat_agents_streaming.py:68-87 — before extracting anything, compare `python/samples/concepts/agents/bedrock_agent/bedrock_mixed_chat_agents.py` and `python/samples/concepts/agents/bedrock_agent/bedrock_mixed_chat_agents_streaming.py` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (20 lines × 2) python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_templating.py:51— python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_templating.py:51-70 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_templating.py:47-66 — 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 `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_templating.py:51` 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) python/samples/getting_started_with_agents/openai_assistant/step5_assistant_tool_file_search.py:46— python/samples/getting_started_with_agents/openai_assistant/step5_assistant_tool_file_search.py:46-65 | python/samples/learn_resources/agent_docs/assistant_search.py:57-81 — 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 `python/samples/learn_resources/agent_docs/assistant_search.py:57` 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.
MethodTooLong: FlowExecutor.ExecuteFlowAsync dotnet/src/Experimental/Orchestration.Flow/Execution/FlowExecutor.cs:165— MethodTooLong — ExecuteFlowAsync runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× 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: PromptExecutionSettingsExtensions.ToChatOptions dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettingsExtensions.cs:18— MethodTooLong — ToChatOptions runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× 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: CodeTokenizer.Tokenize dotnet/src/SemanticKernel.Core/TemplateEngine/CodeTokenizer.cs:53— MethodTooLong — Tokenize runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× 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: ResponseThreadActions.InvokeStreamingAsync dotnet/src/Agents/OpenAI/Internal/ResponseThreadActions.cs:120— MethodTooLong — InvokeStreamingAsync 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: CopilotAgentPluginKernelExtensions.CreatePluginFromCopilotAgentPluginAsync dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs:57— MethodTooLong — CreatePluginFromCopilotAgentPluginAsync runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× 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: AssistantThreadActions.InvokeAsync dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:114— MethodTooLong — InvokeAsync runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× 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: AgentThreadActions.InvokeAsync dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:136— MethodTooLong — InvokeAsync runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× 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: ClientCore.GetStreamingChatMessageContentsAsync dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:227— MethodTooLong — GetStreamingChatMessageContentsAsync runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× 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: MistralClient.GetStreamingChatMessageContentsAsync dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:267— MethodTooLong — GetStreamingChatMessageContentsAsync runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× 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.
Stateful singleton: MyLightPlugin dotnet/samples/Demos/HomeAutomation/Plugins/MyLightPlugin.cs:11— `MyLightPlugin` is a singleton (one shared instance) but mutates instance state outside any lock (_turnedOn; e.g. `_turnedOn` at line 20).
Stateful singleton: AudioPlaybackService dotnet/samples/Demos/VoiceChat/Services/AudioPlaybackService.cs:6— `AudioPlaybackService` is a singleton (one shared instance) but mutates instance state outside any lock (_waveOut, _isPlaying; e.g. `_waveOut` at line 31).
Stateful singleton: VadService dotnet/samples/Demos/VoiceChat/Services/VadService.cs:5— `VadService` is a singleton (one shared instance) but mutates instance state outside any lock (_preroll, _inSpeech, _speech, _silenceFrames; e.g. `_preroll` at line 74).
Stateful singleton: ResourceTemplateDefinition dotnet/samples/Demos/ModelContextProtocolClientServer/MCPServer/Resources/ResourceTemplateDefinition.cs:13— `ResourceTemplateDefinition` is a singleton (one shared instance) but mutates instance state outside any lock (_kernelFunction, Kernel, _regex; e.g. `_kernelFunction` at line 58).
Stateful singleton: ResourceDefinition dotnet/samples/Demos/ModelContextProtocolClientServer/MCPServer/Resources/ResourceDefinition.cs:12— `ResourceDefinition` is a singleton (one shared instance) but mutates instance state outside any lock (_kernelFunction, Kernel; e.g. `_kernelFunction` at line 79).
Stateful singleton: CopilotStudioTokenHandler dotnet/src/Agents/Copilot/CopilotStudioTokenHandler.cs:24— `CopilotStudioTokenHandler` is a singleton (one shared instance) but mutates instance state outside any lock (_clientApplication; e.g. `_clientApplication` at line 71).
Stateful singleton: LocalEventProxyChannel dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/LocalEventProxyChannel.cs:8— `LocalEventProxyChannel` is a singleton (one shared instance) but mutates instance state outside any lock (_hubConnection; e.g. `_hubConnection` at line 24).
Stateful singleton: DocumentGenerationGrpcClient dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Grpc/Clients/DocumentGenerationGrpcClient.cs:15— `DocumentGenerationGrpcClient` is a singleton (one shared instance) but mutates instance state outside any lock (_grpcChannel, _grpcClient; e.g. `_grpcChannel` at line 23).
Duplicated block (14 lines × 2) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:72— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:72-85 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:191-204 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs` and `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 109 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) dotnet/src/Agents/Core/ChatCompletionAgent.cs:285— dotnet/src/Agents/Core/ChatCompletionAgent.cs:285-298 | dotnet/src/SemanticKernel.Abstractions/Services/AIServiceExtensions.cs:100-113 — 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 `dotnet/src/Agents/Core/ChatCompletionAgent.cs:285` 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 (14 lines × 2) dotnet/src/Connectors/Connectors.OpenAI/Services/OpenAIFileService.cs:209— dotnet/src/Connectors/Connectors.OpenAI/Services/OpenAIFileService.cs:209-222 | dotnet/src/Connectors/Connectors.OpenAI/Services/OpenAIFileService.cs:247-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 `dotnet/src/Connectors/Connectors.OpenAI/Services/OpenAIFileService.cs:209` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) dotnet/src/SemanticKernel.Abstractions/Functions/FunctionResult.cs:161— dotnet/src/SemanticKernel.Abstractions/Functions/FunctionResult.cs:161-174 | dotnet/src/SemanticKernel.Abstractions/Functions/FunctionResult.cs:186-201 — 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 `dotnet/src/SemanticKernel.Abstractions/Functions/FunctionResult.cs:161` 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.
Duplicated block (14 lines × 2) dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs:96— dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs:96-109 | dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionStreamResponse.cs:90-103 — before extracting anything, compare `dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs` and `dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionStreamResponse.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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 `dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs:96` 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 × 2) dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:214— dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:214-227 | dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:445-458 — 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 `dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:214` 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 × 2) python/semantic_kernel/connectors/ai/ollama/services/ollama_chat_completion.py:284— python/semantic_kernel/connectors/ai/ollama/services/ollama_chat_completion.py:284-297 | python/semantic_kernel/connectors/ai/ollama/services/ollama_chat_completion.py:318-331 — 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 `python/semantic_kernel/connectors/ai/ollama/services/ollama_chat_completion.py:284` 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 × 2) python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py:166— python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py:166-179 | python/samples/concepts/auto_function_calling/functions_defined_in_yaml_prompt.py:163-176 — before extracting anything, compare `python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py` and `python/samples/concepts/auto_function_calling/functions_defined_in_yaml_prompt.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 79 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.
Unfinished stub — throws NotImplementedException dotnet/src/Agents/Abstractions/AggregatorAgent.cs:48— `InvokeAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Agents/Abstractions/AggregatorAgent.cs:59— `InvokeStreamingAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Agents/Yaml/AgentMetadataTypeConverter.cs:58— `WriteYaml` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Agents/Yaml/ModelConfigurationTypeConverter.cs:58— `WriteYaml` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ExternalMessageBufferActorWrapper.cs:33— `Initialize` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ExternalMessageBufferActorWrapper.cs:40— `Uninitialize` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Experimental/Process.Runtime.Dapr/DaprKernelProcessContext.cs:83— `GetExternalMessageChannelAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException dotnet/src/Functions/Functions.Yaml/PromptExecutionSettingsTypeConverter.cs:61— `WriteYaml` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Deprecated: xunit REDACTED:162— xunit 2.9.3 — Legacy — the publisher's replacement is `xunit.v3`; that is the next major line under a new package id, so the move is a breaking rename rather than a version bump — budget for API changes in the code that uses it, not only the reference swap.
Deprecated: Microsoft.Plugins.Manifest REDACTED:179— Microsoft.Plugins.Manifest 1.0.0-rc3 — Legacy — the publisher's replacement is `Microsoft.DeclarativeAgents.Manifest` >= 1.0.0; migrate the reference to it.
Deprecated: Microsoft.Graph.Core REDACTED:175— Microsoft.Graph.Core 3.2.6 — Other
ShadowedAnalyzerSeverity .editorconfig:127— CA1508 severity is set to warning here and to none at line 164 of the same [*.cs] section — EditorConfig takes the last assignment, so this line has no effect. — the configuration and the build disagree here, and the build is right. A reader auditing this file sees the severity on THIS line and concludes the rule is configured that way; nothing on the line says it was overridden further down, so the elevation reads as policy while the override is what ships. Decide which was meant: if this severity is the real decision, move it below the later entry or delete that one, so the file says what the build does; if the later entry is the real decision, delete this line — it is not a weaker version of the policy, it is no policy at all.
ShadowedAnalyzerSeverity .editorconfig:134— IDE0001 severity is set to warning here and to none at line 222 of the same [*.cs] section — EditorConfig takes the last assignment, so this line has no effect. — the configuration and the build disagree here, and the build is right. A reader auditing this file sees the severity on THIS line and concludes the rule is configured that way; nothing on the line says it was overridden further down, so the elevation reads as policy while the override is what ships. Decide which was meant: if this severity is the real decision, move it below the later entry or delete that one, so the file says what the build does; if the later entry is the real decision, delete this line — it is not a weaker version of the policy, it is no policy at all.
ShadowedAnalyzerSeverity .editorconfig:140— IDE0032 severity is set to warning here and to none at line 242 of the same [*.cs] section — EditorConfig takes the last assignment, so this line has no effect. — the configuration and the build disagree here, and the build is right. A reader auditing this file sees the severity on THIS line and concludes the rule is configured that way; nothing on the line says it was overridden further down, so the elevation reads as policy while the override is what ships. Decide which was meant: if this severity is the real decision, move it below the later entry or delete that one, so the file says what the build does; if the later entry is the real decision, delete this line — it is not a weaker version of the policy, it is no policy at all.
ShadowedAnalyzerSeverity .editorconfig:142— IDE0035 severity is set to warning here and to none at line 229 of the same [*.cs] section — EditorConfig takes the last assignment, so this line has no effect. — the configuration and the build disagree here, and the build is right. A reader auditing this file sees the severity on THIS line and concludes the rule is configured that way; nothing on the line says it was overridden further down, so the elevation reads as policy while the override is what ships. Decide which was meant: if this severity is the real decision, move it below the later entry or delete that one, so the file says what the build does; if the later entry is the real decision, delete this line — it is not a weaker version of the policy, it is no policy at all.
ShadowedAnalyzerSeverity .editorconfig:146— IDE0051 severity is set to warning here and to none at line 230 of the same [*.cs] section — EditorConfig takes the last assignment, so this line has no effect. — the configuration and the build disagree here, and the build is right. A reader auditing this file sees the severity on THIS line and concludes the rule is configured that way; nothing on the line says it was overridden further down, so the elevation reads as policy while the override is what ships. Decide which was meant: if this severity is the real decision, move it below the later entry or delete that one, so the file says what the build does; if the later entry is the real decision, delete this line — it is not a weaker version of the policy, it is no policy at all.
ShadowedAnalyzerSeverity .editorconfig:148— IDE0060 severity is set to warning here and to none at line 234 of the same [*.cs] section — EditorConfig takes the last assignment, so this line has no effect. — the configuration and the build disagree here, and the build is right. A reader auditing this file sees the severity on THIS line and concludes the rule is configured that way; nothing on the line says it was overridden further down, so the elevation reads as policy while the override is what ships. Decide which was meant: if this severity is the real decision, move it below the later entry or delete that one, so the file says what the build does; if the later entry is the real decision, delete this line — it is not a weaker version of the policy, it is no policy at all.
ClassTooLong: KernelFunctionFromMethod dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs— ClassTooLong — 531 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 131 over it, 1.33× 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.
ClassTooLong: MistralClient dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs— ClassTooLong — 495 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 95 over it, 1.24× 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.
ClassTooLong: GeminiChatCompletionClient dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs— ClassTooLong — 490 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 90 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.
ClassTooLong: KernelFunctionFromPrompt dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromPrompt.cs— ClassTooLong — 467 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 67 over it, 1.17× 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.
ClassTooLong: AgentThreadActions dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs— ClassTooLong — 448 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 48 over it, 1.12× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: AssistantThreadActions dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs— ClassTooLong — 427 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 27 over it, 1.07× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
Duplicated block (33 lines × 2) dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:233— dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:233-265 | dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:467-499 — 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 `dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:233` 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 (33 lines × 2) dotnet/src/Agents/AzureAI/AzureAIAgent.cs:132— dotnet/src/Agents/AzureAI/AzureAIAgent.cs:132-164 | dotnet/src/Agents/AzureAI/AzureAIAgent.cs:235-267 — 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 (33 lines × 2) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:988— python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:988-1020 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:878-910 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py` and `python/semantic_kernel/agents/open_ai/assistant_thread_actions.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 204 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (33 lines × 2) python/semantic_kernel/agents/bedrock/bedrock_agent.py:295— python/semantic_kernel/agents/bedrock/bedrock_agent.py:295-327 | python/semantic_kernel/agents/bedrock/bedrock_agent.py:397-429 — 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 `python/semantic_kernel/agents/bedrock/bedrock_agent.py: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 (33 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs:62— dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs:62-94 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs:60-92 — before extracting anything, compare `dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs` and `dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 98 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 (33 lines × 2) python/samples/concepts/prompt_templates/azure_chat_gpt_api_handlebars.py:57— python/samples/concepts/prompt_templates/azure_chat_gpt_api_handlebars.py:57-89 | python/samples/concepts/prompt_templates/azure_chat_gpt_api_jinja2.py:56-88 — before extracting anything, compare `python/samples/concepts/prompt_templates/azure_chat_gpt_api_handlebars.py` and `python/samples/concepts/prompt_templates/azure_chat_gpt_api_jinja2.py` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (24 lines × 2) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:197— dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:197-220 | dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:180-203 — before extracting anything, compare `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs` and `dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 239 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 `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:197` 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 (24 lines × 2) dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearchOptions.cs:15— dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearchOptions.cs:15-38 | dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearchOptions.cs:15-38 — 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 (24 lines × 2) dotnet/src/SemanticKernel.Abstractions/Contents/AnnotationContent.cs:46— dotnet/src/SemanticKernel.Abstractions/Contents/AnnotationContent.cs:46-69 | dotnet/src/SemanticKernel.Abstractions/Contents/StreamingAnnotationContent.cs:48-75 — 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 (24 lines × 2) python/semantic_kernel/agents/bedrock/bedrock_agent_base.py:187— python/semantic_kernel/agents/bedrock/bedrock_agent_base.py:187-210 | python/semantic_kernel/agents/bedrock/bedrock_agent_base.py:213-236 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (24 lines × 2) python/semantic_kernel/utils/telemetry/model_diagnostics/decorators.py:176— python/semantic_kernel/utils/telemetry/model_diagnostics/decorators.py:176-199 | python/semantic_kernel/utils/telemetry/model_diagnostics/decorators.py:290-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 `python/semantic_kernel/utils/telemetry/model_diagnostics/decorators.py: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.
Duplicated block (24 lines × 2) python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_templating.py:50— python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_templating.py:50-73 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_templating.py:46-69 — 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 `python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_templating.py:50` 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 (26 lines × 2) dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:132— dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:132-157 | dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs:115-140 — before extracting anything, compare `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs` and `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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 `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:132` 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 (26 lines × 2) dotnet/src/Plugins/Plugins.Document/DocumentPlugin.cs:145— dotnet/src/Plugins/Plugins.Document/DocumentPlugin.cs:145-175 | dotnet/src/Plugins/Plugins.Web/WebFileDownloadPlugin.cs:210-235 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26 lines × 2) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:1268— python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:1268-1293 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:586-611 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py` and `python/semantic_kernel/agents/open_ai/assistant_thread_actions.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 204 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_bing_grounding.py:53— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_bing_grounding.py:53-78 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_openapi.py:167-192 — 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 `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_bing_grounding.py:53` 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 (26 lines × 2) python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_summary_history_reducer_agent_chat.py:54— python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_summary_history_reducer_agent_chat.py:54-79 | python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_truncate_history_reducer_agent_chat.py:55-80 — 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 `python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_summary_history_reducer_agent_chat.py: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 (26 lines × 2) python/samples/learn_resources/agent_docs/assistant_code.py:83— python/samples/learn_resources/agent_docs/assistant_code.py:83-108 | python/samples/learn_resources/agent_docs/assistant_search.py:57-82 — 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 `python/samples/learn_resources/agent_docs/assistant_code.py:83` 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 (21 lines × 2) dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:141— dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:141-161 | dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs:138-158 — before extracting anything, compare `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs` and `dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 137 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 (21 lines × 2) dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:157— dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:157-177 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:195-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 (21 lines × 2) dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:125— dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:125-145 | dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProcessActor.cs:116-136 — 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. 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 (21 lines × 2) REDACTED:177— REDACTED:177-197 | REDACTED:145-165 — 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:177` 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 (21 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs:95— dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs:95-115 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs:94-114 — before extracting anything, compare `dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs` and `dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 98 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 `dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs:95` 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 (21 lines × 2) python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_message_callback.py:60— python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_message_callback.py:60-80 | python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_message_callback_streaming.py:57-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. Note first that the copies are not typed on the same thing: `AzureChatCompletion` names `semantic_kernel.connectors.ai.open_ai` in one and `semantic_kernel.connectors.ai.open_ai.services.azure_chat_completion` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (29 lines × 2) dotnet/src/Agents/Core/ChatCompletionAgent.cs:68— dotnet/src/Agents/Core/ChatCompletionAgent.cs:68-96 | dotnet/src/Agents/Core/ChatCompletionAgent.cs:171-199 — 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 (29 lines × 2) dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs:140— dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs:140-168 | dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs:223-251 — before extracting anything, compare `dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs` and `dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 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 (29 lines × 2) python/semantic_kernel/agents/orchestration/group_chat.py:381— python/semantic_kernel/agents/orchestration/group_chat.py:381-410 | python/semantic_kernel/agents/orchestration/magentic.py:779-807 — 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 (29 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py:97— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py:97-125 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter_streaming.py:97-125 — before extracting anything, compare `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py` and `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter_streaming.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 92 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 (29 lines × 2) python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback.py:63— python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback.py:63-91 | python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py:63-91 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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 (28 lines × 2) dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:172— dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:172-199 | dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs:169-196 — before extracting anything, compare `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs` and `dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 137 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 `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:172` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (28 lines × 2) dotnet/src/InternalUtilities/src/Diagnostics/ModelDiagnostics.cs:51— dotnet/src/InternalUtilities/src/Diagnostics/ModelDiagnostics.cs:51-78 | dotnet/src/InternalUtilities/src/Diagnostics/ModelDiagnostics.cs:103-130 — 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 `dotnet/src/InternalUtilities/src/Diagnostics/ModelDiagnostics.cs:51` 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 (28 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_deep_research_streaming.py:48— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_deep_research_streaming.py:48-75 | python/samples/getting_started_with_agents/azure_ai_agent/step10_azure_ai_agent_deep_research.py:42-69 — 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 (28 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_prompt_templating.py:80— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_prompt_templating.py:80-107 | python/samples/concepts/agents/chat_completion_agent/chat_completion_agent_prompt_templating.py:68-95 — 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 (28 lines × 2) python/samples/demos/mcp_server/agent_as_server.py:66— python/samples/demos/mcp_server/agent_as_server.py:66-93 | python/samples/demos/mcp_server/sk_mcp_server.py:69-96 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (25 lines × 2) dotnet/src/Extensions/PromptTemplates.Handlebars/HandlebarsPromptTemplate.cs:137— dotnet/src/Extensions/PromptTemplates.Handlebars/HandlebarsPromptTemplate.cs:137-161 | dotnet/src/Extensions/PromptTemplates.Liquid/LiquidPromptTemplate.cs:200-224 — 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 `dotnet/src/Extensions/PromptTemplates.Handlebars/HandlebarsPromptTemplate.cs:137` 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 (25 lines × 2) dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.Configuration/AzureOpenAIChatConfig.cs:17— dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.Configuration/AzureOpenAIChatConfig.cs:17-41 | dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.Configuration/AzureOpenAIEmbeddingsConfig.cs:17-41 — 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 (25 lines × 2) python/samples/concepts/agents/openai_responses/responses_agent_reasoning.py:63— python/samples/concepts/agents/openai_responses/responses_agent_reasoning.py:63-87 | python/samples/concepts/agents/openai_responses/responses_agent_reasoning_streaming.py:64-88 — before extracting anything, compare `python/samples/concepts/agents/openai_responses/responses_agent_reasoning.py` and `python/samples/concepts/agents/openai_responses/responses_agent_reasoning_streaming.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 64 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (25 lines × 2) python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py:183— python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py:183-207 | python/samples/concepts/auto_function_calling/functions_defined_in_yaml_prompt.py:180-204 — before extracting anything, compare `python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py` and `python/samples/concepts/auto_function_calling/functions_defined_in_yaml_prompt.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 79 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (25 lines × 2) python/samples/getting_started_with_agents/multi_agent_orchestration/step3_group_chat.py:31— python/samples/getting_started_with_agents/multi_agent_orchestration/step3_group_chat.py:31-55 | python/samples/getting_started_with_agents/multi_agent_orchestration/step3a_group_chat_human_in_the_loop.py:39-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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13–14 lines × 2) dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:144— dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:144-157 | dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:233-245 — 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 `dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:144` 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 (13–14 lines × 2) dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:214— dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:214-227 | dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs:212-224 — before extracting anything, compare `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs` and `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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 `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:214` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. 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, `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs:212` calls `TrimOperationDescriptions` and `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:214` does not — after which the two agree again for 5 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 (13–14 lines × 2) python/semantic_kernel/agents/agent.py:756— python/semantic_kernel/agents/agent.py:756-768 | python/semantic_kernel/agents/agent.py:812-825 — 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 after the matched lines, `python/semantic_kernel/agents/agent.py:770` calls `resolve_placeholders`, `safe_load` and `python/semantic_kernel/agents/agent.py:827` 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 (13–14 lines × 2) python/semantic_kernel/processes/dapr_runtime/actors/event_buffer_actor.py:80— python/semantic_kernel/processes/dapr_runtime/actors/event_buffer_actor.py:80-92 | python/semantic_kernel/processes/dapr_runtime/actors/external_event_buffer_actor.py:93-106 — 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 `python/semantic_kernel/processes/dapr_runtime/actors/external_event_buffer_actor.py:93` 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–14 lines × 2) python/samples/demos/mcp_with_oauth/server/mcp_simple_auth/auth_server.py:60— python/samples/demos/mcp_with_oauth/server/mcp_simple_auth/auth_server.py:60-72 | python/samples/demos/mcp_with_oauth/server/mcp_simple_auth/legacy_as_server.py:51-64 — 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 `python/samples/demos/mcp_with_oauth/server/mcp_simple_auth/auth_server.py:60` 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 first that the copies are not typed on the same thing: the declarations holding them bind `server_settings` to `AuthServerSettings` in one and `ServerSettings` 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 (10 lines × 3) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.cs:45— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.cs:45-54 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.cs:87-96 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.cs:130-139 — 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 `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.cs:45` 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 × 3) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:227— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:227-236 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:120-129 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:125-134 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py` and `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 235 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:222` calls `get` and `python/semantic_kernel/agents/open_ai/openai_responses_agent.py:120` 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 (10 lines × 3) python/samples/concepts/auto_function_calling/function_calling_with_required_type.py:143— python/samples/concepts/auto_function_calling/function_calling_with_required_type.py:143-152 | python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py:161-170 | python/samples/concepts/auto_function_calling/functions_defined_in_yaml_prompt.py:158-167 — before extracting anything, compare `python/samples/concepts/auto_function_calling/function_calling_with_required_type.py` and `python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 `python/samples/concepts/auto_function_calling/function_calling_with_required_type.py: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.
Duplicated block (10 lines × 3) python/samples/concepts/mcp/servers/menu_agent_server.py:146— python/samples/concepts/mcp/servers/menu_agent_server.py:146-155 | python/samples/concepts/mcp/servers/restaurant_booking_agent_server.py:120-129 | python/samples/demos/mcp_server/agent_as_server.py:185-194 — before extracting anything, compare `python/samples/concepts/mcp/servers/menu_agent_server.py` and `python/samples/concepts/mcp/servers/restaurant_booking_agent_server.py` as WHOLE FILES: this scan already matched 4 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. 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 `python/samples/concepts/mcp/servers/menu_agent_server.py:146` 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 × 3) python/samples/demos/document_generator/agents/code_validation_agent.py:58— python/samples/demos/document_generator/agents/code_validation_agent.py:58-67 | python/samples/demos/document_generator/agents/content_creation_agent.py:55-64 | python/samples/demos/document_generator/agents/user_agent.py:56-65 — 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.
Duplicated block (7 lines × 3) dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:94— dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:94-100 | dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:105-111 | dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:116-122 — 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 `dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on 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.
Duplicated block (7 lines × 3) dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:99— dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:99-105 | dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:110-116 | dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:121-127 — 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 `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:99` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:110— dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:110-116 | dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:121-127 | dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:132-138 — 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 `dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step01_Concurrent/Program.cs:83— dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step01_Concurrent/Program.cs:83-89 | dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step02_Sequential/Program.cs:86-92 | dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step03_Handoff/Program.cs:213-219 — `dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step01_Concurrent/Program.cs` and `dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step02_Sequential/Program.cs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 43 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step01_Concurrent/Program.cs:83` 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 (7 lines × 3) python/samples/demos/document_generator/agents/code_validation_agent.py:39— python/samples/demos/document_generator/agents/code_validation_agent.py:39-45 | python/samples/demos/document_generator/agents/content_creation_agent.py:36-42 | python/samples/demos/document_generator/agents/user_agent.py:37-43 — 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.
Sync-over-async blocking — 4 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking dotnet/src/Agents/Runtime/Abstractions/AgentProxy.cs:82— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking dotnet/src/Connectors/Connectors.Onnx/BertOnnxTextEmbeddingGenerationService.cs:80— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking dotnet/src/Connectors/Connectors.Onnx/BertOnnxTextEmbeddingGenerationService.cs:94— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking dotnet/src/Extensions/PromptTemplates.Handlebars/Helpers/KernelHelpers/KernelFunctionHelpers.cs:208— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
TooManyMethods: ClientCore dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs— TooManyMethods — 885 significant lines (blank, comment-only and punctuation-only lines excluded), 59 methods, declared across 6 files: Core/ClientCore.ChatCompletion.cs (35), Core/ClientCore.cs (9), Core/ClientCore.TextToImage.cs (6), Core/ClientCore.AudioToText.cs (5), +2 more file(s). The bar is 30 methods; this is 29 over it, 1.97× 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: Throw dotnet/src/InternalUtilities/src/Diagnostics/Throw.cs— TooManyMethods — 275 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: OracleCollection python/semantic_kernel/connectors/oracle.py:274— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× 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: ProcessBuilder dotnet/src/Experimental/Process.Core/ProcessBuilder.cs— TooManyMethods — 167 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 30 methods; this is 1 over it, 1.03× 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.
Duplicated block (12–14 lines × 2) dotnet/src/Agents/AzureAI/AzureAIAgent.cs:162— dotnet/src/Agents/AzureAI/AzureAIAgent.cs:162-173 | dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs:158-171 — before extracting anything, compare `dotnet/src/Agents/AzureAI/AzureAIAgent.cs` and `dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 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 (12–14 lines × 2) dotnet/src/Agents/Bedrock/BedrockAgent.cs:298— dotnet/src/Agents/Bedrock/BedrockAgent.cs:298-309 | dotnet/src/Agents/Bedrock/BedrockAgent.cs:366-379 — 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 `dotnet/src/Agents/Bedrock/BedrockAgent.cs:298` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. 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–14 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step03_ToolCall/Program.cs:51— dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step03_ToolCall/Program.cs:51-64 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step03_ToolCall/Program.cs:52-63 — 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 `dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step03_ToolCall/Program.cs:52` 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 (12–14 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:30— dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:30-43 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs:29-40 — before extracting anything, compare `dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs` and `dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:30` 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 (15–16 lines × 2) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:407— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:407-421 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:282-297 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py` and `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 235 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 (15–16 lines × 2) python/semantic_kernel/connectors/azure_ai_search.py:388— python/semantic_kernel/connectors/azure_ai_search.py:388-403 | python/semantic_kernel/connectors/azure_ai_search.py:427-441 — 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 `python/semantic_kernel/connectors/azure_ai_search.py:388` 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–16 lines × 2) python/semantic_kernel/connectors/pinecone.py:155— python/semantic_kernel/connectors/pinecone.py:155-170 | python/semantic_kernel/connectors/pinecone.py:643-657 — 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 `python/semantic_kernel/connectors/pinecone.py:155` 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–16 lines × 2) python/samples/concepts/filtering/auto_function_invoke_filters.py:124— python/samples/concepts/filtering/auto_function_invoke_filters.py:124-139 | python/samples/concepts/search/brave_text_search_as_plugin.py:100-114 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 3) python/semantic_kernel/agents/runtime/core/routed_agent.py:151— python/semantic_kernel/agents/runtime/core/routed_agent.py:151-156 | python/semantic_kernel/agents/runtime/core/routed_agent.py:282-287 | python/semantic_kernel/agents/runtime/core/routed_agent.py:411-416 — 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.
Duplicated block (6 lines × 3) python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:283— python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:283-288 | python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:325-330 | python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:436-442 — 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 `python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:283` 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 (6 lines × 3) python/semantic_kernel/agents/autogen/autogen_conversable_agent.py:96— python/semantic_kernel/agents/autogen/autogen_conversable_agent.py:96-101 | python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:108-113 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:244-249 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 3) dotnet/samples/Demos/ContentSafety/Extensions/ConfigurationExtensions.cs:17— dotnet/samples/Demos/ContentSafety/Extensions/ConfigurationExtensions.cs:17-22 | dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Grpc/Extensions/ConfigurationExtension.cs:17-22 | dotnet/samples/Demos/StepwisePlannerMigration/Extensions/ConfigurationExtensions.cs:18-23 — 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. 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.
Fake-async — async method never awaits dotnet/src/Agents/A2A/A2AHostAgent.cs:93— `GetAgentCardAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits dotnet/src/Connectors/Connectors.Onnx/BertOnnxTextEmbeddingGenerationService.cs:188— `GenerateEmbeddingsAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits dotnet/src/Extensions/PromptTemplates.Handlebars/HandlebarsPromptTemplate.cs:43— `RenderAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits dotnet/src/Extensions/PromptTemplates.Liquid/LiquidPromptTemplate.cs:95— `RenderAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
X2 · Cancellation propagation· Async local function without CancellationToken · ×4
Async local function without CancellationToken: PerformChatCompletion dotnet/samples/Demos/AmazonBedrockModels/Program.cs:37— Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
Async local function without CancellationToken: PerformTextGeneration dotnet/samples/Demos/AmazonBedrockModels/Program.cs:77— Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
Async local function without CancellationToken: PerformStreamChatCompletion dotnet/samples/Demos/AmazonBedrockModels/Program.cs:113— Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
Async local function without CancellationToken: PerformStreamTextGeneration dotnet/samples/Demos/AmazonBedrockModels/Program.cs:151— Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (7 members, 50+ identical tokens) dotnet/src/Agents/AzureAI/AzureAIAgent.cs:131— dotnet/src/Agents/AzureAI/AzureAIAgent.cs:131-200 | dotnet/src/Agents/AzureAI/AzureAIAgent.cs:234-313 | dotnet/src/Agents/Core/ChatCompletionAgent.cs:67-145 | dotnet/src/Agents/Core/ChatCompletionAgent.cs:170-225 | dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs:125-199 | dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs:233-321 | dotnet/src/Agents/OpenAI/OpenAIResponseAgent.cs:164-198 — These 7 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 7 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 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_code_interpreter_streaming_with_message_callback.py:29— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_code_interpreter_streaming_with_message_callback.py:29-135 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_code_interpreter.py:42-145 | python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_code_interpreter.py:39-139 | python/samples/concepts/agents/openai_assistant/openai_assistant_chart_maker_streaming.py:21-99 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_code_interpreter.py:37-137 | python/samples/concepts/agents/openai_assistant/openai_assistant_file_manipulation_streaming.py:21-103 | python/samples/learn_resources/agent_docs/assistant_code.py:71-153 — These 7 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 7 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 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_function_calling_from_file.py:39— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_function_calling_from_file.py:39-86 | python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_function_calling_from_file.py:39-98 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_function_calling_from_file.py:37-96 | python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_function_calling_from_file.py:39-97 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_file_search.py:35-96 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_function_calling_from_file.py:37-95 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_web_search.py:33-82 — These 7 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 7 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 7 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (5 members, 50+ identical tokens) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.DependencyInjection.cs:33— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.DependencyInjection.cs:33-77 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.DependencyInjection.cs:96-136 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.cs:34-64 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.cs:79-106 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.cs:122-149 — 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.
Members sharing a duplicated core (5 members, 50+ identical tokens) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:101— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:101-127 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:212-238 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:112-132 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:221-248 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:336-362 — 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.
Members sharing a duplicated core (5 members, 50+ identical tokens) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:586— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:586-631 | python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:240-286 | python/semantic_kernel/agents/open_ai/azure_responses_agent.py:247-293 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:556-598 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:593-635 — 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.
Duplicated block (30 lines × 2) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:163— dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:163-192 | dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:146-175 — before extracting anything, compare `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs` and `dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 239 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 `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:163` 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 (30 lines × 2) dotnet/src/Agents/Core/Internal/CoreKernelArgumentsExtensions.cs:29— dotnet/src/Agents/Core/Internal/CoreKernelArgumentsExtensions.cs:29-58 | dotnet/src/InternalUtilities/arguments/Extensions/KernelArgumentsExtensions.cs:27-56 — before extracting anything, compare `dotnet/src/Agents/Core/Internal/CoreKernelArgumentsExtensions.cs` and `dotnet/src/InternalUtilities/arguments/Extensions/KernelArgumentsExtensions.cs` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (30 lines × 2) python/semantic_kernel/connectors/ai/azure_ai_inference/azure_ai_inference_prompt_execution_settings.py:57— python/semantic_kernel/connectors/ai/azure_ai_inference/azure_ai_inference_prompt_execution_settings.py:57-86 | python/semantic_kernel/connectors/ai/open_ai/prompt_execution_settings/open_ai_prompt_execution_settings.py:118-147 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: `ServiceInvalidExecutionSettingsError` names `semantic_kernel.exceptions` in one and `semantic_kernel.exceptions.service_exceptions` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (27 lines × 2) dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:264— dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:264-290 | dotnet/src/Connectors/Connectors.HuggingFace/Core/HuggingFaceMessageApiClient.cs:110-136 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs` and `dotnet/src/Connectors/Connectors.HuggingFace/Core/HuggingFaceMessageApiClient.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 66 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 `dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:264` 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 (27 lines × 2) python/semantic_kernel/connectors/chroma.py:407— python/semantic_kernel/connectors/chroma.py:407-433 | python/semantic_kernel/connectors/weaviate.py:454-480 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (27 lines × 2) python/samples/concepts/reasoning/simple_reasoning.py:81— python/samples/concepts/reasoning/simple_reasoning.py:81-107 | python/samples/concepts/reasoning/simple_reasoning_azure_ai_inference.py:45-71 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16–17 lines × 2) dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:174— dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:174-189 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs:52-68 — before extracting anything, compare `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs` and `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 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 `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:174` 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 (16–17 lines × 2) dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:216— dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs:216-231 | dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs:95-111 — before extracting anything, compare `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs` and `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 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 `dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIKernelBuilderExtensions.cs: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. 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 (16–17 lines × 2) dotnet/src/Plugins/Plugins.StructuredData.EntityFramework/StructuredDataService.cs:98— dotnet/src/Plugins/Plugins.StructuredData.EntityFramework/StructuredDataService.cs:98-114 | dotnet/src/Plugins/Plugins.StructuredData.EntityFramework/StructuredDataService.cs:144-159 — 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 `dotnet/src/Plugins/Plugins.StructuredData.EntityFramework/StructuredDataService.cs:98` 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 × 4) dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:570— dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:570-581 | dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:640-651 | dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:396-407 | dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs:646-657 — before extracting anything, compare `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs` and `dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 137 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 `dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:570` 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 × 4) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:38— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:38-49 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:74-85 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:156-167 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:193-204 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs` and `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 109 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:72` calls `GetHttpClient` and `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:37` 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.
Duplicated block (12 lines × 4) python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:318— python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:318-329 | python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:380-391 | python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:257-268 | python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:319-330 — before extracting anything, compare `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py` and `python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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 (11 lines × 3) dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.cs:269— dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.cs:269-283 | dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.cs:298-308 | dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.cs:328-343 — 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 `dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.cs:269` 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, `dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.cs:269` calls `NotNullOrWhiteSpace` and `dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.cs:298` does not — after which the two agree again for 5 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 (11 lines × 3) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:1245— python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:1245-1255 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:715-725 | python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:1134-1144 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py` and `python/semantic_kernel/agents/open_ai/assistant_thread_actions.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 204 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 3) python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:117— python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:117-127 | python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_completion.py:88-98 | python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_embedding.py:79-89 — before extracting anything, compare `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py` and `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_completion.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 95 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 `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:117` 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 × 3) dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:400— dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:400-407 | dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:439-446 | dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs:416-423 — before extracting anything, compare `dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs` and `dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 137 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 (8 lines × 3) dotnet/src/Connectors/Connectors.HuggingFace/Services/HuggingFaceTextGenerationService.cs:47— dotnet/src/Connectors/Connectors.HuggingFace/Services/HuggingFaceTextGenerationService.cs:47-54 | dotnet/src/Connectors/Connectors.MistralAI/Services/MistralAIChatCompletionService.cs:34-41 | dotnet/src/Connectors/Connectors.MistralAI/Services/MistralAITextEmbeddingGenerationService.cs:35-42 — 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 `dotnet/src/Connectors/Connectors.HuggingFace/Services/HuggingFaceTextGenerationService.cs:47` 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 × 3) python/samples/concepts/mcp/servers/menu_agent_server.py:164— python/samples/concepts/mcp/servers/menu_agent_server.py:164-171 | python/samples/concepts/mcp/servers/restaurant_booking_agent_server.py:138-145 | python/samples/demos/mcp_server/agent_as_server.py:216-223 — before extracting anything, compare `python/samples/concepts/mcp/servers/menu_agent_server.py` and `python/samples/concepts/mcp/servers/restaurant_booking_agent_server.py` as WHOLE FILES: this scan already matched 4 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. 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 `python/samples/concepts/mcp/servers/menu_agent_server.py:164` 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) dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:55— dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:55-59 | dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:67-71 | dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:79-83 — 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.
Duplicated block (5 lines × 3) dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:57— dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:57-61 | dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:69-73 | dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:82-86 — 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.
Duplicated block (5 lines × 3) dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:69— dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:69-73 | dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:81-85 | dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:93-97 — 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.
Duplicated block (31 lines × 2) python/semantic_kernel/agents/orchestration/agent_actor_base.py:162— python/semantic_kernel/agents/orchestration/agent_actor_base.py:162-192 | python/semantic_kernel/agents/orchestration/handoffs.py:325-355 — 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 (31 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_with_existing_agent_id.py:35— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_with_existing_agent_id.py:35-65 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_with_existing_agent_id.py:31-61 — 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 `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_with_existing_agent_id.py:35` 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 (31 lines × 2) python/samples/concepts/chat_completion/simple_chatbot_with_truncation_history_reducer.py:109— python/samples/concepts/chat_completion/simple_chatbot_with_truncation_history_reducer.py:109-139 | python/samples/concepts/chat_completion/simple_chatbot_with_truncation_history_reducer_autoreduce.py:114-144 — before extracting anything, compare `python/samples/concepts/chat_completion/simple_chatbot_with_truncation_history_reducer.py` and `python/samples/concepts/chat_completion/simple_chatbot_with_truncation_history_reducer_autoreduce.py` as WHOLE FILES: 98% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 3) python/semantic_kernel/agents/bedrock/bedrock_agent.py:290— python/semantic_kernel/agents/bedrock/bedrock_agent.py:290-304 | python/semantic_kernel/agents/bedrock/bedrock_agent.py:392-406 | python/semantic_kernel/agents/bedrock/bedrock_agent.py:497-511 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `python/semantic_kernel/agents/bedrock/bedrock_agent.py:390` calls `warning` and `python/semantic_kernel/agents/bedrock/bedrock_agent.py:288` 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 (15 lines × 3) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_retrieve_messages_from_thread.py:47— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_retrieve_messages_from_thread.py:47-61 | python/samples/getting_started_with_agents/azure_ai_agent/step01_azure_ai_agent.py:31-45 | python/samples/getting_started_with_agents/azure_ai_agent/step02_azure_ai_agent_plugin.py:46-60 — before extracting anything, compare `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_retrieve_messages_from_thread.py` and `python/samples/getting_started_with_agents/azure_ai_agent/step02_azure_ai_agent_plugin.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 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 `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_retrieve_messages_from_thread.py: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 (15 lines × 3) python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:66— python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:66-80 | python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_with_existing_agent_id.py:33-47 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_file_search.py:65-79 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_file_search.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 86 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 `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:66` 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–12 lines × 2) python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:296— python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:296-307 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:367-377 — before extracting anything, compare `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` and `python/semantic_kernel/agents/open_ai/openai_responses_agent.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 159 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 (11–12 lines × 2) python/semantic_kernel/connectors/ai/nvidia/services/nvidia_handler.py:50— python/semantic_kernel/connectors/ai/nvidia/services/nvidia_handler.py:50-61 | python/semantic_kernel/connectors/ai/open_ai/services/open_ai_handler.py:111-121 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `settings` to `NvidiaEmbeddingPromptExecutionSettings` in one and `OpenAIEmbeddingPromptExecutionSettings` 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 (11–12 lines × 2) python/samples/concepts/mcp/azure_ai_agent_with_local_server.py:47— python/samples/concepts/mcp/azure_ai_agent_with_local_server.py:47-57 | python/samples/concepts/mcp/azure_ai_agent_with_mcp_plugin.py:23-34 — 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 `python/samples/concepts/mcp/azure_ai_agent_with_local_server.py: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.
Blocking `Thread.Sleep` inside an `async` method dotnet/src/Experimental/Process.IntegrationTests.Resources/ProcessCycleTestResources.cs:167— `Thread.Sleep` parks the thread for the whole delay: no other work runs on it, and under load the pool must grow to make up for it. `await Task.Delay(…)` suspends only this method.
Blocking `Thread.Sleep` inside an `async` method dotnet/src/Experimental/Process.IntegrationTests.Resources/ProcessCycleTestResources.cs:177— `Thread.Sleep` parks the thread for the whole delay: no other work runs on it, and under load the pool must grow to make up for it. `await Task.Delay(…)` suspends only this method.
Blocking `Thread.Sleep` inside an `async` method dotnet/src/Experimental/Process.IntegrationTests.Resources/ProcessCycleTestResources.cs:187— `Thread.Sleep` parks the thread for the whole delay: no other work runs on it, and under load the pool must grow to make up for it. `await Task.Delay(…)` suspends only this method.
BareSuppressMessage dotnet/src/InternalUtilities/src/Diagnostics/NullableAttributes.cs:118— SuppressMessage — the suppression records no reason: either it carries no justification argument at all, or one that states nothing a reader can weigh ("OK", "By design"). A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited. Write what makes this site legitimately different — the invariant that holds, the framework contract that forces the shape — or remove the suppression and fix what it hides.
BareSuppressMessage dotnet/src/InternalUtilities/src/Diagnostics/NullableAttributes.cs:143— SuppressMessage — the suppression records no reason: either it carries no justification argument at all, or one that states nothing a reader can weigh ("OK", "By design"). A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited. Write what makes this site legitimately different — the invariant that holds, the framework contract that forces the shape — or remove the suppression and fix what it hides.
Change coupling: AzureOpenAIChatCompletionService.cs ↔ OpenAIChatCompletionService.cs dotnet/src/Connectors/Connectors.AzureOpenAI/Services/AzureOpenAIChatCompletionService.cs:1— `dotnet/src/Connectors/Connectors.AzureOpenAI/Services/AzureOpenAIChatCompletionService.cs` and `dotnet/src/Connectors/Connectors.OpenAI/Services/OpenAIChatCompletionService.cs` change together 88% of the time (15 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `136e7c2b` .Net BugFix - Using StandardizedPrompt With Kernel/Function InvokeAsy… (at that commit the files were still `dotnet/src/Connectors/Connectors.AI.OpenAI/ChatCompletion/AzureOpenAIChatCompletionService.cs` and `dotnet/src/Connectors/Connectors.AI.OpenAI/ChatCompletion/OpenAIChatCompletionService.cs`); `8627272f` .Net: IChatCompletion interface and all its implementations are renam… (at that commit the files were still `dotnet/src/Connectors/Connectors.AI.OpenAI/ChatCompletion/AzureOpenAIChatCompletionService.cs` and `dotnet/src/Connectors/Connectors.AI.OpenAI/ChatCompletion/OpenAIChatCompletionService.cs`); `1c6a1871` .Net Standardized prompt input support for Chat Completion APIs (#3781) (at that commit the files were still `dotnet/src/Connectors/Connectors.AI.OpenAI/ChatCompletion/AzureOpenAIChatCompletion.cs` and `dotnet/src/Connectors/Connectors.AI.OpenAI/ChatCompletion/OpenAIChatCompletion.cs`) — run `git show` on any of them.
Change coupling: HuggingFaceTextEmbeddingGenerationService.cs ↔ HuggingFaceTextGenerationService.cs dotnet/src/Connectors/Connectors.HuggingFace/Services/HuggingFaceTextEmbeddingGenerationService.cs:1— `dotnet/src/Connectors/Connectors.HuggingFace/Services/HuggingFaceTextEmbeddingGenerationService.cs` and `dotnet/src/Connectors/Connectors.HuggingFace/Services/HuggingFaceTextGenerationService.cs` change together 79% of the time (15 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `a335d556` .Net: Sample showing function calling using NexusRaven (#7256); `a79fb4e2` .Net: Update classes so namespaces are consistent and match project l…; `9a8c0bec` .Net: Add new Semantic-Kernel-Version header to all HTTP requests (#5… (at that commit the files were still `dotnet/src/Connectors/Connectors.HuggingFace/TextEmbedding/HuggingFaceTextEmbeddingGenerationService.cs` and `dotnet/src/Connectors/Connectors.HuggingFace/TextGeneration/HuggingFaceTextGenerationService.cs`) — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×2
Edited copy of a member (12 corresponding lines) dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProxyActor.cs:33— dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProxyActor.cs:33-61 | dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs:222-251 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) dotnet/src/Experimental/Process.LocalRuntime/LocalProxy.cs:34— dotnet/src/Experimental/Process.LocalRuntime/LocalProxy.cs:34-62 | dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs:139-168 — These two members are one piece of code written twice and then edited apart: 12 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 (14 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (14 members, 50+ identical tokens) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:66— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:66-110 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:124-168 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:20-39 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:57-84 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:98-125 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Anthropic/AnthropicService.cs:51-120 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Anthropic/AnthropicService.cs:134-203 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandRService.cs:75-140 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandRService.cs:154-219 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:48-75 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:92-119 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:21-40 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:59-83 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:104-128 — These 14 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 14 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 14 times.
Members sharing a duplicated core (14 members, 50+ identical tokens) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding.py:29— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding.py:29-35 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding_streaming_with_message_callback.py:34-40 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_deep_research_streaming.py:35-44 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_mcp_streaming.py:20-26 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_message_callback.py:49-55 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_message_callback_streaming.py:53-59 | python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback.py:49-55 | python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py:49-55 | python/samples/concepts/agents/openai_responses/responses_agent_message_callback.py:48-54 | python/samples/concepts/agents/openai_responses/responses_agent_message_callback_streaming.py:48-54 | python/samples/getting_started_with_agents/azure_ai_agent/step06_azure_ai_agent_openapi.py:27-33 | python/samples/getting_started_with_agents/azure_ai_agent/step07_azure_ai_agent_retrieval.py:25-31 | python/samples/getting_started_with_agents/azure_ai_agent/step09_azure_ai_agent_mcp.py:20-26 | python/samples/getting_started_with_agents/azure_ai_agent/step10_azure_ai_agent_deep_research.py:31-38 — These 14 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 14 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 14 times.
Duplicated block (51 lines × 2) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandRService.cs:76— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandRService.cs:76-126 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandRService.cs:155-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 (51 lines × 2) dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/DocumentGenerationProcess.cs:55— dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/DocumentGenerationProcess.cs:55-105 | dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Processes/DocumentGenerationProcess.cs:55-105 — before extracting anything, compare `dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/DocumentGenerationProcess.cs` and `dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Processes/DocumentGenerationProcess.cs` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (44 lines × 2) dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs:146— dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs:146-189 | dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:1120-1163 — before extracting anything, compare `dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs` and `dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 80 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 `dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs:146` 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 (44 lines × 2) python/semantic_kernel/connectors/mcp.py:752— python/semantic_kernel/connectors/mcp.py:752-795 | python/semantic_kernel/connectors/mcp.py:836-879 — 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 (35 lines × 2) dotnet/src/InternalUtilities/src/Text/SseReader.cs:26— dotnet/src/InternalUtilities/src/Text/SseReader.cs:26-60 | dotnet/src/InternalUtilities/src/Text/SseReader.cs:64-98 — 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 (35 lines × 2) python/semantic_kernel/contents/audio_content.py:54— python/semantic_kernel/contents/audio_content.py:54-88 | python/semantic_kernel/contents/image_content.py:65-105 — 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 (31–32 lines × 2) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Clients/BedrockTextEmbeddingGenerationClient.cs:76— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Clients/BedrockTextEmbeddingGenerationClient.cs:76-107 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Clients/BedrockTextEmbeddingGenerationClient.cs:114-144 — 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 (31–32 lines × 2) python/semantic_kernel/agents/bedrock/bedrock_agent.py:372— python/semantic_kernel/agents/bedrock/bedrock_agent.py:372-402 | python/semantic_kernel/agents/bedrock/bedrock_agent.py:476-507 — 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 (24–26 lines × 2) dotnet/src/Agents/AzureAI/AzureAIAgent.cs:69— dotnet/src/Agents/AzureAI/AzureAIAgent.cs:69-92 | dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs:46-71 — before extracting anything, compare `dotnet/src/Agents/AzureAI/AzureAIAgent.cs` and `dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 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 (24–26 lines × 2) python/samples/concepts/auto_function_calling/chat_completion_with_auto_function_calling_streaming.py:82— python/samples/concepts/auto_function_calling/chat_completion_with_auto_function_calling_streaming.py:82-105 | python/samples/concepts/auto_function_calling/chat_completion_with_manual_function_calling_streaming.py:102-127 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20–21 lines × 2) dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs:78— dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs:78-98 | dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:503-522 — before extracting anything, compare `dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs` and `dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 80 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 `dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs:78` 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–21 lines × 2) python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:260— python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:260-279 | python/semantic_kernel/processes/local_runtime/local_step.py:241-261 — before extracting anything, compare `python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py` and `python/semantic_kernel/processes/local_runtime/local_step.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 130 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. Note first that the copies are not typed on the same thing: `KernelException` names `semantic_kernel.exceptions` in one and `semantic_kernel.exceptions.kernel_exceptions` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (20 lines × 3) dotnet/src/Agents/AzureAI/AzureAIAgent.cs:140— dotnet/src/Agents/AzureAI/AzureAIAgent.cs:140-159 | dotnet/src/Agents/AzureAI/AzureAIAgent.cs:243-262 | dotnet/src/Agents/OpenAI/OpenAIResponseAgent.cs:165-184 — 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.
Duplicated block (20 lines × 3) python/semantic_kernel/agents/runtime/core/routed_agent.py:130— python/semantic_kernel/agents/runtime/core/routed_agent.py:130-149 | python/semantic_kernel/agents/runtime/core/routed_agent.py:261-280 | python/semantic_kernel/agents/runtime/core/routed_agent.py:390-409 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `func` to `Callable[[AgentT, ReceivesT, MessageContext], Coroutine[Any, Any, ProducesT]]` in one and `Callable[[AgentT, ReceivesT, MessageContext], Coroutine[Any, Any, None]]` 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 (16–19 lines × 2) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:57— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:57-75 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:68-83 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs` and `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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 `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:57` 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 (16–19 lines × 2) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:101— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:101-119 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:113-128 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs` and `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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 `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:101` 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 (14 lines × 6) dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:159— dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:159-172 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:197-210 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:237-250 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:274-287 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:313-326 | dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchExtensions.cs:350-363 — all 6 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.
Duplicated block (14 lines × 6) python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_function_calling_from_file.py:63— python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_function_calling_from_file.py:63-80 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_function_calling_from_file.py:61-78 | python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_function_calling_from_file.py:63-80 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_file_search.py:67-80 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_function_calling_from_file.py:61-78 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_web_search.py:48-61 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_function_calling_from_file.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_function_calling_from_file.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 59 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 `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_function_calling_from_file.py:63` 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 × 3) dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:253— dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:253-261 | dotnet/src/Connectors/Connectors.HuggingFace/Core/HuggingFaceClient.cs:188-196 | dotnet/src/Connectors/Connectors.HuggingFace/Core/HuggingFaceMessageApiClient.cs:99-107 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs` and `dotnet/src/Connectors/Connectors.HuggingFace/Core/HuggingFaceMessageApiClient.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 66 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 `dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:253` 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 × 3) python/semantic_kernel/connectors/brave.py:233— python/semantic_kernel/connectors/brave.py:233-241 | python/semantic_kernel/connectors/google_search.py:271-279 | python/semantic_kernel/connectors/utils/document_loader.py:42-50 — 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.
Duplicated block (9 lines × 4) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:151— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:151-159 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:185-193 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:273-281 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:308-316 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs` and `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 109 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) dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs:98— dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs:98-106 | dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs:114-122 | dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionStreamResponse.cs:92-100 | dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionStreamResponse.cs:108-116 — before extracting anything, compare `dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs` and `dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionStreamResponse.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs:108` calls `JsonPropertyName` and `dotnet/src/Connectors/Connectors.HuggingFace/Core/Models/ChatCompletionResponse.cs:123` 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 (5 lines × 4) dotnet/src/Experimental/Process.LocalRuntime/LocalProxy.cs:52— dotnet/src/Experimental/Process.LocalRuntime/LocalProxy.cs:52-56 | dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs:153-157 | dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProxyActor.cs:51-55 | dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs:236-240 — before extracting anything, compare `dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs` and `dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 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 (5 lines × 4) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:81— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:81-85 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:139-143 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandRService.cs:87-91 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandRService.cs:166-170 — 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 (6 lines × 5) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:77— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:77-82 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:65-70 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandRService.cs:83-88 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:55-60 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:66-71 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs` and `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:71` calls `SetNullablePropertyIfNotNull` and `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:62` 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.
Duplicated block (6 lines × 5) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:135— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:135-140 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:106-111 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandRService.cs:162-167 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:99-104 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:111-116 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs` and `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:112` calls `SetNullablePropertyIfNotNull` and `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Meta/MetaService.cs:106` 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.
Duplicated block (6 lines × 4) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:65— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:65-70 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:106-111 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandRService.cs:83-88 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandRService.cs:162-167 — 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 (6 lines × 4) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Anthropic/AnthropicService.cs:58— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Anthropic/AnthropicService.cs:58-63 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Anthropic/AnthropicService.cs:141-146 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandRService.cs:82-87 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Cohere/CohereCommandRService.cs:161-166 — 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 (42 lines × 2) python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:65— python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:65-106 | python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:158-199 — 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 `python/semantic_kernel/agents/open_ai/azure_assistant_agent.py: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.
Duplicated block (42 lines × 2) python/semantic_kernel/agents/open_ai/azure_responses_agent.py:72— python/semantic_kernel/agents/open_ai/azure_responses_agent.py:72-113 | python/semantic_kernel/agents/open_ai/azure_responses_agent.py:165-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 `python/semantic_kernel/agents/open_ai/azure_responses_agent.py:72` 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 (39 lines × 2) python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:326— python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:326-364 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:386-424 — 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 (39 lines × 2) python/semantic_kernel/agents/open_ai/openai_responses_agent.py:408— python/semantic_kernel/agents/open_ai/openai_responses_agent.py:408-446 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:468-506 — 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 (36 lines × 3) python/semantic_kernel/connectors/azure_cosmos_db.py:438— python/semantic_kernel/connectors/azure_cosmos_db.py:438-473 | python/semantic_kernel/connectors/mongodb.py:363-398 | python/semantic_kernel/connectors/mongodb.py:407-442 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (36 lines × 3) python/samples/getting_started_with_agents/multi_agent_orchestration/step2_sequential.py:24— python/samples/getting_started_with_agents/multi_agent_orchestration/step2_sequential.py:24-59 | python/samples/getting_started_with_agents/multi_agent_orchestration/step2a_sequential_cancellation_token.py:27-62 | python/samples/getting_started_with_agents/multi_agent_orchestration/step2b_sequential_streaming_agent_response_callback.py:24-59 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `python/samples/getting_started_with_agents/multi_agent_orchestration/step2a_sequential_cancellation_token.py:22` calls `basicConfig`, `getLogger`, `setLevel` and `python/samples/getting_started_with_agents/multi_agent_orchestration/step2b_sequential_streaming_agent_response_callback.py:19` 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 (33–34 lines × 2) python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:78— python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:78-111 | python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_text_completion.py:51-83 — 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 (33–34 lines × 2) python/samples/concepts/mcp/servers/menu_agent_server.py:135— python/samples/concepts/mcp/servers/menu_agent_server.py:135-168 | python/samples/concepts/mcp/servers/restaurant_booking_agent_server.py:110-142 — before extracting anything, compare `python/samples/concepts/mcp/servers/menu_agent_server.py` and `python/samples/concepts/mcp/servers/restaurant_booking_agent_server.py` as WHOLE FILES: this scan already matched 4 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. 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 `python/samples/concepts/mcp/servers/menu_agent_server.py:135` 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 (32 lines × 3) python/semantic_kernel/connectors/chroma.py:377— python/semantic_kernel/connectors/chroma.py:377-408 | python/semantic_kernel/connectors/mongodb.py:457-488 | python/semantic_kernel/connectors/pinecone.py:508-539 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (32 lines × 3) python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py:92— python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py:92-123 | python/samples/getting_started_with_agents/multi_agent_orchestration/step4b_handoff_streaming_agent_response_callback.py:101-132 | python/samples/getting_started_with_agents/multi_agent_orchestration/step4c_handoff_mix_agent_types.py:133-164 — before extracting anything, compare `python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py` and `python/samples/getting_started_with_agents/multi_agent_orchestration/step4b_handoff_streaming_agent_response_callback.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 100 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 `python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py:92` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (25–26 lines × 2) python/semantic_kernel/connectors/qdrant.py:194— python/semantic_kernel/connectors/qdrant.py:194-219 | python/semantic_kernel/connectors/qdrant.py:599-623 — 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 `python/semantic_kernel/connectors/qdrant.py:194` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on 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.
Duplicated block (25–26 lines × 2) python/samples/concepts/agents/openai_responses/responses_agent_reasoning.py:34— python/samples/concepts/agents/openai_responses/responses_agent_reasoning.py:34-59 | python/samples/concepts/agents/openai_responses/responses_agent_reasoning_streaming.py:36-60 — before extracting anything, compare `python/samples/concepts/agents/openai_responses/responses_agent_reasoning.py` and `python/samples/concepts/agents/openai_responses/responses_agent_reasoning_streaming.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 64 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21–22 lines × 2) python/semantic_kernel/connectors/azure_ai_search.py:682— python/semantic_kernel/connectors/azure_ai_search.py:682-702 | python/semantic_kernel/connectors/azure_cosmos_db.py:912-933 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21–22 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step02_ToolCall/Program.cs:74— dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step02_ToolCall/Program.cs:74-95 | dotnet/samples/AgentFrameworkMigration/OpenAI/Step02_ToolCall/Program.cs:55-75 — before extracting anything, compare `dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step02_ToolCall/Program.cs` and `dotnet/samples/AgentFrameworkMigration/OpenAI/Step02_ToolCall/Program.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 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 (18 lines × 3) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:951— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:951-968 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:1061-1078 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:1171-1188 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py` and `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 235 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 `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:951` 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 (18 lines × 3) python/samples/concepts/filtering/prompt_filters.py:63— python/samples/concepts/filtering/prompt_filters.py:63-80 | python/samples/concepts/local_models/lm_studio_chat_completion.py:56-73 | python/samples/concepts/local_models/ollama_chat_completion.py:60-77 — before extracting anything, compare `python/samples/concepts/local_models/lm_studio_chat_completion.py` and `python/samples/concepts/local_models/ollama_chat_completion.py` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: `KernelArguments` names `semantic_kernel.functions` in one and `semantic_kernel.functions.kernel_arguments` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (17 lines × 3) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:502— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:502-518 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:459-475 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:541-557 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py` and `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 235 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 (17 lines × 3) python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py:58— python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py:58-75 | python/samples/getting_started_with_agents/multi_agent_orchestration/step4a_handoff_structured_inputs.py:74-90 | python/samples/getting_started_with_agents/multi_agent_orchestration/step4b_handoff_streaming_agent_response_callback.py:67-84 — before extracting anything, compare `python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py` and `python/samples/getting_started_with_agents/multi_agent_orchestration/step4b_handoff_streaming_agent_response_callback.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 100 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 `python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py:58` 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) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:730— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:730-743 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:834-847 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:925-938 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py` and `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 235 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 `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:730` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 3) python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py:99— python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py:99-112 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_to_audio.py:99-112 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_to_image.py:99-112 — before extracting anything, compare `python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py` and `python/semantic_kernel/connectors/ai/open_ai/services/azure_text_to_audio.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 `python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py:99` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–13 lines × 2) python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:315— python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:315-325 | python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:375-387 — 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 `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:315` 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–13 lines × 2) python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:254— python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:254-264 | python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:314-326 — 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 `python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:254` 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–7 lines × 2) python/semantic_kernel/connectors/mcp.py:571— python/semantic_kernel/connectors/mcp.py:571-577 | python/semantic_kernel/connectors/mcp.py:591-596 — 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 `python/semantic_kernel/connectors/mcp.py:571` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on 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.
Duplicated block (6–7 lines × 2) python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:280— python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:280-285 | python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:321-327 — 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 `python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py: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· Edited copy of a member (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py:97— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py:97-174 | python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter_streaming.py:99-177 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter_streaming.py:97— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter_streaming.py:97-179 | python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter.py:99-172 — These two members are one piece of code written twice and then edited apart: 17 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.
Duplicated block (31–33 lines × 2) python/samples/concepts/agents/openai_responses/responses_agent_plugins_streaming.py:64— python/samples/concepts/agents/openai_responses/responses_agent_plugins_streaming.py:64-96 | python/samples/concepts/agents/openai_responses/responses_agent_web_search_streaming.py:39-69 — before extracting anything, compare `python/samples/concepts/agents/openai_responses/responses_agent_plugins_streaming.py` and `python/samples/concepts/agents/openai_responses/responses_agent_web_search_streaming.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 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 `python/samples/concepts/agents/openai_responses/responses_agent_plugins_streaming.py: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. 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 (31–33 lines × 2) python/samples/getting_started_with_agents/chat_completion/step02_chat_completion_agent_thread_management.py:37— python/samples/getting_started_with_agents/chat_completion/step02_chat_completion_agent_thread_management.py:37-69 | python/samples/getting_started_with_agents/chat_completion/step03_chat_completion_agent_with_kernel.py:41-71 — 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 `python/samples/getting_started_with_agents/chat_completion/step02_chat_completion_agent_thread_management.py: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 (16 lines × 3) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_with_existing_agent_id.py:33— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_with_existing_agent_id.py:33-48 | python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_with_existing_agent_id.py:30-45 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_with_existing_agent_id.py:29-44 — 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 `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_with_existing_agent_id.py:33` 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 (16 lines × 3) python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:63— python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:63-78 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_file_search.py:62-77 | python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_file_search.py:60-75 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_file_search.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 86 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 `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:63` 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–10 lines × 2) python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py:98— python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py:98-107 | python/samples/concepts/agents/openai_assistant/openai_assistant_streaming.py:73-81 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_streaming.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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 `python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py:98` 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–10 lines × 2) python/samples/concepts/agents/openai_responses/responses_agent_reasoning_streaming.py:126— python/samples/concepts/agents/openai_responses/responses_agent_reasoning_streaming.py:126-134 | python/samples/concepts/agents/openai_responses/responses_agent_reasoning_streaming.py:150-159 — 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 `python/samples/concepts/agents/openai_responses/responses_agent_reasoning_streaming.py:150` 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.
Sync-over-async (deadlock risk) dotnet/src/Agents/Runtime/Abstractions/AgentProxy.cs:82— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) dotnet/src/Extensions/PromptTemplates.Handlebars/Helpers/KernelHelpers/KernelFunctionHelpers.cs:208— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
X25 · Inert configuration knob· Setting lookup falls back to a different setting than its key · ×2
Setting lookup falls back to a different setting than its key dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:66— `MistralService` looks up `"max_tokens"` and falls back to `TopK` when the caller supplies none — but line 25 of this same type looks up `"max_tokens"` and falls back to `MaxTokens`, which is the member that key names. The two cannot both be right: every caller who configures `MaxTokens` and passes no `"max_tokens"` override silently gets `TopK` instead, and nothing reports that the value was ignored. Fall back to `MaxTokens` here as line 25 does — or, if `TopK` genuinely is the intended source, look it up under its own key so the two sites stop disagreeing.
Setting lookup falls back to a different setting than its key dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:111— `MistralService` looks up `"max_tokens"` and falls back to `TopK` when the caller supplies none — but line 25 of this same type looks up `"max_tokens"` and falls back to `MaxTokens`, which is the member that key names. The two cannot both be right: every caller who configures `MaxTokens` and passes no `"max_tokens"` override silently gets `TopK` instead, and nothing reports that the value was ignored. Fall back to `MaxTokens` here as line 25 does — or, if `TopK` genuinely is the intended source, look it up under its own key so the two sites stop disagreeing.
X25 · Inert configuration knob· Constructor parameter is stored and never read · ×2
Constructor parameter is stored and never read dotnet/src/Plugins/Plugins.AI/CrewAI/CrewAIEnterprise.cs:139— `CrewAIEnterprise` takes `pollingInterval` from the caller and stores it in `_pollingInterval` on line 49, defaulting to `TimeSpan.FromSeconds(1)` when none is supplied — but `_pollingInterval` is never read anywhere in the type, and line 139 spells `TimeSpan.FromSeconds(1)` out again where that field's value belongs. Every caller that passes `pollingInterval` therefore gets `TimeSpan.FromSeconds(1)` regardless, and nothing in the type reports that its argument was ignored. Read `_pollingInterval` at line 139 — or, if the value genuinely is fixed, delete `pollingInterval` and `_pollingInterval` together so the signature stops advertising a knob that does nothing.
Constructor parameter is stored and never read dotnet/src/Plugins/Plugins.MsGraph/TaskListPlugin.cs:104— `TaskListPlugin` takes `jsonSerializerOptions` from the caller and stores it in `_jsonSerializerOptions` on line 41, defaulting to `s_options` when none is supplied — but `_jsonSerializerOptions` is never read anywhere in the type, and line 104 spells `s_options` out again where that field's value belongs. Every caller that passes `jsonSerializerOptions` therefore gets `s_options` regardless, and nothing in the type reports that its argument was ignored. Read `_jsonSerializerOptions` at line 104 — or, if the value genuinely is fixed, delete `jsonSerializerOptions` and `_jsonSerializerOptions` together so the signature stops advertising a knob that does nothing.
Swallowed exception (caught, then discarded) dotnet/samples/Demos/AotCompatibility/Program.cs:48— `catch (Exception)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
Swallowed exception (caught, then discarded) dotnet/src/Experimental/Orchestration.Flow/Execution/ReActEngine.cs:351— `catch (JsonException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
X5 · Nullable reference types· Null guard scopes only part of the work it protects · ×2
Null guard scopes only part of the work it protects dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/ChatClientChatCompletionService.cs:63— This method contradicts itself about `executionSettings`: line 53 tests it for null before doing anything with it — the author's own statement that null is an input this code expects — but that `if` scopes only the block beneath it, and line 63 then dereferences `executionSettings` as `executionSettings.ToChatOptions` AFTER the block has closed, where the guard no longer applies. A null `executionSettings` skips the guarded body and reaches that line anyway, throwing NullReferenceException on exactly the input the guard was written for. If the dereference belongs to the guarded work, move it inside the block; if `executionSettings` truly cannot be null by then, the guard above is misleading and should go.
Null guard scopes only part of the work it protects dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/ChatClientChatCompletionService.cs:96— This method contradicts itself about `executionSettings`: line 87 tests it for null before doing anything with it — the author's own statement that null is an input this code expects — but that `if` scopes only the block beneath it, and line 96 then dereferences `executionSettings` as `executionSettings.ToChatOptions` AFTER the block has closed, where the guard no longer applies. A null `executionSettings` skips the guarded body and reaches that line anyway, throwing NullReferenceException on exactly the input the guard was written for. If the dereference belongs to the guarded work, move it inside the block; if `executionSettings` truly cannot be null by then, the guard above is misleading and should go.
X5 · Nullable reference types· Symbol treated as nullable, then dereferenced unguarded · ×2
Symbol treated as nullable, then dereferenced unguarded dotnet/src/SemanticKernel.Core/TemplateEngine/Blocks/NamedArgBlock.cs:177— This method contradicts itself about `trimmedParts`: line 175 writes `trimmedParts?.Length`, which says `trimmedParts` can be null, but line 177 then dereferences it directly with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `trimmedParts` truly cannot be null here, the `?.` is misleading. Settle it one way — test `trimmedParts` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded dotnet/src/Functions/Functions.OpenApi/OpenApi/OpenApiDocumentParser.cs:476— This method contradicts itself about `mediaTypeMetadata`: line 478 writes `mediaTypeMetadata?.Schema`, which says `mediaTypeMetadata` can be null, but line 476 then dereferences it directly as `mediaTypeMetadata.Schema` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `mediaTypeMetadata` truly cannot be null here, the `?.` is misleading. Settle it one way — test `mediaTypeMetadata` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
PromptExecutionSettingsExtensions.ToChatOptions (cyclomatic 63) dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettingsExtensions.cs:18— PromptExecutionSettingsExtensions.ToChatOptions has cyclomatic complexity 63 (threshold 15). Of this number, 57 points are the body's own statements and 6 belong to one function item inside it that branches. 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.
AgentThreadActions._process_stream_events (cyclomatic 56) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:582— AgentThreadActions._process_stream_events has cyclomatic complexity 56 (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.
OracleCollection._lambda_parser (cyclomatic 52) python/semantic_kernel/connectors/oracle.py:1014— OracleCollection._lambda_parser has cyclomatic complexity 52 (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.
FlowExecutor.ExecuteFlowAsync (cyclomatic 50) dotnet/src/Experimental/Orchestration.Flow/Execution/FlowExecutor.cs:165— FlowExecutor.ExecuteFlowAsync has cyclomatic complexity 50 (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.
CodeTokenizer.Tokenize (cyclomatic 45) dotnet/src/SemanticKernel.Core/TemplateEngine/CodeTokenizer.cs:53— CodeTokenizer.Tokenize has cyclomatic complexity 45 (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.
AgentThreadActions.invoke (cyclomatic 43) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:109— AgentThreadActions.invoke has cyclomatic complexity 43 (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.
AssistantThreadActions.invoke_stream (cyclomatic 41) python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:371— AssistantThreadActions.invoke_stream has cyclomatic complexity 41 (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.
OpenAIRealtimeBase.send (cyclomatic 39) python/semantic_kernel/connectors/ai/open_ai/services/_open_ai_realtime.py:524— OpenAIRealtimeBase.send has cyclomatic complexity 39 (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.
RedisCollection._lambda_parser (cyclomatic 39) python/semantic_kernel/connectors/redis.py:366— RedisCollection._lambda_parser has cyclomatic complexity 39 (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.
ClientCore.CreateRequestMessages (cyclomatic 37) dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:730— ClientCore.CreateRequestMessages has cyclomatic complexity 37 (threshold 15). Of this number, 32 points are the body's own statements and 5 belong to one function literal inside it that branches. 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.
FlowExecutor.ExecuteStepAsync (cyclomatic 37) dotnet/src/Experimental/Orchestration.Flow/Execution/FlowExecutor.cs:605— FlowExecutor.ExecuteStepAsync 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.
ResponsesAgentThreadActions.invoke_stream (cyclomatic 37) python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:289— ResponsesAgentThreadActions.invoke_stream 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.
MistralClient.GetChatMessageContentsAsync (cyclomatic 31) dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:49— MistralClient.GetChatMessageContentsAsync has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
MistralClient.GetStreamingChatMessageContentsAsync (cyclomatic 31) dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:267— MistralClient.GetStreamingChatMessageContentsAsync has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
PublicNetworkAddressValidator.TryClassifyIPv4 (cyclomatic 30) dotnet/src/InternalUtilities/src/Http/PublicNetworkAddressValidator.cs:133— PublicNetworkAddressValidator.TryClassifyIPv4 has cyclomatic complexity 30 (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.
Program.Main (cyclomatic 29) dotnet/samples/Demos/OpenAIRealtime/Program.cs:24— Program.Main 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.
AssistantThreadActions.invoke (cyclomatic 29) python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:137— AssistantThreadActions.invoke 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.
Kernel.invoke_function_call (cyclomatic 29) python/semantic_kernel/kernel.py:326— Kernel.invoke_function_call has cyclomatic complexity 29 (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.
KernelFunctionFromMethod.GetParameterMarshalerDelegate (cyclomatic 28) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:614— KernelFunctionFromMethod.GetParameterMarshalerDelegate has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 belong to one function literal inside it that branches. 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.
TemplateTokenizer.Tokenize (cyclomatic 28) dotnet/src/SemanticKernel.Core/TemplateEngine/TemplateTokenizer.cs:40— TemplateTokenizer.Tokenize has cyclomatic complexity 28 (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.
AzureAISearchCollection._lambda_parser (cyclomatic 28) python/semantic_kernel/connectors/azure_ai_search.py:636— AzureAISearchCollection._lambda_parser has cyclomatic complexity 28 (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.
AzureAISearchCollection._inner_search (cyclomatic 27) python/semantic_kernel/connectors/azure_ai_search.py:546— AzureAISearchCollection._inner_search has cyclomatic complexity 27 (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.
PineconeCollection._lambda_parser (cyclomatic 27) python/semantic_kernel/connectors/pinecone.py:496— PineconeCollection._lambda_parser has cyclomatic complexity 27 (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.
WeaviateCollection._lambda_parser (cyclomatic 27) python/semantic_kernel/connectors/weaviate.py:407— WeaviateCollection._lambda_parser has cyclomatic complexity 27 (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.
FunctionResult.GetValue (cyclomatic 26) dotnet/src/SemanticKernel.Abstractions/Functions/FunctionResult.cs:83— FunctionResult.GetValue 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.
AssistantThreadActions.InvokeStreamingAsync (cyclomatic 26) dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:353— AssistantThreadActions.InvokeStreamingAsync 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.
ChromaCollection._lambda_parser (cyclomatic 26) python/semantic_kernel/connectors/chroma.py:365— ChromaCollection._lambda_parser 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.
AssistantThreadActions.InvokeAsync (cyclomatic 25) dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:114— AssistantThreadActions.InvokeAsync has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
BraveTextSearch.CheckQueryValidation (cyclomatic 25) dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:700— BraveTextSearch.CheckQueryValidation 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.
ResponsesAgentThreadActions._prepare_chat_history_for_request (cyclomatic 25) python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:766— ResponsesAgentThreadActions._prepare_chat_history_for_request 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.
QdrantCollection._lambda_parser (cyclomatic 25) python/semantic_kernel/connectors/qdrant.py:367— QdrantCollection._lambda_parser 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.
CodeTokenizer.tokenize (cyclomatic 25) python/semantic_kernel/template_engine/code_tokenizer.py:29— CodeTokenizer.tokenize 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.
TypeConverterFactory.GetTypeConverter (cyclomatic 24) dotnet/src/InternalUtilities/src/System/TypeConverterFactory.cs:22— TypeConverterFactory.GetTypeConverter has cyclomatic complexity 24 (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.
AgentThreadActions.InvokeAsync (cyclomatic 24) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:136— AgentThreadActions.InvokeAsync has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
AgentThreadActions.InvokeStreamingAsync (cyclomatic 24) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:371— AgentThreadActions.InvokeStreamingAsync 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.
ClientCore.GetStreamingChatMessageContentsAsync (cyclomatic 24) dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:227— ClientCore.GetStreamingChatMessageContentsAsync 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.
azure_ai_search._definition_to_azure_ai_search_index (cyclomatic 24) python/semantic_kernel/connectors/azure_ai_search.py:210— azure_ai_search._definition_to_azure_ai_search_index 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.
MongoDBAtlasCollection._lambda_parser (cyclomatic 24) python/semantic_kernel/connectors/mongodb.py:445— MongoDBAtlasCollection._lambda_parser has cyclomatic complexity 24 (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.
KernelFunctionFromPrompt.InvokeStreamingCoreAsync (cyclomatic 23) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromPrompt.cs:275— KernelFunctionFromPrompt.InvokeStreamingCoreAsync 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.
ResponseThreadActions.InvokeStreamingAsync (cyclomatic 23) dotnet/src/Agents/OpenAI/Internal/ResponseThreadActions.cs:120— ResponseThreadActions.InvokeStreamingAsync 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.
ResponsesAgentThreadActions.invoke (cyclomatic 23) python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:87— ResponsesAgentThreadActions.invoke 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.
OpenAIResponsesAgent.__init__ (cyclomatic 22) python/semantic_kernel/agents/open_ai/openai_responses_agent.py:287— OpenAIResponsesAgent.__init__ has cyclomatic complexity 22 (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.
InProcessRuntime._process_next (cyclomatic 22) python/semantic_kernel/agents/runtime/in_process/in_process_runtime.py:528— InProcessRuntime._process_next has cyclomatic complexity 22 (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.
ChatCompletionClientBase.get_streaming_chat_message_contents (cyclomatic 22) python/semantic_kernel/connectors/ai/chat_completion_client_base.py:196— ChatCompletionClientBase.get_streaming_chat_message_contents has cyclomatic complexity 22 (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.
AzureOpenAIConfigBase.__init__ (cyclomatic 22) python/semantic_kernel/connectors/ai/open_ai/services/azure_config_base.py:28— AzureOpenAIConfigBase.__init__ has cyclomatic complexity 22 (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.
InMemoryCollection._parse_and_validate_filter (cyclomatic 22) python/semantic_kernel/connectors/in_memory.py:743— InMemoryCollection._parse_and_validate_filter has cyclomatic complexity 22 (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.
VectorStoreCollection.get (cyclomatic 22) python/semantic_kernel/data/vector.py:1414— VectorStoreCollection.get has cyclomatic complexity 22 (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.
kernel_function_decorator._parse_parameter (cyclomatic 22) python/semantic_kernel/functions/kernel_function_decorator.py:135— kernel_function_decorator._parse_parameter has cyclomatic complexity 22 (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.
public_network_address_validator._try_classify_ipv4 (cyclomatic 22) python/semantic_kernel/utils/public_network_address_validator.py:106— public_network_address_validator._try_classify_ipv4 has cyclomatic complexity 22 (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.
ChatOptionsExtensions.ToPromptExecutionSettings (cyclomatic 21) dotnet/src/SemanticKernel.Abstractions/AI/ChatClient/ChatOptionsExtensions.cs:17— ChatOptionsExtensions.ToPromptExecutionSettings 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.
KernelFunctionFromMethod.GetReturnValueMarshalerDelegate (cyclomatic 21) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:824— KernelFunctionFromMethod.GetReturnValueMarshalerDelegate has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
KernelFunctionFromMethod.GetConverter (cyclomatic 21) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:1053— KernelFunctionFromMethod.GetConverter has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 1068, 1054). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
KernelFunctionFromPrompt.CaptureUsageDetails (cyclomatic 21) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromPrompt.cs:646— KernelFunctionFromPrompt.CaptureUsageDetails has cyclomatic complexity 21 (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.
MCPPluginBase.sampling_callback (cyclomatic 21) python/semantic_kernel/connectors/mcp.py:384— MCPPluginBase.sampling_callback has cyclomatic complexity 21 (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.
StepActor.handle_message (cyclomatic 21) python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:281— StepActor.handle_message has cyclomatic complexity 21 (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.
GeminiChatCompletionClient.GetStreamingChatMessageContentsOrPopulateStateForToolCallingAsync (cyclomatic 20) dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:352— GeminiChatCompletionClient.GetStreamingChatMessageContentsOrPopulateStateForToolCallingAsync has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
MistralClient.ToMistralChatMessages (cyclomatic 20) dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:710— MistralClient.ToMistralChatMessages 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.
ProcessVisualizationExtensions.RenderProcess (cyclomatic 20) dotnet/src/Experimental/Process.Core/Tools/ProcessVisualizationExtensions.cs:60— ProcessVisualizationExtensions.RenderProcess has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
QdrantCollection._inner_search (cyclomatic 20) python/semantic_kernel/connectors/qdrant.py:269— QdrantCollection._inner_search 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.
LocalStep.handle_message (cyclomatic 20) python/semantic_kernel/processes/local_runtime/local_step.py:81— LocalStep.handle_message has cyclomatic complexity 20 (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.
ResponsesAgentThreadActions._create_reasoning_content_from_openai_item (cyclomatic 19) python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:926— ResponsesAgentThreadActions._create_reasoning_content_from_openai_item 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.
hf_text_completion._create_seq2seq_generator (cyclomatic 19) python/semantic_kernel/connectors/ai/hugging_face/services/hf_text_completion.py:70— hf_text_completion._create_seq2seq_generator 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.
RestApiOperation.get_server_url (cyclomatic 19) python/semantic_kernel/connectors/openapi_plugin/models/rest_api_operation.py:267— RestApiOperation.get_server_url 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.
ChatHistorySummarizationReducer.reduce (cyclomatic 19) python/semantic_kernel/contents/history_reducer/chat_history_summarization_reducer.py:86— ChatHistorySummarizationReducer.reduce 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.
KernelJsonSchemaBuilder.handle_complex_type (cyclomatic 19) python/semantic_kernel/schema/kernel_json_schema_builder.py:154— KernelJsonSchemaBuilder.handle_complex_type 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.
ChatMessageContentExtensions.ToChatMessage (cyclomatic 18) dotnet/src/SemanticKernel.Abstractions/Contents/ChatMessageContentExtensions.cs:14— ChatMessageContentExtensions.ToChatMessage 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.
YamlAgentDefinitionExtensions.NormalizeObject (cyclomatic 18) dotnet/src/Agents/Yaml/Extensions/YamlAgentDefinitionExtensions.cs:29— YamlAgentDefinitionExtensions.NormalizeObject 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.
GeminiRequest.TransformToOpenApi3Schema::TransformOpenApi3Object (cyclomatic 18) dotnet/src/Connectors/Connectors.Google/Core/Gemini/Models/GeminiRequest.cs:485— GeminiRequest.TransformToOpenApi3Schema::TransformOpenApi3Object 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.
WorkflowBuilder.BuildOrchestrationAsync (cyclomatic 18) dotnet/src/Experimental/Process.Core/Workflow/WorkflowBuilder.cs:222— WorkflowBuilder.BuildOrchestrationAsync 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.
CopilotAgentPluginKernelExtensions.CreatePluginFromCopilotAgentPluginAsync (cyclomatic 18) dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs:57— CopilotAgentPluginKernelExtensions.CreatePluginFromCopilotAgentPluginAsync has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
GoogleTextSearch.ApplyDefaultSearchParameters (cyclomatic 18) dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:452— GoogleTextSearch.ApplyDefaultSearchParameters 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.
AzureAIAgent._from_dict (cyclomatic 18) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:482— AzureAIAgent._from_dict 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.
BedrockAgent.get_response (cyclomatic 18) python/semantic_kernel/agents/bedrock/bedrock_agent.py:264— BedrockAgent.get_response 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.
OpenAIAssistantAgent._from_dict (cyclomatic 18) python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:439— OpenAIAssistantAgent._from_dict 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.
OpenAIRealtimeBase.update_session (cyclomatic 18) python/semantic_kernel/connectors/ai/open_ai/services/_open_ai_realtime.py:364— OpenAIRealtimeBase.update_session 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.
OpenAITextToImageBase.generate_image (cyclomatic 18) python/semantic_kernel/connectors/ai/open_ai/services/open_ai_text_to_image_base.py:23— OpenAITextToImageBase.generate_image 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.
OpenAITextToImageBase.edit_image (cyclomatic 18) python/semantic_kernel/connectors/ai/open_ai/services/open_ai_text_to_image_base.py:145— OpenAITextToImageBase.edit_image 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.
CosmosMongoCollection._get_index_definitions (cyclomatic 18) python/semantic_kernel/connectors/azure_cosmos_db.py:382— CosmosMongoCollection._get_index_definitions 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.
Kernel.add_embedding_to_object (cyclomatic 18) python/semantic_kernel/kernel.py:490— Kernel.add_embedding_to_object 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.
AzureClientCore.CreateChatCompletionOptions (cyclomatic 17) dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs:32— AzureClientCore.CreateChatCompletionOptions 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.
serialization.has_nested_base_model (cyclomatic 17) python/semantic_kernel/agents/runtime/core/serialization.py:71— serialization.has_nested_base_model 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.
_open_ai_realtime._create_openai_realtime_client_event (cyclomatic 17) python/semantic_kernel/connectors/ai/open_ai/services/_open_ai_realtime.py:161— _open_ai_realtime._create_openai_realtime_client_event 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.
ChromaCollection._unpack_results (cyclomatic 17) python/semantic_kernel/connectors/chroma.py:280— ChromaCollection._unpack_results 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.
chat_history_reducer_utils.extract_range (cyclomatic 17) python/semantic_kernel/contents/history_reducer/chat_history_reducer_utils.py:144— chat_history_reducer_utils.extract_range 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.
ProcessStepBuilder.build_step (cyclomatic 17) python/semantic_kernel/processes/process_step_builder.py:156— ProcessStepBuilder.build_step 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.
TemplateTokenizer.tokenize (cyclomatic 17) python/semantic_kernel/template_engine/template_tokenizer.py:28— TemplateTokenizer.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.
BedrockServiceFactory.CreateTextGenerationService (cyclomatic 16) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/BedrockServiceFactory.cs:43— BedrockServiceFactory.CreateTextGenerationService 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.
JMESUpdate.PerformOperation (cyclomatic 16) dotnet/src/InternalUtilities/process/Abstractions/DeclarativeConditionEvaluation.cs:378— JMESUpdate.PerformOperation 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.
LocalProcess.EnqueueEdgesAsync (cyclomatic 16) dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:396— LocalProcess.EnqueueEdgesAsync 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.
DeclarativeSpecMixin._normalize_spec_fields (cyclomatic 16) python/semantic_kernel/agents/agent.py:969— DeclarativeSpecMixin._normalize_spec_fields 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.
shared_utils._sanitize_node (cyclomatic 16) python/semantic_kernel/connectors/ai/google/shared_utils.py:72— shared_utils._sanitize_node 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.
OracleCollection.__init__ (cyclomatic 16) python/semantic_kernel/connectors/oracle.py:289— OracleCollection.__init__ 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.
PineconeCollection._inner_search (cyclomatic 16) python/semantic_kernel/connectors/pinecone.py:430— PineconeCollection._inner_search 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.
WeaviateCollection._inner_search (cyclomatic 16) python/semantic_kernel/connectors/weaviate.py:345— WeaviateCollection._inner_search 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.
WeaviateCollection.ensure_collection_exists (cyclomatic 16) python/semantic_kernel/connectors/weaviate.py:561— WeaviateCollection.ensure_collection_exists 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.
ChatHistory.from_rendered_prompt (cyclomatic 16) REDACTED:331— ChatHistory.from_rendered_prompt 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.
VectorStoreRecordHandler._deserialize_dict_to_data_model (cyclomatic 16) python/semantic_kernel/data/vector.py:1002— VectorStoreRecordHandler._deserialize_dict_to_data_model 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.
vector._parse_vector_store_record_field_instance (cyclomatic 16) python/semantic_kernel/data/vector.py:569— vector._parse_vector_store_record_field_instance 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.
StepActor.activate_step (cyclomatic 16) python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:187— StepActor.activate_step 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.
D10 · Test Quality· Depends on a live external host · ×1
Depends on a live external host: ValidateExpectedEmbeddingsForAllMiniLML6V2Async dotnet/src/IntegrationTests/Connectors/Onnx/BertOnnxTextEmbeddingGenerationServiceTests.cs:120— This test fetches `https://huggingface.co/optimum/all-MiniLM-L6-v2/resolve/1024484/model.onnx` while it runs, so it passes only while huggingface.co is up, reachable from the build machine, and still serving what this test expects — none of which this repository controls. It goes red on an aeroplane, behind a corporate proxy, in a sealed CI network, and on the day the third party edits that document. Serve the payload from the repository instead (a checked-in fixture file), or stub the transport; if the point really is to check the remote contract, move it out of the unit suite into a separately-scheduled integration job that is allowed to fail for someone else's reasons.
BareSuppressMessage repeated across 10 files dotnet/samples/Concepts/Agents/AzureAIAgent_Streaming.cs:188— The identical BareSuppressMessage (`System.Diagnostics.CodeAnalysis.SuppressMessage`) appears in 10 files (10 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 10 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
D17 · Explicit Debt· BarePragmaDisable repeated 22 times in 6 files · ×1
BarePragmaDisable repeated 22 times in 6 files dotnet/src/Connectors/Connectors.Google.UnitTests/Core/Gemini/Clients/GeminiChatGenerationFunctionCallingTests.cs:190— The identical BarePragmaDisable (`#pragma warning disable CA2000`) appears 22 times in 6 files — one decision applied repeatedly (e.g. the same rule silenced on every overload of a fluent API), not 22 independent debts. Decide it once — at the type or project level, or by fixing the underlying pattern — rather than occurrence-by-occurrence. (Every occurrence still counts toward the score and metrics.)
AgentThreadActions._process_stream_events (cognitive 165) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:582— AgentThreadActions._process_stream_events has cognitive complexity 165 (threshold 15). Drivers by points: if/else 26 (132 pts), loops 5 (18 pts), boolean chains 9, match/switch 1 (6 pts) (nesting depth added 124). 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.
FlowExecutor.ExecuteFlowAsync (cognitive 151) dotnet/src/Experimental/Orchestration.Flow/Execution/FlowExecutor.cs:165— FlowExecutor.ExecuteFlowAsync has cognitive complexity 151 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AssistantThreadActions.invoke_stream (cognitive 106) python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:371— AssistantThreadActions.invoke_stream has cognitive complexity 106 (threshold 15). Drivers by points: if/else 18 (79 pts), loops 5 (17 pts), boolean chains 9, ternaries 1 (nesting depth added 73). 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.
FlowExecutor.ExecuteStepAsync (cognitive 99) dotnet/src/Experimental/Orchestration.Flow/Execution/FlowExecutor.cs:605— FlowExecutor.ExecuteStepAsync has cognitive complexity 99 (threshold 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.
OracleCollection._lambda_parser (cognitive 95) python/semantic_kernel/connectors/oracle.py:1014— OracleCollection._lambda_parser has cognitive complexity 95 (threshold 15). Drivers by points: if/else 27 (60 pts), ternaries 5 (17 pts), loops 4 (10 pts), boolean chains 7, match/switch 1 (nesting depth added 51). 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.
AgentThreadActions.invoke (cognitive 80) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:109— AgentThreadActions.invoke has cognitive complexity 80 (threshold 15). Drivers by points: if/else 16 (48 pts), boolean chains 9, loops 4 (9 pts), match/switch 2 (8 pts), ternaries 2 (6 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.
MistralClient.GetChatMessageContentsAsync (cognitive 73) dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:49— MistralClient.GetChatMessageContentsAsync has cognitive complexity 73 (threshold 15). Of this number, 70 points are the body's own statements and 3 belong to one function literal inside it that branches. 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.
CodeTokenizer.Tokenize (cognitive 71) dotnet/src/SemanticKernel.Core/TemplateEngine/CodeTokenizer.cs:53— CodeTokenizer.Tokenize has cognitive complexity 71 (threshold 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.
PromptExecutionSettingsExtensions.ToChatOptions (cognitive 70) dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettingsExtensions.cs:18— PromptExecutionSettingsExtensions.ToChatOptions has cognitive complexity 70 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function. This shape REPEATS in the file: one other method here (PromptExecutionSettingsExtensions.ToChatOptions::TryConvert) 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.
MistralClient.GetStreamingChatMessageContentsAsync (cognitive 68) dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:267— MistralClient.GetStreamingChatMessageContentsAsync has cognitive complexity 68 (threshold 15). Of this number, 65 points are the body's own statements and 3 belong to one function literal inside it that branches. 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.
Program.Main (cognitive 67) dotnet/samples/Demos/OpenAIRealtime/Program.cs:24— Program.Main has cognitive complexity 67 (threshold 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.
AssistantThreadActions.InvokeStreamingAsync (cognitive 66) dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:353— AssistantThreadActions.InvokeStreamingAsync has cognitive complexity 66 (threshold 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.
ResponsesAgentThreadActions.invoke_stream (cognitive 63) python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:289— ResponsesAgentThreadActions.invoke_stream has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (48 pts), ternaries 3 (6 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 36). 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.
OpenAIRealtimeBase.send (cognitive 63) python/semantic_kernel/connectors/ai/open_ai/services/_open_ai_realtime.py:524— OpenAIRealtimeBase.send has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 7 (23 pts), if/else 7 (21 pts), match/switch 3 (7 pts), boolean chains 6, error handling 1 (3 pts), loops 1 (3 pts) (nesting depth added 38). 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.
AssistantThreadActions.InvokeAsync (cognitive 62) dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:114— AssistantThreadActions.InvokeAsync has cognitive complexity 62 (threshold 15). Of this number, 61 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
TemplateTokenizer.Tokenize (cognitive 61) dotnet/src/SemanticKernel.Core/TemplateEngine/TemplateTokenizer.cs:40— TemplateTokenizer.Tokenize has cognitive complexity 61 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AgentThreadActions.InvokeAsync (cognitive 61) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:136— AgentThreadActions.InvokeAsync has cognitive complexity 61 (threshold 15). Of this number, 60 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
GeminiRequest.TransformToOpenApi3Schema::TransformOpenApi3Object (cognitive 59) dotnet/src/Connectors/Connectors.Google/Core/Gemini/Models/GeminiRequest.cs:485— GeminiRequest.TransformToOpenApi3Schema::TransformOpenApi3Object has cognitive complexity 59 (threshold 15). Drivers by points: if/else 11 (42 pts), loops 2 (12 pts), boolean chains 5 (nesting depth added 41). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AgentThreadActions.InvokeStreamingAsync (cognitive 58) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:371— AgentThreadActions.InvokeStreamingAsync has cognitive complexity 58 (threshold 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.
KernelFunctionFromPrompt.InvokeStreamingCoreAsync (cognitive 57) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromPrompt.cs:275— KernelFunctionFromPrompt.InvokeStreamingCoreAsync has cognitive complexity 57 (threshold 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.
ClientCore.GetStreamingChatMessageContentsAsync (cognitive 57) dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:227— ClientCore.GetStreamingChatMessageContentsAsync has cognitive complexity 57 (threshold 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.
AssistantThreadActions.invoke (cognitive 56) python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:137— AssistantThreadActions.invoke has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (40 pts), boolean chains 8, loops 3 (7 pts), ternaries 1 (nesting depth added 30). 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.
ClientCore.CreateRequestMessages (cognitive 54) dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:730— ClientCore.CreateRequestMessages has cognitive complexity 54 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
GeminiChatCompletionClient.GetStreamingChatMessageContentsOrPopulateStateForToolCallingAsync (cognitive 53) dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:352— GeminiChatCompletionClient.GetStreamingChatMessageContentsOrPopulateStateForToolCallingAsync has cognitive complexity 53 (threshold 15). Of this number, 50 points are the body's own statements and 3 belong to one function literal inside it that branches. 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.
ResponsesAgentThreadActions._prepare_chat_history_for_request (cognitive 53) python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:766— ResponsesAgentThreadActions._prepare_chat_history_for_request has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (38 pts), ternaries 2 (9 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 35). 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.
YamlAgentDefinitionExtensions.NormalizeObject (cognitive 50) dotnet/src/Agents/Yaml/Extensions/YamlAgentDefinitionExtensions.cs:29— YamlAgentDefinitionExtensions.NormalizeObject has cognitive complexity 50 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AzureAISearchCollection._inner_search (cognitive 50) python/semantic_kernel/connectors/azure_ai_search.py:546— AzureAISearchCollection._inner_search has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 9 (24 pts), if/else 12 (19 pts), boolean chains 5, error handling 1, match/switch 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.
kernel_function_decorator._parse_parameter (cognitive 50) python/semantic_kernel/functions/kernel_function_decorator.py:135— kernel_function_decorator._parse_parameter has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (42 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 27). 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.
InProcessRuntime._process_next (cognitive 47) python/semantic_kernel/agents/runtime/in_process/in_process_runtime.py:528— InProcessRuntime._process_next has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (21 pts), error handling 4 (13 pts), loops 3 (9 pts), boolean chains 3, match/switch 1 (nesting depth added 28). 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.
RedisCollection._lambda_parser (cognitive 46) python/semantic_kernel/connectors/redis.py:366— RedisCollection._lambda_parser has cognitive complexity 46 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 4 (14 pts), loops 3 (9 pts), match/switch 4 (9 pts) (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.
FunctionResult.GetValue (cognitive 45) dotnet/src/SemanticKernel.Abstractions/Functions/FunctionResult.cs:83— FunctionResult.GetValue has cognitive complexity 45 (threshold 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.
VectorStoreCollection.get (cognitive 45) python/semantic_kernel/data/vector.py:1414— VectorStoreCollection.get has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (33 pts), error handling 3 (5 pts), loops 1 (5 pts), boolean chains 1, ternaries 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.
CodeTokenizer.tokenize (cognitive 45) python/semantic_kernel/template_engine/code_tokenizer.py:29— CodeTokenizer.tokenize has cognitive complexity 45 (threshold 15). Drivers by points: if/else 21 (42 pts), boolean chains 1, loops 1, ternaries 1 (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.
ProcessVisualizationExtensions.RenderProcess (cognitive 40) dotnet/src/Experimental/Process.Core/Tools/ProcessVisualizationExtensions.cs:60— ProcessVisualizationExtensions.RenderProcess has cognitive complexity 40 (threshold 15). Of this number, 38 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
ChatCompletionClientBase.get_streaming_chat_message_contents (cognitive 39) python/semantic_kernel/connectors/ai/chat_completion_client_base.py:196— ChatCompletionClientBase.get_streaming_chat_message_contents has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 5 (10 pts), boolean chains 3 (nesting depth added 18). 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.
azure_ai_search._definition_to_azure_ai_search_index (cognitive 38) python/semantic_kernel/connectors/azure_ai_search.py:210— azure_ai_search._definition_to_azure_ai_search_index has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 11, ternaries 1 (3 pts), loops 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.
chat_history_reducer_utils.extract_range (cognitive 38) python/semantic_kernel/contents/history_reducer/chat_history_reducer_utils.py:144— chat_history_reducer_utils.extract_range has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 20). 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.
vector._parse_vector_store_record_field_instance (cognitive 36) python/semantic_kernel/data/vector.py:569— vector._parse_vector_store_record_field_instance has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 5, loops 1 (5 pts), ternaries 1 (2 pts) (nesting depth added 21). 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.
MistralClient.ToMistralChatMessages (cognitive 35) dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:710— MistralClient.ToMistralChatMessages has cognitive complexity 35 (threshold 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.
ResponsesAgentThreadActions.invoke (cognitive 35) python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:87— ResponsesAgentThreadActions.invoke has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (2 pts), ternaries 2 (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.
BedrockAgent.get_response (cognitive 34) python/semantic_kernel/agents/bedrock/bedrock_agent.py:264— BedrockAgent.get_response has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 17). 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.
ProcessStepBuilder.build_step (cognitive 34) python/semantic_kernel/processes/process_step_builder.py:156— ProcessStepBuilder.build_step has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 3 (9 pts), error handling 1 (4 pts), boolean chains 3 (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.
KernelFunctionFromMethod.GetParameterMarshalerDelegate (cognitive 33) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:614— KernelFunctionFromMethod.GetParameterMarshalerDelegate has cognitive complexity 33 (threshold 15). Of this number, 27 points are the body's own statements and 6 belong to one function literal inside it that branches. 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.
InMemoryCollection._parse_and_validate_filter (cognitive 33) python/semantic_kernel/connectors/in_memory.py:743— InMemoryCollection._parse_and_validate_filter has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 6, error handling 1, 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.
ChatOptionsExtensions.ToPromptExecutionSettings (cognitive 32) dotnet/src/SemanticKernel.Abstractions/AI/ChatClient/ChatOptionsExtensions.cs:17— ChatOptionsExtensions.ToPromptExecutionSettings has cognitive complexity 32 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
WorkflowBuilder.BuildOrchestrationAsync (cognitive 32) dotnet/src/Experimental/Process.Core/Workflow/WorkflowBuilder.cs:222— WorkflowBuilder.BuildOrchestrationAsync has cognitive complexity 32 (threshold 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.
AzureOpenAIConfigBase.__init__ (cognitive 32) python/semantic_kernel/connectors/ai/open_ai/services/azure_config_base.py:28— AzureOpenAIConfigBase.__init__ has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 5, ternaries 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.
Kernel.invoke_function_call (cognitive 32) python/semantic_kernel/kernel.py:326— Kernel.invoke_function_call has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 8, ternaries 4 (5 pts), error handling 2 (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.
ChatMessageContentExtensions.ToChatMessage (cognitive 31) dotnet/src/SemanticKernel.Abstractions/Contents/ChatMessageContentExtensions.cs:14— ChatMessageContentExtensions.ToChatMessage has cognitive complexity 31 (threshold 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.
OrderedAIServiceSelector.TrySelect (cognitive 31) dotnet/src/SemanticKernel.Abstractions/Services/OrderedAIServiceSelector.cs:29— OrderedAIServiceSelector.TrySelect has cognitive complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
ResponseThreadActions.InvokeStreamingAsync (cognitive 31) dotnet/src/Agents/OpenAI/Internal/ResponseThreadActions.cs:120— ResponseThreadActions.InvokeStreamingAsync has cognitive complexity 31 (threshold 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.
agent_content_generation.generate_streaming_code_interpreter_content (cognitive 31) python/semantic_kernel/agents/azure_ai/agent_content_generation.py:791— agent_content_generation.generate_streaming_code_interpreter_content has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 2 (5 pts), boolean chains 2, ternaries 2 (nesting depth added 18). 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.
KernelJsonSchemaBuilder.handle_complex_type (cognitive 31) python/semantic_kernel/schema/kernel_json_schema_builder.py:154— KernelJsonSchemaBuilder.handle_complex_type has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (26 pts), ternaries 1 (3 pts), boolean chains 2 (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.
A2AAgent.InvokeAgentAsync (cognitive 30) dotnet/src/Agents/A2A/A2AAgent.cs:147— A2AAgent.InvokeAgentAsync has cognitive complexity 30 (threshold 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.
MagenticManagerActor.ManageAsync (cognitive 30) dotnet/src/Agents/Magentic/MagenticManagerActor.cs:84— MagenticManagerActor.ManageAsync has cognitive complexity 30 (threshold 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.
KernelProcessStateMetadataExtension.SanitizeProcessStateMetadata (cognitive 30) dotnet/src/Experimental/Process.Core/Internal/KernelProcessStateMetadataExtension.cs:36— KernelProcessStateMetadataExtension.SanitizeProcessStateMetadata has cognitive complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ApiManifestKernelExtensions.CreatePluginFromApiManifestAsync (cognitive 30) dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:93— ApiManifestKernelExtensions.CreatePluginFromApiManifestAsync has cognitive complexity 30 (threshold 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.
CopilotAgentPluginKernelExtensions.CreatePluginFromCopilotAgentPluginAsync (cognitive 30) dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs:57— CopilotAgentPluginKernelExtensions.CreatePluginFromCopilotAgentPluginAsync has cognitive complexity 30 (threshold 15). Of this number, 27 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
agent_content_generation.generate_streaming_message_content (cognitive 30) python/semantic_kernel/agents/azure_ai/agent_content_generation.py:158— agent_content_generation.generate_streaming_message_content has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (6 pts), boolean chains 4, ternaries 1 (nesting depth added 17). 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.
assistant_content_generation.generate_streaming_message_content (cognitive 30) python/semantic_kernel/agents/open_ai/assistant_content_generation.py:174— assistant_content_generation.generate_streaming_message_content has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 2 (6 pts), boolean chains 4, ternaries 2 (nesting depth added 17). 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.
WeaviateCollection._lambda_parser (cognitive 29) python/semantic_kernel/connectors/weaviate.py:407— WeaviateCollection._lambda_parser has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 1 (4 pts), loops 1 (3 pts), match/switch 2 (3 pts), boolean chains 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.
DeclarativeEventHandlerGroupBuilder.DeclarativeEventHandlerGroupBuilder.ctor (cognitive 28) dotnet/src/Experimental/Process.Core/ProcessAgentBuilder.cs:268— DeclarativeEventHandlerGroupBuilder.DeclarativeEventHandlerGroupBuilder.ctor has cognitive complexity 28 (threshold 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.
CosmosMongoCollection._get_index_definitions (cognitive 28) python/semantic_kernel/connectors/azure_cosmos_db.py:382— CosmosMongoCollection._get_index_definitions has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 5, match/switch 1 (2 pts), 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.
PineconeCollection._lambda_parser (cognitive 28) python/semantic_kernel/connectors/pinecone.py:496— PineconeCollection._lambda_parser has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 3 (5 pts), ternaries 1 (4 pts), loops 1 (3 pts), boolean chains 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.
BraveTextSearch.CheckQueryValidation (cognitive 27) dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:700— BraveTextSearch.CheckQueryValidation has cognitive complexity 27 (threshold 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.
assistant_content_generation.generate_streaming_code_interpreter_content (cognitive 27) python/semantic_kernel/agents/open_ai/assistant_content_generation.py:456— assistant_content_generation.generate_streaming_code_interpreter_content has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 2 (5 pts), boolean chains 2, ternaries 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.
serialization.has_nested_base_model (cognitive 27) python/semantic_kernel/agents/runtime/core/serialization.py:71— serialization.has_nested_base_model has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 8, loops 3 (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.
AzureAISearchCollection._lambda_parser (cognitive 27) python/semantic_kernel/connectors/azure_ai_search.py:636— AzureAISearchCollection._lambda_parser has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 3 (5 pts), loops 1 (3 pts), ternaries 1 (2 pts) (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.
ChromaCollection._lambda_parser (cognitive 27) python/semantic_kernel/connectors/chroma.py:365— ChromaCollection._lambda_parser has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 1 (4 pts), loops 1 (3 pts), match/switch 2 (3 pts), boolean chains 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.
StepActor.activate_step (cognitive 27) python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:187— StepActor.activate_step has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (17 pts), error handling 2 (6 pts), ternaries 2, 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.
ResponsesAgentThreadActions._create_reasoning_content_from_openai_item (cognitive 26) python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:926— ResponsesAgentThreadActions._create_reasoning_content_from_openai_item has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, error handling 2 (4 pts), loops 2 (4 pts), ternaries 2 (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.
shared_utils._sanitize_node (cognitive 26) python/semantic_kernel/connectors/ai/google/shared_utils.py:72— shared_utils._sanitize_node has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 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.
OpenApiParser.create_rest_api_operations (cognitive 26) python/semantic_kernel/connectors/openapi_plugin/openapi_parser.py:209— OpenApiParser.create_rest_api_operations has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (5 pts), boolean chains 4 (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.
QdrantCollection._inner_search (cognitive 26) python/semantic_kernel/connectors/qdrant.py:269— QdrantCollection._inner_search has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5, ternaries 4 (5 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.
TemplateTokenizer.tokenize (cognitive 26) python/semantic_kernel/template_engine/template_tokenizer.py:28— TemplateTokenizer.tokenize has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4, 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.
KernelFunctionFromMethod.GetReturnValueMarshalerDelegate (cognitive 25) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:824— KernelFunctionFromMethod.GetReturnValueMarshalerDelegate has cognitive complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
JMESUpdate.PerformOperation (cognitive 25) dotnet/src/InternalUtilities/process/Abstractions/DeclarativeConditionEvaluation.cs:378— JMESUpdate.PerformOperation has cognitive complexity 25 (threshold 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.
LocalProcess.EnqueueEdgesAsync (cognitive 25) dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:396— LocalProcess.EnqueueEdgesAsync has cognitive complexity 25 (threshold 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.
BedrockAgent.invoke_stream (cognitive 25) python/semantic_kernel/agents/bedrock/bedrock_agent.py:465— BedrockAgent.invoke_stream has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (3 pts), boolean chains 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.
QdrantCollection.ensure_collection_exists (cognitive 25) python/semantic_kernel/connectors/qdrant.py:481— QdrantCollection.ensure_collection_exists has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 3, loops 1 (3 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.
Kernel.invoke_stream (cognitive 25) python/semantic_kernel/kernel.py:104— Kernel.invoke_stream has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (6 pts), boolean chains 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.
Kernel.add_embedding_to_object (cognitive 25) python/semantic_kernel/kernel.py:490— Kernel.add_embedding_to_object has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 3 (5 pts), boolean chains 2 (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.
ProcessBuilder._sanitize_process_state_metadata (cognitive 25) python/semantic_kernel/processes/process_builder.py:201— ProcessBuilder._sanitize_process_state_metadata has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 3, loops 1 (nesting depth added 13). 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.
TextChunker.Split (cognitive 24) dotnet/src/SemanticKernel.Core/Text/TextChunker.cs:283— TextChunker.Split has cognitive complexity 24 (threshold 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.
PublicNetworkAddressValidator.TryClassifyIPv4 (cognitive 24) dotnet/src/InternalUtilities/src/Http/PublicNetworkAddressValidator.cs:133— PublicNetworkAddressValidator.TryClassifyIPv4 has cognitive complexity 24 (threshold 15). 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.
OpenAIRealtimeBase.update_session (cognitive 24) python/semantic_kernel/connectors/ai/open_ai/services/_open_ai_realtime.py:364— OpenAIRealtimeBase.update_session has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 2 (5 pts), match/switch 1 (4 pts), boolean chains 3 (nesting depth added 8). 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.
ChatHistory.from_rendered_prompt (cognitive 24) REDACTED:331— ChatHistory.from_rendered_prompt has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, loops 2 (4 pts), error handling 1 (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.
AgentToolDefinitionExtensions.CreateParameterSpec (cognitive 23) dotnet/src/Agents/AzureAI/Extensions/AgentToolDefinitionExtensions.cs:31— AgentToolDefinitionExtensions.CreateParameterSpec has cognitive complexity 23 (threshold 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.
JMESUpdate.UpdateJsonElement (cognitive 23) dotnet/src/InternalUtilities/process/Abstractions/DeclarativeConditionEvaluation.cs:307— JMESUpdate.UpdateJsonElement has cognitive complexity 23 (threshold 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.
ChromaCollection._unpack_results (cognitive 23) python/semantic_kernel/connectors/chroma.py:280— ChromaCollection._unpack_results has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, ternaries 2 (4 pts), loops 2 (3 pts), error handling 1 (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.
FaissCollection._create_indexes (cognitive 23) python/semantic_kernel/connectors/faiss.py:112— FaissCollection._create_indexes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 2, loops 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.
KernelFunctionFromMethod.gather_function_parameters (cognitive 23) python/semantic_kernel/functions/kernel_function_from_method.py:152— KernelFunctionFromMethod.gather_function_parameters has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 1 (4 pts), boolean chains 1, 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.
StepActor.handle_message (cognitive 23) python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:281— StepActor.handle_message has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 4, error handling 1, loops 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.
TypeConverterFactory.GetTypeConverter (cognitive 22) dotnet/src/InternalUtilities/src/System/TypeConverterFactory.cs:22— TypeConverterFactory.GetTypeConverter has cognitive complexity 22 (threshold 15). 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.
AzureAIAgent._from_dict (cognitive 22) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:482— AzureAIAgent._from_dict has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, ternaries 2 (3 pts), error handling 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.
BedrockAgent.invoke (cognitive 22) python/semantic_kernel/agents/bedrock/bedrock_agent.py:361— BedrockAgent.invoke has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (6 pts), boolean chains 2 (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.
AgentGroupChat.invoke (cognitive 22) python/semantic_kernel/agents/group_chat/agent_group_chat.py:116— AgentGroupChat.invoke has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 pts), error handling 1 (2 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.
OpenAIAssistantAgent._from_dict (cognitive 22) python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:439— OpenAIAssistantAgent._from_dict has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1, 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.
OpenAIResponsesAgent.__init__ (cognitive 22) python/semantic_kernel/agents/open_ai/openai_responses_agent.py:287— OpenAIResponsesAgent.__init__ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 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.
AnthropicChatCompletion._prepare_chat_history_for_request (cognitive 22) python/semantic_kernel/connectors/ai/anthropic/services/anthropic_chat_completion.py:194— AnthropicChatCompletion._prepare_chat_history_for_request has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, ternaries 1 (2 pts), 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.
utils.format_assistant_message (cognitive 22) python/semantic_kernel/connectors/ai/google/google_ai/services/utils.py:80— utils.format_assistant_message has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 3 (11 pts), if/else 5 (10 pts), 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.
utils.phi4mm_template (cognitive 22) python/semantic_kernel/connectors/ai/onnx/utils.py:119— utils.phi4mm_template has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (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.
CosmosNoSqlCollection._inner_search (cognitive 22) python/semantic_kernel/connectors/azure_cosmos_db.py:775— CosmosNoSqlCollection._inner_search has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (5 pts), ternaries 2 (4 pts), boolean chains 1, error handling 1 (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.
mcp.create_mcp_server_from_kernel (cognitive 22) python/semantic_kernel/connectors/mcp.py:1041— mcp.create_mcp_server_from_kernel has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (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.
MongoDBAtlasCollection._lambda_parser (cognitive 22) python/semantic_kernel/connectors/mongodb.py:445— MongoDBAtlasCollection._lambda_parser has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (5 pts), ternaries 1 (4 pts), loops 1 (3 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.
RestApiOperation.get_server_url (cognitive 22) python/semantic_kernel/connectors/openapi_plugin/models/rest_api_operation.py:267— RestApiOperation.get_server_url has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, ternaries 2 (4 pts), loops 1 (2 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.
QdrantCollection._lambda_parser (cognitive 22) python/semantic_kernel/connectors/qdrant.py:367— QdrantCollection._lambda_parser has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (5 pts), ternaries 1 (4 pts), loops 1 (3 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.
VectorStoreRecordHandler._deserialize_dict_to_data_model (cognitive 22) python/semantic_kernel/data/vector.py:1002— VectorStoreRecordHandler._deserialize_dict_to_data_model has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 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.
Kernel.invoke_prompt_stream (cognitive 22) python/semantic_kernel/kernel.py:257— Kernel.invoke_prompt_stream has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (6 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.
LocalStep.handle_message (cognitive 22) python/semantic_kernel/processes/local_runtime/local_step.py:81— LocalStep.handle_message has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4, error handling 1, loops 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.
AzureClientCore.GetResponseModalities (cognitive 21) dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs:144— AzureClientCore.GetResponseModalities has cognitive complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
DeclarativeSpecMixin._normalize_spec_fields (cognitive 21) python/semantic_kernel/agents/agent.py:969— DeclarativeSpecMixin._normalize_spec_fields has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (3 pts), boolean chains 2, ternaries 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.
ChatCompletionAgent.invoke_stream (cognitive 21) python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:376— ChatCompletionAgent.invoke_stream has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (7 pts), boolean chains 3, ternaries 1 (2 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.
CopilotStudioAgent._inner_invoke (cognitive 21) python/semantic_kernel/agents/copilot_studio/copilot_studio_agent.py:490— CopilotStudioAgent._inner_invoke has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (5 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.
AssistantThreadActions.get_messages (cognitive 21) python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:616— AssistantThreadActions.get_messages has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 4, loops 2 (3 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.
OpenAIResponsesAgent.configure_response_format (cognitive 21) python/semantic_kernel/agents/open_ai/openai_responses_agent.py:728— OpenAIResponsesAgent.configure_response_format 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.
MCPPluginBase.sampling_callback (cognitive 21) python/semantic_kernel/connectors/mcp.py:384— MCPPluginBase.sampling_callback has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 2, loops 2, error handling 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.
StreamingContentMixin._merge_items_lists (cognitive 21) python/semantic_kernel/contents/streaming_content_mixin.py:34— StreamingContentMixin._merge_items_lists has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 1 (5 pts), loops 2 (5 pts), boolean chains 2 (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.
public_network_address_validator._try_classify_ipv4 (cognitive 21) python/semantic_kernel/utils/public_network_address_validator.py:106— public_network_address_validator._try_classify_ipv4 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, boolean chains 8. 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.
FunctionChoiceBehavior.GetFunctions (cognitive 20) dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehavior.cs:115— FunctionChoiceBehavior.GetFunctions has cognitive complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
agent_content_generation.generate_streaming_openapi_content (cognitive 20) python/semantic_kernel/agents/azure_ai/agent_content_generation.py:740— agent_content_generation.generate_streaming_openapi_content has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5 (8 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.
hf_text_completion._create_seq2seq_generator (cognitive 20) python/semantic_kernel/connectors/ai/hugging_face/services/hf_text_completion.py:70— hf_text_completion._create_seq2seq_generator has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 3, loops 2 (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.
OracleCollection.__init__ (cognitive 20) python/semantic_kernel/connectors/oracle.py:289— OracleCollection.__init__ has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (5 pts), ternaries 2 (4 pts), error handling 1 (2 pts), loops 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.
PineconeCollection._inner_search (cognitive 20) python/semantic_kernel/connectors/pinecone.py:430— PineconeCollection._inner_search has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 2 (5 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.
WeaviateCollection.ensure_collection_exists (cognitive 20) python/semantic_kernel/connectors/weaviate.py:561— WeaviateCollection.ensure_collection_exists has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 4 (6 pts), boolean chains 5, 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.
LocalStep.initialize_step (cognitive 20) python/semantic_kernel/processes/local_runtime/local_step.py:188— LocalStep.initialize_step has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 1 (3 pts), ternaries 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.
FunctionCallsProcessor.ProcessFunctionCallsAsync (cognitive 19) dotnet/src/InternalUtilities/connectors/AI/FunctionCalling/FunctionCallsProcessor.cs:135— FunctionCallsProcessor.ProcessFunctionCallsAsync has cognitive complexity 19 (threshold 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.
BedrockAgentInvokeExtensions.InternalInvokeAsync (cognitive 19) dotnet/src/Agents/Bedrock/Extensions/BedrockAgentInvokeExtensions.cs:23— BedrockAgentInvokeExtensions.InternalInvokeAsync has cognitive complexity 19 (threshold 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.
AzureClientCore.CreateChatCompletionOptions (cognitive 19) dotnet/src/Connectors/Connectors.AzureOpenAI/Core/AzureClientCore.ChatCompletion.cs:32— AzureClientCore.CreateChatCompletionOptions has cognitive complexity 19 (threshold 15). 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.
OpenAIFunction.GetSanitizedSchemaForStrictMode (cognitive 19) dotnet/src/Connectors/Connectors.OpenAI/Core/OpenAIFunction.cs:237— OpenAIFunction.GetSanitizedSchemaForStrictMode has cognitive 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.
MapActor.HandleMessageAsync (cognitive 19) dotnet/src/Experimental/Process.Runtime.Dapr/Actors/MapActor.cs:86— MapActor.HandleMessageAsync has cognitive complexity 19 (threshold 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.
BingTextSearch.ProcessEqualityExpression (cognitive 19) dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:237— BingTextSearch.ProcessEqualityExpression has cognitive complexity 19 (threshold 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.
BraveTextSearch.ProcessMethodCallClause (cognitive 19) dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs:284— BraveTextSearch.ProcessMethodCallClause has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TavilyTextSearch.ProcessMethodCallClause (cognitive 19) dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs:281— TavilyTextSearch.ProcessMethodCallClause has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AgentGroupChat.invoke_stream (cognitive 19) python/semantic_kernel/agents/group_chat/agent_group_chat.py:165— AgentGroupChat.invoke_stream has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (5 pts), error handling 1 (2 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.
OpenAITextToImageBase.generate_image (cognitive 19) python/semantic_kernel/connectors/ai/open_ai/services/open_ai_text_to_image_base.py:23— OpenAITextToImageBase.generate_image has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 6 (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.
AzureAISearchCollection._inner_get (cognitive 19) python/semantic_kernel/connectors/azure_ai_search.py:457— AzureAISearchCollection._inner_get has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (4 pts), loops 1 (3 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.
openapi_manager.create_functions_from_openapi (cognitive 19) python/semantic_kernel/connectors/openapi_plugin/openapi_manager.py:32— openapi_manager.create_functions_from_openapi has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 5 (7 pts), error handling 1 (2 pts), boolean chains 1, 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.
WeaviateCollection._inner_search (cognitive 19) python/semantic_kernel/connectors/weaviate.py:345— WeaviateCollection._inner_search has cognitive complexity 19 (threshold 15). Drivers by points: error handling 4 (6 pts), if/else 5 (6 pts), ternaries 3 (4 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.
ChatHistorySummarizationReducer.reduce (cognitive 19) python/semantic_kernel/contents/history_reducer/chat_history_summarization_reducer.py:86— ChatHistorySummarizationReducer.reduce has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, ternaries 3, error handling 1 (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.
VectorStoreRecordHandler._add_embedding_to_object (cognitive 19) python/semantic_kernel/data/vector.py:1085— VectorStoreRecordHandler._add_embedding_to_object has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 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.
KernelFilterExtension.remove_filter (cognitive 19) python/semantic_kernel/filters/kernel_filters_extension.py:73— KernelFilterExtension.remove_filter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (5 pts), boolean chains 2 (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.
KernelPlugin.from_directory (cognitive 19) python/semantic_kernel/functions/kernel_plugin.py:253— KernelPlugin.from_directory has cognitive complexity 19 (threshold 15). Drivers by points: error handling 3 (9 pts), if/else 5 (8 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.
KernelParameterMetadata.InferSchema (cognitive 18) dotnet/src/SemanticKernel.Abstractions/Functions/KernelParameterMetadata.cs:156— KernelParameterMetadata.InferSchema has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
DataUriParser.Parse (cognitive 18) dotnet/src/InternalUtilities/src/Text/DataUriParser.cs:74— DataUriParser.Parse has cognitive complexity 18 (threshold 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.
KernelFunctionFromMethod.GetConverter (cognitive 18) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs:1053— KernelFunctionFromMethod.GetConverter has cognitive complexity 18 (threshold 15). None of this is in the body itself: all 18 points belong to 2 function literals inside it that branch (lines 1068, 1054). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
KernelFunctionFromPrompt.RenderPromptAsync (cognitive 18) dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromPrompt.cs:554— KernelFunctionFromPrompt.RenderPromptAsync has cognitive complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
BedrockServiceFactory.CreateTextGenerationService (cognitive 18) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/BedrockServiceFactory.cs:43— BedrockServiceFactory.CreateTextGenerationService has cognitive complexity 18 (threshold 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.
GeminiChatCompletionClient.StreamGenerateChatMessageAsync (cognitive 18) dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:231— GeminiChatCompletionClient.StreamGenerateChatMessageAsync has cognitive complexity 18 (threshold 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.
ClientCore.GetFunctionCallContents (cognitive 18) dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:1042— ClientCore.GetFunctionCallContents has cognitive complexity 18 (threshold 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.
LocalProcess.InitializeProcessAsync (cognitive 18) dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:205— LocalProcess.InitializeProcessAsync has cognitive complexity 18 (threshold 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.
GrpcOperationRunner.GetAddress (cognitive 18) dotnet/src/Functions/Functions.Grpc/GrpcOperationRunner.cs:159— GrpcOperationRunner.GetAddress has cognitive complexity 18 (threshold 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.
OrchestrationHandoffs.add_many (cognitive 18) python/semantic_kernel/agents/orchestration/handoffs.py:93— OrchestrationHandoffs.add_many has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (12 pts), loops 2 (4 pts), boolean chains 1, if/else 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.
ChatCompletionClientBase.get_chat_message_contents (cognitive 18) python/semantic_kernel/connectors/ai/chat_completion_client_base.py:85— ChatCompletionClientBase.get_chat_message_contents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, 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.
utils.phi3v_template (cognitive 18) python/semantic_kernel/connectors/ai/onnx/utils.py:91— utils.phi3v_template has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (4 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.
sql_server._build_search_query (cognitive 18) python/semantic_kernel/connectors/sql_server.py:1095— sql_server._build_search_query has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 1 (2 pts), ternaries 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.
WeaviateCollection._deserialize_store_models_to_dicts (cognitive 18) python/semantic_kernel/connectors/weaviate.py:536— WeaviateCollection._deserialize_store_models_to_dicts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, 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.
chat_history_reducer_utils.get_call_result_pairs (cognitive 18) python/semantic_kernel/contents/history_reducer/chat_history_reducer_utils.py:19— chat_history_reducer_utils.get_call_result_pairs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 4 (6 pts), boolean chains 2 (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.
LocalProcess.internal_execute (cognitive 18) python/semantic_kernel/processes/local_runtime/local_process.py:191— LocalProcess.internal_execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 4 (7 pts), boolean chains 2, error handling 1 (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.
AIServiceSelector.select_ai_service (cognitive 18) python/semantic_kernel/services/ai_service_selector.py:24— AIServiceSelector.select_ai_service has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1, ternaries 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.
AgentMessageFactory.GetMessageContent (cognitive 17) dotnet/src/Agents/AzureAI/Internal/AgentMessageFactory.cs:57— AgentMessageFactory.GetMessageContent has cognitive complexity 17 (threshold 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.
FileIOPlugin.TryGetAllowedFilePath (cognitive 17) dotnet/src/Plugins/Plugins.Core/FileIOPlugin.cs:113— FileIOPlugin.TryGetAllowedFilePath has cognitive complexity 17 (threshold 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.
BraveConnector.SearchAsync (cognitive 17) dotnet/src/Plugins/Plugins.Web/Brave/BraveConnector.cs:58— BraveConnector.SearchAsync has cognitive complexity 17 (threshold 15). 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.
GoogleTextSearch.ApplyDefaultSearchParameters (cognitive 17) dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs:452— GoogleTextSearch.ApplyDefaultSearchParameters has cognitive complexity 17 (threshold 15). 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.
agent_content_generation.get_message_contents (cognitive 17) python/semantic_kernel/agents/azure_ai/agent_content_generation.py:69— agent_content_generation.get_message_contents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (5 pts), 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.
agent_content_generation.generate_streaming_azure_ai_search_content (cognitive 17) python/semantic_kernel/agents/azure_ai/agent_content_generation.py:598— agent_content_generation.generate_streaming_azure_ai_search_content has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (7 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.
assistant_content_generation.get_message_contents (cognitive 17) python/semantic_kernel/agents/open_ai/assistant_content_generation.py:87— assistant_content_generation.get_message_contents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (5 pts), 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.
OpenAIResponsesAgent.invoke_stream (cognitive 17) python/semantic_kernel/agents/open_ai/openai_responses_agent.py:1063— OpenAIResponsesAgent.invoke_stream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), boolean chains 2, ternaries 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.
GoogleAIChatCompletion._create_streaming_chat_message_content (cognitive 17) python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:344— GoogleAIChatCompletion._create_streaming_chat_message_content has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 1 (4 pts), boolean chains 3, loops 1 (2 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.
AzureChatCompletion.split_message (cognitive 17) python/semantic_kernel/connectors/ai/open_ai/services/azure_chat_completion.py:201— AzureChatCompletion.split_message has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 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.
MCPPluginBase._inner_connect (cognitive 17) python/semantic_kernel/connectors/mcp.py:323— MCPPluginBase._inner_connect has cognitive complexity 17 (threshold 15). Drivers by points: error handling 5 (9 pts), if/else 5 (6 pts), ternaries 1 (2 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.
OracleCollection._build_select_query (cognitive 17) python/semantic_kernel/connectors/oracle.py:664— OracleCollection._build_select_query has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (2 pts) (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.
KernelFunctionExtension.get_list_of_function_metadata_filters (cognitive 17) python/semantic_kernel/functions/kernel_function_extension.py:371— KernelFunctionExtension.get_list_of_function_metadata_filters has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, loops 2 (3 pts) (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.
KernelPromptTemplate.model_post_init (cognitive 17) python/semantic_kernel/prompt_template/kernel_prompt_template.py:40— KernelPromptTemplate.model_post_init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 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.
CodeBlock.check_tokens (cognitive 17) python/semantic_kernel/template_engine/blocks/code_block.py:68— CodeBlock.check_tokens has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, 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.
decorators._set_completion_response (cognitive 17) python/semantic_kernel/utils/telemetry/model_diagnostics/decorators.py:398— decorators._set_completion_response has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 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.
VadService.ProcessAudioChunk (cognitive 16) dotnet/samples/Demos/VoiceChat/Services/VadService.cs:68— VadService.ProcessAudioChunk has cognitive complexity 16 (threshold 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.
PromptExecutionSettingsExtensions.ToChatOptions::TryConvert (cognitive 16) dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettingsExtensions.cs:215— PromptExecutionSettingsExtensions.ToChatOptions::TryConvert has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (7 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. This shape REPEATS in the file: one other method here (PromptExecutionSettingsExtensions.ToChatOptions) 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.
TextSearchResultPropertyReader.FindPropertiesInfo (cognitive 16) dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchResultPropertyReader.cs:72— TextSearchResultPropertyReader.FindPropertiesInfo has cognitive complexity 16 (threshold 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.
TextChunker.ProcessParagraphs (cognitive 16) dotnet/src/SemanticKernel.Core/Text/TextChunker.cs:185— TextChunker.ProcessParagraphs has cognitive complexity 16 (threshold 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.
AgentMessageFactory.GetThreadMessages (cognitive 16) dotnet/src/Agents/AzureAI/Internal/AgentMessageFactory.cs:99— AgentMessageFactory.GetThreadMessages has cognitive complexity 16 (threshold 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.
BedrockTextGenerationClient.StreamTextAsync (cognitive 16) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Clients/BedrockTextGenerationClient.cs:119— BedrockTextGenerationClient.StreamTextAsync has cognitive complexity 16 (threshold 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.
GeminiRequest.CreateGeminiParts (cognitive 16) dotnet/src/Connectors/Connectors.Google/Core/Gemini/Models/GeminiRequest.cs:196— GeminiRequest.CreateGeminiParts has cognitive complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
ClientCore.GetResponseModalities (cognitive 16) dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:1118— ClientCore.GetResponseModalities has cognitive complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
ProcessActor.SendOutgoingPublicEventsAsync (cognitive 16) dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProcessActor.cs:437— ProcessActor.SendOutgoingPublicEventsAsync has cognitive complexity 16 (threshold 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.
CrewAIEnterprise.BuildArguments (cognitive 16) dotnet/src/Plugins/Plugins.AI/CrewAI/CrewAIEnterprise.cs:240— CrewAIEnterprise.BuildArguments has cognitive complexity 16 (threshold 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.
BingTextSearch.BuildQuery (cognitive 16) dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs:598— BingTextSearch.BuildQuery has cognitive complexity 16 (threshold 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.
utils._format_assistant_message (cognitive 16) python/semantic_kernel/connectors/ai/anthropic/services/utils.py:39— utils._format_assistant_message has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (6 pts), boolean chains 2, 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.
function_calling_utils._combine_filter_dicts (cognitive 16) python/semantic_kernel/connectors/ai/function_calling_utils.py:80— function_calling_utils._combine_filter_dicts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (8 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.
utils.format_assistant_message (cognitive 16) python/semantic_kernel/connectors/ai/google/vertex_ai/services/utils.py:78— utils.format_assistant_message has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (6 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.
OnnxGenAIChatCompletion._get_images_from_history (cognitive 16) python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_chat_completion.py:185— OnnxGenAIChatCompletion._get_images_from_history has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), ternaries 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. This shape REPEATS in the file: one other method here (OnnxGenAIChatCompletion._get_audios_from_history) 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.
OnnxGenAIChatCompletion._get_audios_from_history (cognitive 16) python/semantic_kernel/connectors/ai/onnx/services/onnx_gen_ai_chat_completion.py:200— OnnxGenAIChatCompletion._get_audios_from_history has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), ternaries 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. This shape REPEATS in the file: one other method here (OnnxGenAIChatCompletion._get_images_from_history) 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.
chat_history_reducer_utils.locate_safe_reduction_index (cognitive 16) python/semantic_kernel/contents/history_reducer/chat_history_reducer_utils.py:64— chat_history_reducer_utils.locate_safe_reduction_index has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, 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.
DataUri.__init__ (cognitive 16) python/semantic_kernel/contents/utils/data_uri.py:46— DataUri.__init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, error handling 1 (3 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.
KernelFunction.invoke_stream (cognitive 16) python/semantic_kernel/functions/kernel_function.py:308— KernelFunction.invoke_stream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), loops 2 (6 pts), error handling 2 (3 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.
KernelFunctionExtension.add_function (cognitive 16) python/semantic_kernel/functions/kernel_function_extension.py:139— KernelFunctionExtension.add_function has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, ternaries 3 (5 pts) (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.
text_chunker._split_str (cognitive 16) python/semantic_kernel/text/text_chunker.py:224— text_chunker._split_str has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 4). 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· Consequences/trade-offs (e.g. cost of keeping chat-completion fallback) are not present in the visible portion before the clip marker · ×1
Consequences/trade-offs (e.g. cost of keeping chat-completion fallback) are not present in the visible portion before the clip marker docs/decisions/0038-completion-service-selection.md
D20 · ADR Quality· Decision outcome (when the decision is implemented) is marked 'TBD' and not yet stated · ×1
Decision outcome (when the decision is implemented) is marked 'TBD' and not yet stated docs/decisions/0066-concepts-guidelines.md— Replace the TBD with a concrete implementation date or an explicit Decision Outcome section noting when the new rules will go live
D22 · Internal API Consistency· Duplicate configuration types with identical fields. `AuthServerSettings` and `ServerSettings` (in legacy_as_server) have the exact same fields (host, port, server_url, auth_callback_path). This suggests `ServerSettings` is a legacy duplicate or `AuthServerSettings` is a renamed version without removing the old one. · ×1
Duplicate configuration types with identical fields. `AuthServerSettings` and `ServerSettings` (in legacy_as_server) have the exact same fields (host, port, server_url, auth_callback_path). This suggests `ServerSettings` is a legacy duplicate or `AuthServerSettings` is a renamed version without removing the old one. — Remove `ServerSettings` and update `legacy_as_server` to use `AuthServerSettings`, or vice versa, to maintain a single source of truth for server configuration. (signatures: AuthServerSettings | ServerSettings)
D22 · Internal API Consistency· Confusingly similar provider classes with different naming and slightly different constructor signatures. `SimpleAuthProvider` takes `auth_callback_path` while `SimpleOAuthProvider` takes `auth_callback_url`. The intent appears to be the same (handling OAuth callbacks), but the naming (`Provider` vs `OAuthProvider`) and parameter names (`path` vs `url`) are inconsistent. · ×1
Confusingly similar provider classes with different naming and slightly different constructor signatures. `SimpleAuthProvider` takes `auth_callback_path` while `SimpleOAuthProvider` takes `auth_callback_url`. The intent appears to be the same (handling OAuth callbacks), but the naming (`Provider` vs `OAuthProvider`) and parameter names (`path` vs `url`) are inconsistent. — Unify into a single provider class or clearly distinguish their roles (e.g., `LegacyAuthProvider` vs `StandardOAuthProvider`). If they are functionally equivalent, standardize the constructor signature and naming. (signatures: SimpleAuthProvider.__init__(self, auth_settings: SimpleAuthSettings, auth_callback_path: str, server_url: str) | SimpleOAuthProvider.__init__(self, settings: SimpleAuthSettings, auth_callback_url: str, server_url: str))
D22 · Internal API Consistency· Ambiguous entry points in the same module. `main.main()` and `main.cli()` are both exposed. It is unclear if one is deprecated, if they serve different purposes (e.g., programmatic vs CLI), or if one is redundant. · ×1
Ambiguous entry points in the same module. `main.main()` and `main.cli()` are both exposed. It is unclear if one is deprecated, if they serve different purposes (e.g., programmatic vs CLI), or if one is redundant. — Remove the redundant entry point. If `cli()` is the public interface, `main()` should be private or removed. If they serve distinct purposes, rename them to reflect that (e.g., `run_server()` vs `parse_args()`). (signatures: main.main() | main.cli())
D22 · Internal API Consistency· Inconsistent main entry point signatures across modules. `legacy_as_server.main` and `server.main` both serve as CLI entry points but have different parameters. `server.main` requires `auth_server` and `oauth_strict`, while `legacy_as_server.main` does not. This creates confusion for users trying to start the service. · ×1
Inconsistent main entry point signatures across modules. `legacy_as_server.main` and `server.main` both serve as CLI entry points but have different parameters. `server.main` requires `auth_server` and `oauth_strict`, while `legacy_as_server.main` does not. This creates confusion for users trying to start the service. — Standardize the CLI entry points. If `server.main` is the preferred entry point, deprecate `legacy_as_server.main`. Ensure parameter names and required arguments are consistent across all entry points. (signatures: legacy_as_server.main(port: int, transport: Literal['sse', 'streamable-http']): int | server.main(port: int, auth_server: str, transport: Literal['sse', 'streamable-http'], oauth_strict: bool): int)
Near-duplicate member pair (70 shared lines) dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:50— dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:50-265 | dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:268-499 — These two members are variants of one another: 70 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.
Near-duplicate member pair (62 shared lines) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:145— dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:145-353 | dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:124-334 — These two members are variants of one another: 62 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.
Near-duplicate member pair (59 shared lines) dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:100— dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:100-228 | dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs:63-225 — 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· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) python/semantic_kernel/connectors/qdrant.py:156— python/semantic_kernel/connectors/qdrant.py:156-226 | python/semantic_kernel/connectors/qdrant.py:571-624 — These two members are one piece of code written twice and then edited apart: 26 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.
Duplicated block (67 lines × 3) dotnet/src/Agents/AzureAI/AzureAIAgentInvokeOptions.cs:87— dotnet/src/Agents/AzureAI/AzureAIAgentInvokeOptions.cs:87-153 | dotnet/src/Agents/AzureAI/AzureAIInvocationOptions.cs:48-114 | dotnet/src/Agents/OpenAI/OpenAIAssistantInvocationOptions.cs:46-112 — before extracting anything, compare `dotnet/src/Agents/AzureAI/AzureAIInvocationOptions.cs` and `dotnet/src/Agents/OpenAI/OpenAIAssistantInvocationOptions.cs` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (55 lines × 2) dotnet/src/Agents/AzureAI/RunPollingOptions.cs:9— dotnet/src/Agents/AzureAI/RunPollingOptions.cs:9-63 | dotnet/src/Agents/OpenAI/RunPollingOptions.cs:9-63 — `dotnet/src/Agents/AzureAI/RunPollingOptions.cs` and `dotnet/src/Agents/OpenAI/RunPollingOptions.cs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 55 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dotnet/src/Agents/AzureAI/RunPollingOptions.cs:9` 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 (49 lines × 2) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:301— dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:301-349 | dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:282-330 — before extracting anything, compare `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs` and `dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 239 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 (48 lines × 2) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Anthropic/AnthropicService.cs:52— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Anthropic/AnthropicService.cs:52-99 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Anthropic/AnthropicService.cs:135-182 — 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 `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Anthropic/AnthropicService.cs:52` 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 (30 lines × 3) dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:56— dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:56-85 | dotnet/src/Connectors/Connectors.HuggingFace/Core/HuggingFaceMessageApiClient.cs:32-61 | dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:606-635 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs` and `dotnet/src/Connectors/Connectors.HuggingFace/Core/HuggingFaceMessageApiClient.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 66 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 `dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs:56` 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 (28–31 lines × 2) dotnet/src/Agents/Magentic/Logging/MagenticOrchestrationLogMessages.cs:24— dotnet/src/Agents/Magentic/Logging/MagenticOrchestrationLogMessages.cs:24-51 | dotnet/src/Agents/Orchestration/Logging/AgentOrchestrationLogMessages.cs:35-65 — 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 (26 lines × 4) dotnet/src/Agents/AzureAI/AzureAIAgentInvokeOptions.cs:99— dotnet/src/Agents/AzureAI/AzureAIAgentInvokeOptions.cs:99-124 | dotnet/src/Agents/AzureAI/AzureAIInvocationOptions.cs:60-85 | dotnet/src/Agents/OpenAI/OpenAIAssistantExecutionOptions.cs:24-49 | dotnet/src/Agents/OpenAI/OpenAIAssistantInvocationOptions.cs:58-83 — before extracting anything, compare `dotnet/src/Agents/AzureAI/AzureAIInvocationOptions.cs` and `dotnet/src/Agents/OpenAI/OpenAIAssistantInvocationOptions.cs` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (27–28 lines × 2) dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:588— dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:588-614 | dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs:579-606 — before extracting anything, compare `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs` and `dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 239 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 `dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:588` 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 first that the copies are not typed on the same thing: the declarations holding them bind `message` to `PersistentThreadMessage` in one and `ThreadMessage` 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 (15–21 lines × 3) dotnet/src/Plugins/Plugins.Core/FileIOPlugin.cs:162— dotnet/src/Plugins/Plugins.Core/FileIOPlugin.cs:162-182 | dotnet/src/Plugins/Plugins.Document/DocumentPlugin.cs:205-219 | dotnet/src/Plugins/Plugins.Web/WebFileDownloadPlugin.cs:276-290 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `dotnet/src/Plugins/Plugins.Web/WebFileDownloadPlugin.cs:274` calls `GetSafeFullPath` and `dotnet/src/Plugins/Plugins.Document/DocumentPlugin.cs:203` 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.
Duplicated block (19 lines × 5) dotnet/src/Agents/AzureAI/AzureAIAgent.cs:138— dotnet/src/Agents/AzureAI/AzureAIAgent.cs:138-156 | dotnet/src/Agents/AzureAI/AzureAIAgent.cs:241-259 | dotnet/src/Agents/Core/ChatCompletionAgent.cs:74-92 | dotnet/src/Agents/Core/ChatCompletionAgent.cs:177-195 | dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs:240-258 — before extracting anything, compare `dotnet/src/Agents/AzureAI/AzureAIAgent.cs` and `dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 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 `dotnet/src/Agents/AzureAI/AzureAIAgent.cs:138` 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 (17–18 lines × 2) dotnet/src/Connectors/Connectors.Google/Models/Gemini/GeminiFunctionToolCall.cs:106— dotnet/src/Connectors/Connectors.Google/Models/Gemini/GeminiFunctionToolCall.cs:106-123 | dotnet/src/Connectors/Connectors.OpenAI/Core/OpenAIFunctionToolCall.cs:71-87 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–18 lines × 2) dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:180— dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs:180-197 | dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs:152-161 — before extracting anything, compare `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs` and `dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/CopilotAgentPluginKernelExtensions.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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. 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 (11–16 lines × 3) dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIKernelBuilderExtensions.cs:358— dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIKernelBuilderExtensions.cs:358-372 | dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIKernelBuilderExtensions.cs:388-398 | dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIKernelBuilderExtensions.cs:420-435 — 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 `dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIKernelBuilderExtensions.cs:358` 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, `dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIKernelBuilderExtensions.cs:358` calls `NotNullOrWhiteSpace` and `dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIKernelBuilderExtensions.cs:388` 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.
Duplicated block (11–16 lines × 2) dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.cs:297— dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.cs:297-307 | dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.cs:327-342 — 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 `dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.cs:297` 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–15 lines × 2) dotnet/src/Plugins/Plugins.MsGraph/Connectors/OneDriveConnector.cs:100— dotnet/src/Plugins/Plugins.MsGraph/Connectors/OneDriveConnector.cs:100-113 | dotnet/src/Plugins/Plugins.MsGraph/Connectors/OneDriveConnector.cs:133-147 — 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 `dotnet/src/Plugins/Plugins.MsGraph/Connectors/OneDriveConnector.cs:100` 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 (4–14 lines × 3) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:21— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:21-24 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:57-70 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:98-111 — 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 `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Amazon/AmazonService.cs:57` 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 (13 lines × 3) dotnet/src/Agents/AzureAI/AzureAIAgent.cs:300— dotnet/src/Agents/AzureAI/AzureAIAgent.cs:300-312 | dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs:308-320 | dotnet/src/Agents/OpenAI/OpenAIResponseAgent.cs:114-126 — before extracting anything, compare `dotnet/src/Agents/AzureAI/AzureAIAgent.cs` and `dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs:324` calls `Experimental` and `dotnet/src/Agents/AzureAI/AzureAIAgent.cs:316` 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 (4–13 lines × 3) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:22— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:22-25 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:59-71 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:104-116 — 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 `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:59` 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 lines × 5) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.DependencyInjection.cs:45— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.DependencyInjection.cs:45-54 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.DependencyInjection.cs:107-116 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.cs:45-54 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.cs:87-96 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.cs:130-139 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Extensions/BedrockServiceCollectionExtensions.DependencyInjection.cs:45` 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 (4–8 lines × 3) dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:66— dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:66-73 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:124-131 | dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/Mistral/MistralService.cs:23-26 — 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 `dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Models/AI21Labs/AI21JambaService.cs:66` 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 (5 lines × 5) dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:106— dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:106-110 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs:217-221 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:117-121 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:226-230 | dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs:341-345 — before extracting anything, compare `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.DependencyInjection.cs` and `dotnet/src/Connectors/Connectors.Ollama/Extensions/OllamaServiceCollectionExtensions.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 109 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 (111 lines × 2) dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/ChatMessageContentItemCollection.cs:20— dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/ChatMessageContentItemCollection.cs:20-130 | dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/StreamingKernelContentItemCollection.cs:20-133 — before extracting anything, compare `dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/ChatMessageContentItemCollection.cs` and `dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/StreamingKernelContentItemCollection.cs` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (71–73 lines × 2) python/semantic_kernel/agents/runtime/core/routed_agent.py:96— python/semantic_kernel/agents/runtime/core/routed_agent.py:96-168 | python/semantic_kernel/agents/runtime/core/routed_agent.py:358-428 — 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 (69 lines × 2) python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:299— python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:299-367 | python/semantic_kernel/processes/local_runtime/local_step.py:96-164 — before extracting anything, compare `python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py` and `python/semantic_kernel/processes/local_runtime/local_step.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 130 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. Note first that the copies are not typed on the same thing: `KernelException` names `semantic_kernel.exceptions` in one and `semantic_kernel.exceptions.kernel_exceptions` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `python/semantic_kernel/processes/dapr_runtime/actors/step_actor.py:298` calls `error` and `python/semantic_kernel/processes/local_runtime/local_step.py:95` 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 (67 lines × 2) python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:117— python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:117-183 | python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py:320-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.
Duplicated block (63–64 lines × 3) python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:765— python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:765-827 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:877-940 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:988-1050 — 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.
Duplicated block (61–62 lines × 3) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:663— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:663-723 | python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:772-833 | python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:880-940 — 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.
Duplicated block (56–58 lines × 2) python/semantic_kernel/connectors/ai/open_ai/services/azure_realtime.py:71— python/semantic_kernel/connectors/ai/open_ai/services/azure_realtime.py:71-126 | python/semantic_kernel/connectors/ai/open_ai/services/azure_realtime.py:220-277 — 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 (54 lines × 2) python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:79— python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:79-132 | python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_completion.py:50-103 — before extracting anything, compare `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py` and `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_completion.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 95 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (44–49 lines × 2) python/semantic_kernel/connectors/weaviate.py:227— python/semantic_kernel/connectors/weaviate.py:227-275 | python/semantic_kernel/connectors/weaviate.py:702-745 — 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 `python/semantic_kernel/connectors/weaviate.py:702` 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 (47–48 lines × 3) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:134— python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:134-181 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:162-208 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:396-443 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py` and `python/semantic_kernel/agents/open_ai/assistant_thread_actions.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 204 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. Note first that the copies are not typed on the same thing: `KernelArguments` names `semantic_kernel.functions` in one and `semantic_kernel.functions.kernel_arguments` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (44–46 lines × 3) python/semantic_kernel/agents/open_ai/openai_responses_agent.py:850— python/semantic_kernel/agents/open_ai/openai_responses_agent.py:850-893 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:971-1016 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:1091-1136 — 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.
Duplicated block (36–41 lines × 2) python/semantic_kernel/agents/strategies/selection/kernel_function_selection_strategy.py:49— python/semantic_kernel/agents/strategies/selection/kernel_function_selection_strategy.py:49-89 | python/semantic_kernel/agents/strategies/termination/kernel_function_termination_strategy.py:44-79 — 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 `python/semantic_kernel/agents/strategies/selection/kernel_function_selection_strategy.py:49` 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 (40 lines × 2) python/semantic_kernel/agents/azure_ai/agent_content_generation.py:70— python/semantic_kernel/agents/azure_ai/agent_content_generation.py:70-109 | python/semantic_kernel/agents/open_ai/assistant_content_generation.py:88-127 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_content_generation.py` and `python/semantic_kernel/agents/open_ai/assistant_content_generation.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 91 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (37–38 lines × 2) REDACTED:61— REDACTED:61-98 | REDACTED:58-94 — 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 (27–36 lines × 2) python/semantic_kernel/agents/copilot_studio/copilot_studio_agent.py:345— python/semantic_kernel/agents/copilot_studio/copilot_studio_agent.py:345-371 | python/semantic_kernel/agents/copilot_studio/copilot_studio_agent.py:439-474 — 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 `python/semantic_kernel/agents/copilot_studio/copilot_studio_agent.py:345` 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 (31–35 lines × 5) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:598— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:598-631 | python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:252-286 | python/semantic_kernel/agents/open_ai/azure_responses_agent.py:259-293 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:568-598 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:605-635 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py` and `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 235 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 (18–34 lines × 6) python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:161— python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:161-185 | python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:250-271 | python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:293-314 | python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:335-352 | python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:358-375 | python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py:388-421 — all 6 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 `python/semantic_kernel/connectors/memory_stores/postgres/postgres_memory_store.py: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. 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 (24–33 lines × 2) python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:165— python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:165-197 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:352-375 — 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 (32 lines × 4) python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:93— python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:93-124 | python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:186-217 | python/semantic_kernel/agents/open_ai/azure_responses_agent.py:100-131 | python/semantic_kernel/agents/open_ai/azure_responses_agent.py:193-224 — before extracting anything, compare `python/semantic_kernel/agents/open_ai/azure_assistant_agent.py` and `python/semantic_kernel/agents/open_ai/azure_responses_agent.py` as WHOLE FILES: this scan already matched 3 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 `python/semantic_kernel/agents/open_ai/azure_assistant_agent.py:93` 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 (29–32 lines × 2) python/semantic_kernel/connectors/ai/open_ai/services/_open_ai_realtime.py:885— python/semantic_kernel/connectors/ai/open_ai/services/_open_ai_realtime.py:885-913 | python/semantic_kernel/connectors/ai/open_ai/services/azure_realtime.py:344-375 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (30–31 lines × 2) python/semantic_kernel/connectors/memory_stores/chroma/utils.py:91— python/semantic_kernel/connectors/memory_stores/chroma/utils.py:91-121 | python/semantic_kernel/memory/volatile_memory_store.py:290-319 — 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 `python/semantic_kernel/connectors/memory_stores/chroma/utils.py:91` 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 (28–30 lines × 2) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:524— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:524-551 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:481-510 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py` and `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 235 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on 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.
Duplicated block (27–29 lines × 6) python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:697— python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:697-724 | python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:807-834 | python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:915-941 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:800-828 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:913-941 | python/semantic_kernel/agents/open_ai/openai_assistant_agent.py:1024-1051 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py` and `python/semantic_kernel/agents/open_ai/openai_assistant_agent.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 235 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 `python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:697` 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 (23–24 lines × 4) python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:171— python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:171-193 | python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:525-547 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:198-221 | python/semantic_kernel/agents/open_ai/assistant_thread_actions.py:433-456 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py` and `python/semantic_kernel/agents/open_ai/assistant_thread_actions.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 204 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 `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:171` 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, `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:523` calls `_merge_arguments` and `python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:169` 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 (23 lines × 3) python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:140— python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:140-171 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:312-354 | python/semantic_kernel/contents/utils/data_uri.py:56-78 — 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.
Duplicated block (22–23 lines × 2) python/semantic_kernel/connectors/azure_cosmos_db.py:330— python/semantic_kernel/connectors/azure_cosmos_db.py:330-352 | python/semantic_kernel/connectors/azure_cosmos_db.py:498-519 — 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 (21–23 lines × 2) python/semantic_kernel/utils/telemetry/model_diagnostics/decorators.py:145— python/semantic_kernel/utils/telemetry/model_diagnostics/decorators.py:145-167 | python/semantic_kernel/utils/telemetry/model_diagnostics/decorators.py:261-281 — 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–21 lines × 2) python/semantic_kernel/connectors/ai/onnx/utils.py:92— python/semantic_kernel/connectors/ai/onnx/utils.py:92-112 | python/semantic_kernel/connectors/ai/onnx/utils.py:130-142 — 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 after the matched lines, `python/semantic_kernel/connectors/ai/onnx/utils.py:143` calls `isinstance` and `python/semantic_kernel/connectors/ai/onnx/utils.py:113` 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 (18–19 lines × 2) python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:164— python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:164-182 | python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_completion.py:131-148 — before extracting anything, compare `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py` and `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_completion.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 95 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 `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:164` 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 (16 lines × 6) python/semantic_kernel/connectors/chroma.py:409— python/semantic_kernel/connectors/chroma.py:409-424 | python/semantic_kernel/connectors/mongodb.py:494-509 | python/semantic_kernel/connectors/pinecone.py:558-573 | python/semantic_kernel/connectors/qdrant.py:419-434 | python/semantic_kernel/connectors/redis.py:469-484 | python/semantic_kernel/connectors/weaviate.py:456-471 — 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 6 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `python/semantic_kernel/connectors/pinecone.py:575` calls `NotImplementedError` and `python/semantic_kernel/connectors/mongodb.py:510` 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 (11–14 lines × 2) python/semantic_kernel/agents/azure_ai/agent_content_generation.py:177— python/semantic_kernel/agents/azure_ai/agent_content_generation.py:177-190 | python/semantic_kernel/agents/open_ai/assistant_content_generation.py:205-215 — before extracting anything, compare `python/semantic_kernel/agents/azure_ai/agent_content_generation.py` and `python/semantic_kernel/agents/open_ai/assistant_content_generation.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 91 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 `python/semantic_kernel/agents/azure_ai/agent_content_generation.py:177` 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 (13 lines × 4) python/semantic_kernel/connectors/ai/open_ai/services/open_ai_audio_to_text.py:73— python/semantic_kernel/connectors/ai/open_ai/services/open_ai_audio_to_text.py:73-85 | python/semantic_kernel/connectors/ai/open_ai/services/open_ai_text_embedding.py:78-90 | python/semantic_kernel/connectors/ai/open_ai/services/open_ai_text_to_audio.py:73-85 | python/semantic_kernel/connectors/ai/open_ai/services/open_ai_text_to_image.py:73-85 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–13 lines × 3) python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:164— python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:164-174 | python/semantic_kernel/agents/copilot_studio/copilot_studio_agent.py:232-244 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:351-360 — 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 `python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:164` 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) python/semantic_kernel/connectors/oracle.py:253— python/semantic_kernel/connectors/oracle.py:253-265 | python/semantic_kernel/connectors/oracle.py:332-343 — 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 `python/semantic_kernel/connectors/oracle.py: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 (11 lines × 6) python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py:107— python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py:107-117 | python/semantic_kernel/connectors/ai/open_ai/services/azure_chat_completion.py:131-141 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_completion.py:117-127 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_embedding.py:107-117 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_to_audio.py:107-117 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_to_image.py:107-117 — before extracting anything, compare `python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py` and `python/semantic_kernel/connectors/ai/open_ai/services/azure_text_to_audio.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 `python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py:107` 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–11 lines × 2) python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:218— python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py:218-228 | python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_completion.py:177-184 — before extracting anything, compare `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py` and `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_completion.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 95 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 `python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py: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. 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) python/semantic_kernel/connectors/redis.py:403— python/semantic_kernel/connectors/redis.py:403-412 | python/semantic_kernel/connectors/redis.py:425-435 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 4) python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:161— python/semantic_kernel/agents/chat_completion/chat_completion_agent.py:161-171 | python/semantic_kernel/agents/copilot_studio/copilot_studio_agent.py:227-239 | python/semantic_kernel/agents/open_ai/openai_responses_agent.py:340-354 | python/semantic_kernel/contents/utils/data_uri.py:69-78 — 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.
Duplicated block (9 lines × 6) python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py:83— python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py:83-91 | python/semantic_kernel/connectors/ai/open_ai/services/azure_chat_completion.py:106-114 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_completion.py:93-101 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_embedding.py:83-91 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_to_audio.py:83-91 | python/semantic_kernel/connectors/ai/open_ai/services/azure_text_to_image.py:83-91 — before extracting anything, compare `python/semantic_kernel/connectors/ai/open_ai/services/azure_audio_to_text.py` and `python/semantic_kernel/connectors/ai/open_ai/services/azure_text_to_audio.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 × 5) python/semantic_kernel/connectors/chroma.py:367— python/semantic_kernel/connectors/chroma.py:367-375 | python/semantic_kernel/connectors/mongodb.py:447-455 | python/semantic_kernel/connectors/pinecone.py:498-506 | python/semantic_kernel/connectors/qdrant.py:371-379 | python/semantic_kernel/connectors/sql_server.py:590-598 — 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.
Duplicated block (7–8 lines × 4) python/semantic_kernel/connectors/memory_stores/azure_cosmosdb/mongo_vcore_store_api.py:214— python/semantic_kernel/connectors/memory_stores/azure_cosmosdb/mongo_vcore_store_api.py:214-220 | python/semantic_kernel/connectors/memory_stores/azure_cosmosdb/mongo_vcore_store_api.py:230-237 | python/semantic_kernel/connectors/memory_stores/azure_cosmosdb_no_sql/azure_cosmosdb_no_sql_memory_store.py:112-118 | python/semantic_kernel/connectors/memory_stores/azure_cosmosdb_no_sql/azure_cosmosdb_no_sql_memory_store.py:128-135 — 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 `python/semantic_kernel/connectors/memory_stores/azure_cosmosdb/mongo_vcore_store_api.py:214` 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–7 lines × 6) python/semantic_kernel/connectors/chroma.py:369— python/semantic_kernel/connectors/chroma.py:369-375 | python/semantic_kernel/connectors/mongodb.py:449-455 | python/semantic_kernel/connectors/oracle.py:1038-1043 | python/semantic_kernel/connectors/pinecone.py:500-506 | python/semantic_kernel/connectors/qdrant.py:373-379 | python/semantic_kernel/connectors/sql_server.py:592-598 — 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 6 call sites, so a change lands once.
Duplicated block (19 lines × 3) python/semantic_kernel/connectors/memory_stores/astradb/astradb_memory_store.py:274— python/semantic_kernel/connectors/memory_stores/astradb/astradb_memory_store.py:274-292 | python/semantic_kernel/connectors/memory_stores/chroma/chroma_memory_store.py:333-351 | python/semantic_kernel/connectors/memory_stores/pinecone/pinecone_memory_store.py:308-326 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_code_interpreter.py:39— python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_code_interpreter.py:39-139 | python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:39-95 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_code_interpreter.py:37-137 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_file_search.py:38-90 | python/samples/concepts/agents/openai_assistant/openai_assistant_file_manipulation.py:22-83 | python/samples/concepts/agents/openai_assistant/openai_assistant_file_manipulation_streaming.py:21-103 | python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_file_search.py:36-91 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_file_search.py:35-96 — These 8 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 8 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 8 times.
Duplicated block (42–44 lines × 4) dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs:133— dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs:133-176 | dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs:184-225 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs:131-174 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs:181-222 — before extracting anything, compare `dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs` and `dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 98 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 `dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs:133` 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 (19–31 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step01_Basics/Program.cs:54— dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step01_Basics/Program.cs:54-72 | dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs:118-148 — 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 `dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step01_Basics/Program.cs:54` 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 (18–29 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step01_Basics/Program.cs:24— dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step01_Basics/Program.cs:24-41 | dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs:50-78 — 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 `dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step01_Basics/Program.cs:24` 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 (26–27 lines × 2) dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step01_Concurrent/Program.cs:80— dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step01_Concurrent/Program.cs:80-105 | dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step02_Sequential/Program.cs:82-108 — `dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step01_Concurrent/Program.cs` and `dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step02_Sequential/Program.cs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 43 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dotnet/samples/AgentFrameworkMigration/AgentOrchestrations/Step01_Concurrent/Program.cs:80` 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 (16–27 lines × 2) dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step01_Basics/Program.cs:23— dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step01_Basics/Program.cs:23-38 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs:49-75 — 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 `dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step01_Basics/Program.cs: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 (20–21 lines × 3) dotnet/samples/Demos/ModelContextProtocolClientServer/MCPClient/Samples/AgentAvailableAsMCPToolSample.cs:33— dotnet/samples/Demos/ModelContextProtocolClientServer/MCPClient/Samples/AgentAvailableAsMCPToolSample.cs:33-53 | dotnet/samples/Demos/ModelContextProtocolClientServer/MCPClient/Samples/ChatCompletionAgentWithMCPToolsSample.cs:34-53 | dotnet/samples/Demos/ModelContextProtocolClientServer/MCPClient/Samples/MCPToolsSample.cs:31-51 — 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.
Duplicated block (14–17 lines × 5) dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs:65— dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs:65-78 | dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step02_ToolCall/Program.cs:83-96 | dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step01_Basics/Program.cs:60-76 | dotnet/samples/AgentFrameworkMigration/OpenAI/Step02_ToolCall/Program.cs:63-76 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step01_Basics/Program.cs:58-74 — `dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs` and `dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step02_ToolCall/Program.cs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 4) dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs:74— dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs:74-88 | dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs:105-119 | dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Processes/Steps/GenerateDocumentationStep.cs:74-88 | dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Processes/Steps/GenerateDocumentationStep.cs:105-119 — before extracting anything, compare `dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs` and `dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Processes/Steps/GenerateDocumentationStep.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 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 `dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Steps/GenerateDocumentationStep.cs:74` 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 (15–17 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step03_ToolCall/Program.cs:31— dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step03_ToolCall/Program.cs:31-47 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step03_ToolCall/Program.cs:32-46 — 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 `dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step03_ToolCall/Program.cs:32` 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 (14–16 lines × 2) dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:51— dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:51-66 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs:48-61 — before extracting anything, compare `dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs` and `dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs:51` 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 (13–15 lines × 13) dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs:67— dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs:67-81 | dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs:101-113 | dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step02_ToolCall/Program.cs:85-99 | dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step02_ToolCall/Program.cs:116-128 | dotnet/samples/AgentFrameworkMigration/AzureOpenAI/Step01_Basics/Program.cs:64-78 | dotnet/samples/AgentFrameworkMigration/AzureOpenAI/Step01_Basics/Program.cs:86-98 | dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step01_Basics/Program.cs:67-79 | dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step01_Basics/Program.cs:88-100 | dotnet/samples/AgentFrameworkMigration/OpenAI/Step01_Basics/Program.cs:64-78 | dotnet/samples/AgentFrameworkMigration/OpenAI/Step01_Basics/Program.cs:87-99 | dotnet/samples/AgentFrameworkMigration/OpenAI/Step02_ToolCall/Program.cs:66-79 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step01_Basics/Program.cs:65-77 | dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step01_Basics/Program.cs:85-97 — `dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs` and `dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step02_ToolCall/Program.cs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs:101` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs:67` calls `AsAIAgent` and `dotnet/samples/AgentFrameworkMigration/AzureAIFoundry/Step01_Basics/Program.cs:101` 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 (54–56 lines × 2) python/samples/demos/mcp_server/agent_as_server.py:134— python/samples/demos/mcp_server/agent_as_server.py:134-189 | python/samples/demos/mcp_server/sk_mcp_server.py:136-189 — 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 `python/samples/demos/mcp_server/agent_as_server.py:134` 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 (53 lines × 2) python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_code_interpreter.py:87— python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_code_interpreter.py:87-139 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_code_interpreter.py:85-137 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_code_interpreter.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_code_interpreter.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 104 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 (50 lines × 2) python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py:62— python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py:62-111 | python/samples/getting_started_with_agents/multi_agent_orchestration/step4b_handoff_streaming_agent_response_callback.py:71-120 — before extracting anything, compare `python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py` and `python/samples/getting_started_with_agents/multi_agent_orchestration/step4b_handoff_streaming_agent_response_callback.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 100 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 `python/samples/getting_started_with_agents/multi_agent_orchestration/step4_handoff.py: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.
Duplicated block (41–42 lines × 2) python/samples/concepts/agents/openai_assistant/openai_assistant_file_manipulation.py:26— python/samples/concepts/agents/openai_assistant/openai_assistant_file_manipulation.py:26-66 | python/samples/concepts/agents/openai_assistant/openai_assistant_file_manipulation_streaming.py:25-66 — 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 `python/samples/concepts/agents/openai_assistant/openai_assistant_file_manipulation.py:26` 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 (34–41 lines × 2) python/samples/concepts/agents/mixed_chat/mixed_chat_reset.py:42— python/samples/concepts/agents/mixed_chat/mixed_chat_reset.py:42-75 | python/samples/concepts/agents/mixed_chat/mixed_chat_streaming.py:46-86 — 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 `python/samples/concepts/agents/mixed_chat/mixed_chat_streaming.py:46` 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 (41 lines × 2) python/samples/concepts/agents/openai_assistant/openai_assistant_chart_maker.py:21— python/samples/concepts/agents/openai_assistant/openai_assistant_chart_maker.py:21-61 | python/samples/concepts/agents/openai_assistant/openai_assistant_chart_maker_streaming.py:21-61 — 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 (27–38 lines × 2) python/samples/getting_started_with_agents/multi_agent_orchestration/step3b_group_chat_with_chat_completion_manager.py:49— python/samples/getting_started_with_agents/multi_agent_orchestration/step3b_group_chat_with_chat_completion_manager.py:49-86 | python/samples/getting_started_with_agents/multi_agent_orchestration/step3b_group_chat_with_chat_completion_manager.py:101-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 `python/samples/getting_started_with_agents/multi_agent_orchestration/step3b_group_chat_with_chat_completion_manager.py:49` 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 (35–37 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_mcp_streaming.py:30— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_mcp_streaming.py:30-66 | python/samples/getting_started_with_agents/azure_ai_agent/step09_azure_ai_agent_mcp.py:30-64 — before extracting anything, compare `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_mcp_streaming.py` and `python/samples/getting_started_with_agents/azure_ai_agent/step09_azure_ai_agent_mcp.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 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 (37 lines × 2) python/samples/learn_resources/your_first_prompt.py:172— python/samples/learn_resources/your_first_prompt.py:172-208 | python/samples/learn_resources/your_first_prompt.py:212-249 — 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 `python/samples/learn_resources/your_first_prompt.py:172` 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 (36 lines × 4) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py:139— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py:139-174 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter_streaming.py:144-179 | python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter.py:137-172 | python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter_streaming.py:142-177 — before extracting anything, compare `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py` and `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter_streaming.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 92 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 (36 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_message_callback.py:59— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_message_callback.py:59-94 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_streaming.py:40-75 — 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 (28–33 lines × 3) python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_function_calling_from_file.py:70— python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_function_calling_from_file.py:70-97 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_function_calling_from_file.py:68-95 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_web_search.py:50-82 — before extracting anything, compare `python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_function_calling_from_file.py` and `python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_function_calling_from_file.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 92 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 `python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_web_search.py: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. 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 (32 lines × 2) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding.py:39— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding.py:39-70 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding_streaming_with_message_callback.py:44-75 — before extracting anything, compare `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding.py` and `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding_streaming_with_message_callback.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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 (27–31 lines × 2) python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:65— python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:65-95 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_file_search.py:64-90 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_file_search.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 86 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 `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:65` 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 (29 lines × 4) python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_function_calling_from_file.py:52— python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_function_calling_from_file.py:52-80 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_function_calling_from_file.py:50-78 | python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_function_calling_from_file.py:52-80 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_function_calling_from_file.py:50-78 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_function_calling_from_file.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_function_calling_from_file.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 59 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 `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_function_calling_from_file.py:52` 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 (28 lines × 4) python/samples/concepts/chat_completion/simple_chatbot.py:44— python/samples/concepts/chat_completion/simple_chatbot.py:44-71 | python/samples/concepts/chat_completion/simple_chatbot_logit_bias.py:67-94 | python/samples/concepts/chat_completion/simple_chatbot_store_metadata.py:41-68 | python/samples/concepts/chat_completion/simple_chatbot_with_image.py:68-95 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `python/samples/concepts/chat_completion/simple_chatbot_with_image.py:100` calls `chat` and `python/samples/concepts/chat_completion/simple_chatbot.py:76` 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 (27 lines × 4) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py:63— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py:63-89 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter_streaming.py:63-89 | python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter.py:64-90 | python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter_streaming.py:64-90 — before extracting anything, compare `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter.py` and `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_auto_func_invocation_filter_streaming.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 92 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 (26 lines × 3) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_code_interpreter.py:66— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_code_interpreter.py:66-91 | python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_code_interpreter.py:60-85 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_code_interpreter.py:58-83 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_code_interpreter.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_code_interpreter.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 104 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 `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_code_interpreter.py:66` 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 × 4) python/samples/getting_started_with_agents/azure_ai_agent/step02_azure_ai_agent_plugin.py:62— python/samples/getting_started_with_agents/azure_ai_agent/step02_azure_ai_agent_plugin.py:62-81 | python/samples/getting_started_with_agents/azure_ai_agent/step08_azure_ai_agent_declarative.py:78-97 | python/samples/getting_started_with_agents/openai_assistant/step6_assistant_declarative.py:65-84 | python/samples/getting_started_with_agents/openai_responses/step8_responses_agent_declarative.py:65-84 — before extracting anything, compare `python/samples/getting_started_with_agents/openai_assistant/step6_assistant_declarative.py` and `python/samples/getting_started_with_agents/openai_responses/step8_responses_agent_declarative.py` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `python/samples/getting_started_with_agents/azure_ai_agent/step02_azure_ai_agent_plugin.py:62` 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 before the matched lines, `python/samples/getting_started_with_agents/azure_ai_agent/step02_azure_ai_agent_plugin.py:61` calls `MenuPlugin` and `python/samples/getting_started_with_agents/azure_ai_agent/step08_azure_ai_agent_declarative.py:77` 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 (18–20 lines × 2) python/samples/concepts/realtime/realtime_agent_with_function_calling_webrtc.py:120— python/samples/concepts/realtime/realtime_agent_with_function_calling_webrtc.py:120-137 | python/samples/concepts/realtime/realtime_agent_with_function_calling_websocket.py:115-134 — 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 `python/samples/concepts/realtime/realtime_agent_with_function_calling_webrtc.py: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 (19–20 lines × 2) python/samples/getting_started_with_processes/step03/processes/fish_and_chips_process.py:59— python/samples/getting_started_with_processes/step03/processes/fish_and_chips_process.py:59-77 | python/samples/getting_started_with_processes/step03/processes/fish_and_chips_process.py:88-107 — 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 `python/samples/getting_started_with_processes/step03/processes/fish_and_chips_process.py: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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (17–19 lines × 3) python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback.py:63— python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback.py:63-81 | python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py:63-81 | python/samples/concepts/agents/openai_assistant/openai_assistant_streaming.py:47-63 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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 `python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback.py:63` 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 (15–16 lines × 3) python/samples/getting_started_with_processes/step03/processes/fish_sandwich_process.py:64— python/samples/getting_started_with_processes/step03/processes/fish_sandwich_process.py:64-78 | python/samples/getting_started_with_processes/step03/processes/fish_sandwich_process.py:88-103 | python/samples/getting_started_with_processes/step03/processes/fish_sandwich_process.py:114-129 — 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 `python/samples/getting_started_with_processes/step03/processes/fish_sandwich_process.py: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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (15 lines × 7) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_code_interpreter_streaming_with_message_callback.py:60— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_code_interpreter_streaming_with_message_callback.py:60-74 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_code_interpreter.py:80-94 | python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_code_interpreter.py:74-88 | python/samples/concepts/agents/openai_assistant/openai_assistant_chart_maker_streaming.py:69-83 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_code_interpreter.py:72-86 | python/samples/concepts/agents/openai_assistant/openai_assistant_file_manipulation_streaming.py:73-87 | python/samples/learn_resources/agent_docs/assistant_code.py:122-136 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_code_interpreter.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_code_interpreter.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 104 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 (12–15 lines × 2) python/samples/concepts/processes/plan_and_execute.py:99— python/samples/concepts/processes/plan_and_execute.py:99-113 | python/samples/concepts/processes/plan_and_execute.py:138-149 — 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 `python/samples/concepts/processes/plan_and_execute.py:99` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 5) python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter.py:99— python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter.py:99-112 | python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter_streaming.py:99-112 | python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback.py:60-73 | python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py:60-73 | python/samples/concepts/agents/openai_assistant/openai_assistant_streaming.py:44-57 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter_streaming.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 99 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 `python/samples/concepts/agents/openai_assistant/openai_assistant_auto_func_invocation_filter.py:99` 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 × 4) python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:44— python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:44-57 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_file_search.py:43-56 | python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_file_search.py:41-54 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_file_search.py:40-53 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_file_search.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 86 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 `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:44` 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 × 6) python/samples/concepts/auto_function_calling/chat_completion_with_manual_function_calling.py:93— python/samples/concepts/auto_function_calling/chat_completion_with_manual_function_calling.py:93-105 | python/samples/concepts/auto_function_calling/chat_completion_with_manual_function_calling_streaming.py:82-94 | python/samples/concepts/auto_function_calling/function_calling_with_required_type.py:104-116 | python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py:128-140 | python/samples/concepts/auto_function_calling/functions_defined_in_yaml_prompt.py:125-137 | python/samples/concepts/filtering/auto_function_invoke_filters.py:107-119 — before extracting anything, compare `python/samples/concepts/auto_function_calling/function_calling_with_required_type.py` and `python/samples/concepts/auto_function_calling/functions_defined_in_json_prompt.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 (11–12 lines × 3) python/samples/concepts/rag/self_critique_rag.py:109— python/samples/concepts/rag/self_critique_rag.py:109-120 | python/samples/concepts/rag/self_critique_rag.py:122-133 | python/samples/concepts/rag/self_critique_rag.py:134-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. 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, `python/samples/concepts/rag/self_critique_rag.py:122` calls `invoke` and `python/samples/concepts/rag/self_critique_rag.py:134` does not — after which the two agree again for 5 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 (11 lines × 7) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_function_calling_from_file.py:73— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_declarative_function_calling_from_file.py:73-83 | python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_function_calling_from_file.py:70-80 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_function_calling_from_file.py:68-78 | python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_function_calling_from_file.py:70-80 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_file_search.py:69-80 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_function_calling_from_file.py:68-78 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_web_search.py:50-61 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_function_calling_from_file.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_function_calling_from_file.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 59 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 (11 lines × 5) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_retrieve_messages_from_thread.py:70— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_retrieve_messages_from_thread.py:70-80 | python/samples/getting_started_with_agents/azure_ai_agent/step02_azure_ai_agent_plugin.py:69-79 | python/samples/getting_started_with_agents/azure_ai_agent/step08_azure_ai_agent_declarative.py:85-95 | python/samples/getting_started_with_agents/openai_assistant/step6_assistant_declarative.py:72-82 | python/samples/getting_started_with_agents/openai_responses/step8_responses_agent_declarative.py:72-82 — before extracting anything, compare `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_retrieve_messages_from_thread.py` and `python/samples/getting_started_with_agents/azure_ai_agent/step02_azure_ai_agent_plugin.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `python/samples/getting_started_with_agents/azure_ai_agent/step02_azure_ai_agent_plugin.py:61` calls `MenuPlugin` and `python/samples/getting_started_with_agents/azure_ai_agent/step08_azure_ai_agent_declarative.py:77` 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 (9–10 lines × 8) python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_code_interpreter.py:41— python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_code_interpreter.py:41-50 | python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_file_search.py:42-50 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_code_interpreter.py:39-48 | python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_file_search.py:41-49 | python/samples/concepts/agents/openai_assistant/openai_assistant_file_manipulation.py:24-33 | python/samples/concepts/agents/openai_assistant/openai_assistant_file_manipulation_streaming.py:23-32 | python/samples/concepts/agents/openai_responses/azure_openai_responses_agent_declarative_file_search.py:39-47 | python/samples/concepts/agents/openai_responses/openai_responses_agent_declarative_file_search.py:38-46 — before extracting anything, compare `python/samples/concepts/agents/openai_assistant/azure_openai_assistant_declarative_code_interpreter.py` and `python/samples/concepts/agents/openai_assistant/openai_assistant_declarative_code_interpreter.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 104 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–10 lines × 3) python/samples/concepts/agents/openai_responses/responses_agent_binary_content_upload.py:156— python/samples/concepts/agents/openai_responses/responses_agent_binary_content_upload.py:156-165 | python/samples/concepts/agents/openai_responses/responses_agent_plugins_streaming.py:71-79 | python/samples/concepts/agents/openai_responses/responses_agent_web_search_streaming.py:46-54 — before extracting anything, compare `python/samples/concepts/agents/openai_responses/responses_agent_plugins_streaming.py` and `python/samples/concepts/agents/openai_responses/responses_agent_web_search_streaming.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 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 (3–10 lines × 4) python/samples/concepts/agents/openai_responses/responses_agent_file_search_streaming.py:35— python/samples/concepts/agents/openai_responses/responses_agent_file_search_streaming.py:35-44 | python/samples/getting_started_with_agents/openai_assistant/step3_assistant_vision.py:24-26 | python/samples/getting_started_with_agents/openai_assistant/step5_assistant_tool_file_search.py:31-40 | python/samples/getting_started_with_agents/openai_responses/step5_responses_agent_file_search.py:36-45 — 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 `python/samples/concepts/agents/openai_responses/responses_agent_file_search_streaming.py:35` 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 (8–9 lines × 5) python/samples/concepts/agents/openai_responses/responses_agent_binary_content_upload.py:146— python/samples/concepts/agents/openai_responses/responses_agent_binary_content_upload.py:146-153 | python/samples/concepts/agents/openai_responses/responses_agent_binary_content_upload.py:160-167 | python/samples/concepts/agents/openai_responses/responses_agent_plugins_streaming.py:73-81 | python/samples/concepts/agents/openai_responses/responses_agent_reasoning_streaming.py:124-131 | python/samples/concepts/agents/openai_responses/responses_agent_web_search_streaming.py:49-56 — before extracting anything, compare `python/samples/concepts/agents/openai_responses/responses_agent_plugins_streaming.py` and `python/samples/concepts/agents/openai_responses/responses_agent_web_search_streaming.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 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 (6 lines × 13) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding.py:30— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding.py:30-35 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding_streaming_with_message_callback.py:35-40 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_mcp_streaming.py:21-26 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_message_callback.py:50-55 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_message_callback_streaming.py:54-59 | python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback.py:50-55 | python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py:50-55 | python/samples/concepts/agents/openai_responses/responses_agent_message_callback.py:49-54 | python/samples/concepts/agents/openai_responses/responses_agent_message_callback_streaming.py:49-54 | python/samples/getting_started_with_agents/azure_ai_agent/step06_azure_ai_agent_openapi.py:28-33 | python/samples/getting_started_with_agents/azure_ai_agent/step07_azure_ai_agent_retrieval.py:26-31 | python/samples/getting_started_with_agents/azure_ai_agent/step09_azure_ai_agent_mcp.py:21-26 | python/samples/getting_started_with_agents/azure_ai_agent/step10_azure_ai_agent_deep_research.py:32-37 — before extracting anything, compare `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding.py` and `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding_streaming_with_message_callback.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_message_callback.py:59` calls `AzureAIAgentSettings` and `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding.py:39` 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 (5 lines × 14) python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding.py:29— python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding.py:29-33 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding_streaming_with_message_callback.py:34-38 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_deep_research_streaming.py:35-39 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_mcp_streaming.py:20-24 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_message_callback.py:49-53 | python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_message_callback_streaming.py:53-57 | python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback.py:49-53 | python/samples/concepts/agents/openai_assistant/openai_assistant_message_callback_streaming.py:49-53 | python/samples/concepts/agents/openai_responses/responses_agent_message_callback.py:48-52 | python/samples/concepts/agents/openai_responses/responses_agent_message_callback_streaming.py:48-52 | python/samples/getting_started_with_agents/azure_ai_agent/step06_azure_ai_agent_openapi.py:27-31 | python/samples/getting_started_with_agents/azure_ai_agent/step07_azure_ai_agent_retrieval.py:25-29 | python/samples/getting_started_with_agents/azure_ai_agent/step09_azure_ai_agent_mcp.py:20-24 | python/samples/getting_started_with_agents/azure_ai_agent/step10_azure_ai_agent_deep_research.py:31-35 — before extracting anything, compare `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding.py` and `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding_streaming_with_message_callback.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_deep_research_streaming.py:40` calls `isinstance` and `python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_bing_grounding.py:34` 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.
Off the main sequence: Connectors.OpenAI(net10.0) dotnet/src/Connectors/Connectors.OpenAI/Connectors.OpenAI.csproj:1— Connectors.OpenAI(net10.0): abstractness 0.01, instability 0.20, distance 0.79 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Low cohesion: Agent (LCOM4 4) dotnet/src/Agents/Abstractions/Agent.cs:24— Agent's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Dead branch — condition is always false dotnet/src/Experimental/Process.Core/Internal/KernelProcessStateMetadataExtension.cs:82— A branch guarded by a literal `false` can never execute — left-over disabled code. Remove it or restore the real condition.
Blocking `File.ReadAllBytes` inside an `async` method dotnet/src/Plugins/Plugins.Core/CodeInterpreter/SessionsPythonPlugin.cs:136— `File.ReadAllBytes` blocks the thread on I/O while `File.ReadAllBytesAsync` exists to wait without one — inside a method that is already `async`, await the twin.
Blocking `File.WriteAllBytes` inside an `async` method dotnet/src/Plugins/Plugins.Core/CodeInterpreter/SessionsPythonPlugin.cs:183— `File.WriteAllBytes` blocks the thread on I/O while `File.WriteAllBytesAsync` exists to wait without one — inside a method that is already `async`, await the twin.
async void method: PictureBoxOnClickAsync dotnet/samples/Demos/HuggingFaceImageToText/FormMain.cs:100— `async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained.
X18 · Disposal-pattern correctness· Disposable created and abandoned in the method that made it · ×1
Disposable created and abandoned in the method that made it dotnet/samples/Demos/VoiceChat/Services/AudioSourceService.cs:31— `semaphore` is a `SemaphoreSlim`, which implements `IDisposable`, and it is created here (line 31). Every use of it in `GetAudioChunksAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var semaphore = …;`), which releases it at the end of the scope on every path including a throw.
X20 · Mistyped argument guard· Argument guard throws the exception its own condition disproves · ×1
Argument guard throws the exception its own condition disproves dotnet/samples/Demos/TelemetryWithAppInsights/TestConfiguration.cs:45— The guard on line 43 rejects `caller` and line 45 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(caller)` is true of a value that is NOT null: it is satisfied by an EMPTY `caller`, and on that path `caller` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows the empty case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` for the empty case, or split the guard and throw each on its own condition.
Collection crosses a callback boundary unsynchronised dotnet/samples/Demos/VoiceChat/Services/AudioSourceService.cs:45— `GetAudioChunksAsync` hands values from the `waveIn.DataAvailable +=` callback to the body waiting on them through `chunks`, a `Queue<…>` — the callback calls `chunks.Enqueue(…)` on line 45, and the body touches it at line 60. Those two spans provably run on different flows: this body `await`s `semaphore`, which nothing but the callback raises, so the callback cannot be the flow that is waiting for it. The touch is in a loop that waits on `semaphore` on every pass: each wait orders the ONE write it pairs with, and the callback's next write runs while this pass is still reading. `Queue<…>` states that a single writer requires exclusive access to it, and there is none here — `semaphore` is a `SemaphoreSlim`, which orders how MANY items exist and takes no exclusion over the collection's own head, tail and backing array. Two threads therefore mutate those at once, and the failure is not a lost item but a corrupted structure: a torn resize loses or duplicates entries, and an interleaved index update can return an element that was never written. Move the handoff onto something built to be crossed — `System.Collections.Concurrent.ConcurrentQueue<T>` keeps `semaphore` and the shape of the code exactly as they are, and `System.Threading.Channels.Channel<T>` replaces `semaphore` as well — or take a `lock` over every access to `chunks` on both sides.
Orphaned file dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs: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 dotnet/src/Plugins/Plugins.Web/Brave/BraveTextSearch.cs: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 dotnet/src/Experimental/Orchestration.Flow/Execution/FlowExecutor.cs: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 dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs: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 dotnet/src/SemanticKernel.Abstractions/Kernel.cs: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 dotnet/src/Plugins/Plugins.Web/Tavily/TavilyTextSearch.cs: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 dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs: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 dotnet/src/Experimental/Process.Core/ProcessBuilder.cs: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 dotnet/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs: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 dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs: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 dotnet/src/InternalUtilities/src/Diagnostics/ModelDiagnostics.cs: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 dotnet/src/SemanticKernel.Core/Data/TextSearch/VectorStoreTextSearch.cs: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 dotnet/src/Experimental/Process.IntegrationTests.Shared/ProcessTests.cs: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 dotnet/src/Experimental/Process.Core/Workflow/WorkflowBuilder.cs: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 dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProcessActor.cs: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 dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs: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 dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIKernelBuilderExtensions.cs: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 dotnet/src/Agents/Abstractions/AgentChat.cs: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 dotnet/src/Agents/Runtime/InProcess/InProcessRuntime.cs: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 dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs: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 dotnet/src/Experimental/Process.Core/ProcessStepBuilder.cs: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 dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.cs: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 dotnet/src/InternalUtilities/process/Abstractions/DeclarativeConditionEvaluation.cs: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 dotnet/src/SemanticKernel.Core/Text/TextChunker.cs: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 dotnet/src/Experimental/Orchestration.Flow/Execution/ReActEngine.cs: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.
+ 290 more in this group — see findings.md.
D20 · ADR Quality· ADR has no Consequences section · ×51
ADR has no Consequences section docs/decisions/0072-context-based-function-selection.md:11— docs/decisions/0072-context-based-function-selection.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0068-structured-data-connector.md:8— docs/decisions/0068-structured-data-connector.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0067-hybrid-search.md:11— docs/decisions/0067-hybrid-search.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0066-concepts-guidelines.md:9— docs/decisions/0066-concepts-guidelines.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0064-hybrid-model-orchestration.md:8— docs/decisions/0064-hybrid-model-orchestration.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0063-function-calling-reliability.md:9— docs/decisions/0063-function-calling-reliability.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0062-open-api-payload.md:8— docs/decisions/0062-open-api-payload.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0061-function-call-behavior.md:11— docs/decisions/0061-function-call-behavior.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0060-jsos-integration.md:11— docs/decisions/0060-jsos-integration.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0059-text-search.md:11— docs/decisions/0059-text-search.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0056-python-streaming-content-for-token-usage.md:11— docs/decisions/0056-python-streaming-content-for-token-usage.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0055-dotnet-azureopenai-stable-version-strategy.md:10— docs/decisions/0055-dotnet-azureopenai-stable-version-strategy.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0053-dotnet-structured-outputs.md:9— docs/decisions/0053-dotnet-structured-outputs.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0051-entity-framework-as-connector.md:9— docs/decisions/0051-entity-framework-as-connector.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0049-agents-assistantsV2.md:2— docs/decisions/0049-agents-assistantsV2.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0047-azure-open-ai-connectors.md:10— docs/decisions/0047-azure-open-ai-connectors.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0046-kernel-content-graduation.md:10— docs/decisions/0046-kernel-content-graduation.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0046-java-repository-separation.md:8— docs/decisions/0046-java-repository-separation.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0045-breaking-changes-guidance.md:10— docs/decisions/0045-breaking-changes-guidance.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0044-OTel-semantic-convention.md:11— docs/decisions/0044-OTel-semantic-convention.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0043-filters-exception-handling.md:9— docs/decisions/0043-filters-exception-handling.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0042-samples-restructure.md:570— docs/decisions/0042-samples-restructure.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0040-chat-prompt-xml-support.md:11— docs/decisions/0040-chat-prompt-xml-support.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0039-set-plugin-name-in-metadata.md:11— docs/decisions/0039-set-plugin-name-in-metadata.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/decisions/0038-completion-service-selection.md:11— docs/decisions/0038-completion-service-selection.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
+ 26 more in this group — see findings.md.
D20 · ADR Quality· ADR decides a question another record already decided · ×31
ADR decides a question another record already decided docs/decisions/0002-java-folder-structure.md:9— docs/decisions/0002-java-folder-structure.md and docs/decisions/0001-madr-architecture-decisions.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0003-support-multiple-native-function-args.md:10— docs/decisions/0003-support-multiple-native-function-args.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0004-error-handling.md:11— docs/decisions/0004-error-handling.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0005-kernel-hooks-phase1.md:11— docs/decisions/0005-kernel-hooks-phase1.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0008-support-generic-llm-request-settings.md:11— docs/decisions/0008-support-generic-llm-request-settings.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0011-function-and-kernel-result-types.md:10— docs/decisions/0011-function-and-kernel-result-types.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0012-kernel-service-registration.md:11— docs/decisions/0012-kernel-service-registration.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0013-memory-as-plugin.md:10— docs/decisions/0013-memory-as-plugin.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0014-chat-completion-roles-in-prompt.md:11— docs/decisions/0014-chat-completion-roles-in-prompt.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0019-semantic-function-multiple-model-support.md:11— docs/decisions/0019-semantic-function-multiple-model-support.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md:10— docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0025-chat-content-models.md:10— docs/decisions/0025-chat-content-models.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0033-kernel-filters.md:9— docs/decisions/0033-kernel-filters.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md, docs/decisions/0025-chat-content-models.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0035-skfunction-type-descriptions.md:11— docs/decisions/0035-skfunction-type-descriptions.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md, docs/decisions/0025-chat-content-models.md, docs/decisions/0033-kernel-filters.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0038-completion-service-selection.md:11— docs/decisions/0038-completion-service-selection.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md, docs/decisions/0025-chat-content-models.md, docs/decisions/0033-kernel-filters.md, docs/decisions/0035-skfunction-type-descriptions.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0039-set-plugin-name-in-metadata.md:11— docs/decisions/0039-set-plugin-name-in-metadata.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md, docs/decisions/0025-chat-content-models.md, docs/decisions/0033-kernel-filters.md, docs/decisions/0035-skfunction-type-descriptions.md, docs/decisions/0038-completion-service-selection.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0040-chat-prompt-xml-support.md:11— docs/decisions/0040-chat-prompt-xml-support.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0025-chat-content-models.md, docs/decisions/0033-kernel-filters.md, docs/decisions/0035-skfunction-type-descriptions.md, docs/decisions/0038-completion-service-selection.md, docs/decisions/0039-set-plugin-name-in-metadata.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0041-function-call-content.md:11— docs/decisions/0041-function-call-content.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md, docs/decisions/0025-chat-content-models.md, docs/decisions/0033-kernel-filters.md, docs/decisions/0035-skfunction-type-descriptions.md, docs/decisions/0038-completion-service-selection.md, docs/decisions/0039-set-plugin-name-in-metadata.md, docs/decisions/0040-chat-prompt-xml-support.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0043-filters-exception-handling.md:9— docs/decisions/0043-filters-exception-handling.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md, docs/decisions/0025-chat-content-models.md, docs/decisions/0033-kernel-filters.md, docs/decisions/0035-skfunction-type-descriptions.md, docs/decisions/0038-completion-service-selection.md, docs/decisions/0039-set-plugin-name-in-metadata.md, docs/decisions/0040-chat-prompt-xml-support.md, docs/decisions/0041-function-call-content.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0044-OTel-semantic-convention.md:11— docs/decisions/0044-OTel-semantic-convention.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md, docs/decisions/0025-chat-content-models.md, docs/decisions/0033-kernel-filters.md, docs/decisions/0035-skfunction-type-descriptions.md, docs/decisions/0038-completion-service-selection.md, docs/decisions/0039-set-plugin-name-in-metadata.md, docs/decisions/0040-chat-prompt-xml-support.md, docs/decisions/0041-function-call-content.md, docs/decisions/0043-filters-exception-handling.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0046-azure-model-as-a-service.md:11— docs/decisions/0046-azure-model-as-a-service.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md, docs/decisions/0025-chat-content-models.md, docs/decisions/0033-kernel-filters.md, docs/decisions/0035-skfunction-type-descriptions.md, docs/decisions/0038-completion-service-selection.md, docs/decisions/0039-set-plugin-name-in-metadata.md, docs/decisions/0040-chat-prompt-xml-support.md, docs/decisions/0041-function-call-content.md, docs/decisions/0043-filters-exception-handling.md, docs/decisions/0044-OTel-semantic-convention.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0047-azure-open-ai-connectors.md:10— docs/decisions/0047-azure-open-ai-connectors.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md, docs/decisions/0025-chat-content-models.md, docs/decisions/0033-kernel-filters.md, docs/decisions/0035-skfunction-type-descriptions.md, docs/decisions/0038-completion-service-selection.md, docs/decisions/0039-set-plugin-name-in-metadata.md, docs/decisions/0040-chat-prompt-xml-support.md, docs/decisions/0041-function-call-content.md, docs/decisions/0043-filters-exception-handling.md, docs/decisions/0044-OTel-semantic-convention.md, docs/decisions/0046-azure-model-as-a-service.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0052-python-ai-connector-new-abstract-methods.md:11— docs/decisions/0052-python-ai-connector-new-abstract-methods.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md, docs/decisions/0025-chat-content-models.md, docs/decisions/0033-kernel-filters.md, docs/decisions/0035-skfunction-type-descriptions.md, docs/decisions/0038-completion-service-selection.md, docs/decisions/0039-set-plugin-name-in-metadata.md, docs/decisions/0040-chat-prompt-xml-support.md, docs/decisions/0041-function-call-content.md, docs/decisions/0043-filters-exception-handling.md, docs/decisions/0044-OTel-semantic-convention.md, docs/decisions/0046-azure-model-as-a-service.md, docs/decisions/0047-azure-open-ai-connectors.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0054-processes.md:11— docs/decisions/0054-processes.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md, docs/decisions/0025-chat-content-models.md, docs/decisions/0033-kernel-filters.md, docs/decisions/0035-skfunction-type-descriptions.md, docs/decisions/0038-completion-service-selection.md, docs/decisions/0039-set-plugin-name-in-metadata.md, docs/decisions/0040-chat-prompt-xml-support.md, docs/decisions/0041-function-call-content.md, docs/decisions/0043-filters-exception-handling.md, docs/decisions/0044-OTel-semantic-convention.md, docs/decisions/0046-azure-model-as-a-service.md, docs/decisions/0047-azure-open-ai-connectors.md, docs/decisions/0052-python-ai-connector-new-abstract-methods.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
ADR decides a question another record already decided docs/decisions/0055-dotnet-azureopenai-stable-version-strategy.md:10— docs/decisions/0055-dotnet-azureopenai-stable-version-strategy.md and docs/decisions/0001-madr-architecture-decisions.md, docs/decisions/0002-java-folder-structure.md, docs/decisions/0003-support-multiple-native-function-args.md, docs/decisions/0004-error-handling.md, docs/decisions/0005-kernel-hooks-phase1.md, docs/decisions/0008-support-generic-llm-request-settings.md, docs/decisions/0011-function-and-kernel-result-types.md, docs/decisions/0012-kernel-service-registration.md, docs/decisions/0013-memory-as-plugin.md, docs/decisions/0014-chat-completion-roles-in-prompt.md, docs/decisions/0019-semantic-function-multiple-model-support.md, docs/decisions/0020-prompt-syntax-mapping-to-completion-service-model.md, docs/decisions/0025-chat-content-models.md, docs/decisions/0033-kernel-filters.md, docs/decisions/0035-skfunction-type-descriptions.md, docs/decisions/0038-completion-service-selection.md, docs/decisions/0039-set-plugin-name-in-metadata.md, docs/decisions/0040-chat-prompt-xml-support.md, docs/decisions/0041-function-call-content.md, docs/decisions/0043-filters-exception-handling.md, docs/decisions/0044-OTel-semantic-convention.md, docs/decisions/0046-azure-model-as-a-service.md, docs/decisions/0047-azure-open-ai-connectors.md, docs/decisions/0052-python-ai-connector-new-abstract-methods.md, docs/decisions/0054-processes.md are both in force and decide the same question ("These are optional elements. Feel free to remove any of them."), and neither names the other. If this record replaces the earlier one, say so ("Supersedes …") and mark the earlier one superseded; if both hold, state how they relate.
Duplicated predicate dotnet/samples/Demos/ProcessFrameworkWithAspire/ProcessFramework.Aspire/ProcessFramework.Aspire.ServiceDefaults/CommonExtensions.cs:85— `!context.Request.Path.StartsWithSegments(HealthEndpointPath) && !context.Request.Path.StartsWithSegments(AlivenessEndpointPath)` appears character-identically in 2 files — dotnet/samples/Demos/ProcessFrameworkWithAspire/ProcessFramework.Aspire/ProcessFramework.Aspire.ServiceDefaults/CommonExtensions.cs, dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ServiceDefaults/CommonExtensions.cs. 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 dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:355— `!keepAlive || !await this._externalEventChannel.Reader.WaitToReadAsync(cancellationToken).ConfigureAwait(false)` appears character-identically in 2 files — dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs, dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProcessActor.cs. 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 dotnet/src/SemanticKernel.Abstractions/Functions/KernelArguments.cs:103— `!string.IsNullOrWhiteSpace(kv.Value.ServiceId) && kv.Key != kv.Value.ServiceId` appears character-identically in 2 files — dotnet/src/SemanticKernel.Abstractions/Functions/KernelArguments.cs, dotnet/src/SemanticKernel.Abstractions/PromptTemplate/PromptTemplateConfig.cs. 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 dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:101— `!string.IsNullOrWhiteSpace(message.AssistantId) && !agentNames.TryGetValue(message.AssistantId, out assistantName)` appears character-identically in 2 files — dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs, dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs. 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 dotnet/src/Experimental/Process.LocalRuntime/LocalAgentStep.cs:59— `!this._functions.TryGetValue(targetFunction, out KernelFunction? function) || function == null` appears character-identically in 3 files — dotnet/src/Experimental/Process.LocalRuntime/LocalAgentStep.cs, dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs, dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs. 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 dotnet/src/SemanticKernel.Core/AI/ChatCompletion/ChatHistorySummarizationReducer.cs:80— `!thresholdCount.HasValue || thresholdCount > 0` appears character-identically in 2 files — dotnet/src/SemanticKernel.Core/AI/ChatCompletion/ChatHistorySummarizationReducer.cs, dotnet/src/SemanticKernel.Core/AI/ChatCompletion/ChatHistoryTruncationReducer.cs. 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 dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Clients/BedrockTextEmbeddingGenerationClient.cs:101— `(response == null) || (response.Body == null)` appears character-identically in 2 files — dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Clients/BedrockTextEmbeddingGenerationClient.cs, dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Clients/BedrockTextGenerationClient.cs. 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 dotnet/src/SemanticKernel.Core/PromptTemplate/KernelPromptTemplate.cs:47— `allowDangerouslySetContent || promptConfig.AllowDangerouslySetContent` appears character-identically in 2 files — dotnet/src/Extensions/PromptTemplates.Handlebars/Helpers/KernelHelpers/KernelFunctionHelpers.cs, dotnet/src/SemanticKernel.Core/PromptTemplate/KernelPromptTemplate.cs. 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 dotnet/src/Functions/Functions.OpenApi/Serialization/FormStyleParameterSerializer.cs:40— `argument is JsonValue jsonValue && jsonValue.TryGetValue(out string? value)` appears character-identically in 2 files — dotnet/src/Functions/Functions.OpenApi/Serialization/FormStyleParameterSerializer.cs, dotnet/src/Functions/Functions.OpenApi/Serialization/SimpleStyleParameterSerializer.cs. 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 dotnet/src/SemanticKernel.Abstractions/AI/ChatClient/KernelFunctionInvokingChatClient.cs:54— `autoFunctionInvocationFilters is { Count: > 0 } && index < autoFunctionInvocationFilters.Count` appears character-identically in 4 files — dotnet/src/Connectors/Connectors.Google/Core/Gemini/Clients/GeminiChatCompletionClient.cs, dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs, dotnet/src/InternalUtilities/connectors/AI/FunctionCalling/FunctionCallsProcessor.cs, dotnet/src/SemanticKernel.Abstractions/AI/ChatClient/KernelFunctionInvokingChatClient.cs. 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 dotnet/samples/Demos/FunctionInvocationApproval/Program.cs:183— `azureOpenAIOptions is not null && azureOpenAIOptions.IsValid` appears character-identically in 2 files — dotnet/samples/Demos/FunctionInvocationApproval/Program.cs, dotnet/samples/Demos/OpenAIRealtime/Program.cs. 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 dotnet/src/Plugins/Plugins.Core/FileIOPlugin.cs:171— `canonicalDir.StartsWith(canonicalAllowed, PathUtilities.PathComparison) || (canonicalDir + separator).Equals(canonicalAllowed, PathUtilities…` appears character-identically in 2 files — dotnet/src/Plugins/Plugins.Core/FileIOPlugin.cs, dotnet/src/Plugins/Plugins.Web/WebFileDownloadPlugin.cs. 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 dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/Program.cs:97— `config.AIChatService == AzureOpenAIChatConfig.ConfigSectionName || config.Rag.AIEmbeddingService == AzureOpenAIEmbeddingsConfig.ConfigSectio…` appears character-identically in 2 files — dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/Program.cs, dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.AppHost/Program.cs. 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 dotnet/src/SemanticKernel.Core/TemplateEngine/CodeTokenizer.cs:133— `currentChar == Symbols.EscapeChar && CanBeEscaped(nextChar)` appears character-identically in 2 files — dotnet/src/SemanticKernel.Core/TemplateEngine/CodeTokenizer.cs, dotnet/src/SemanticKernel.Core/TemplateEngine/TemplateTokenizer.cs. 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 dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:932— `exception.Status == (int)HttpStatusCode.NotFound && count < 3` appears character-identically in 2 files — dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs, dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs. 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 dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs:213— `i.Value != null && i.Value.All(v => v.Value != null)` appears character-identically in 2 files — dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs, dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs. 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 dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs:214— `i.Value is null || i.Value.Any(v => v.Value is null)` appears character-identically in 2 files — dotnet/src/Experimental/Process.LocalRuntime/LocalStep.cs, dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs. 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 dotnet/src/Agents/AzureAI/AzureAIAgentThread.cs:127— `newMessage.Metadata == null || !newMessage.Metadata.TryGetValue("ThreadId", out var messageThreadId) || !string.Equals(messageThreadId, this…` appears character-identically in 2 files — dotnet/src/Agents/AzureAI/AzureAIAgentThread.cs, dotnet/src/Agents/OpenAI/OpenAIAssistantAgentThread.cs. 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 dotnet/samples/Demos/FunctionInvocationApproval/Program.cs:179— `openAIOptions is not null && openAIOptions.IsValid` appears character-identically in 2 files — dotnet/samples/Demos/FunctionInvocationApproval/Program.cs, dotnet/samples/Demos/OpenAIRealtime/Program.cs. 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 dotnet/src/Extensions/PromptTemplates.Handlebars/HandlebarsPromptTemplate.cs:107— `p.Default is null || (p.Default is string stringDefault && stringDefault.Length == 0)` appears character-identically in 2 files — dotnet/src/Extensions/PromptTemplates.Handlebars/HandlebarsPromptTemplate.cs, dotnet/src/Extensions/PromptTemplates.Liquid/LiquidPromptTemplate.cs. 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 dotnet/src/Plugins/Plugins.Core/FileIOPlugin.cs:188— `path.Length >= 2 && (path[0] is '/' or '\\') && (path[1] is '/' or '\\')` appears character-identically in 4 files — dotnet/src/Plugins/Plugins.Core/FileIOPlugin.cs, dotnet/src/Plugins/Plugins.Document/DocumentPlugin.cs, dotnet/src/Plugins/Plugins.MsGraph/CloudDrivePlugin.cs, dotnet/src/Plugins/Plugins.Web/WebFileDownloadPlugin.cs. 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 dotnet/src/Agents/AzureAI/AzureAIAgent.cs:151— `providersContext.AIFunctions is { Count: > 0 } && !this.UseImmutableKernel` appears character-identically in 4 files — dotnet/src/Agents/AzureAI/AzureAIAgent.cs, dotnet/src/Agents/Core/ChatCompletionAgent.cs, dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs, dotnet/src/Agents/OpenAI/OpenAIResponseAgent.cs. 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 python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:516— `"arguments" in kwargs and kwargs["arguments"] is not None` appears character-identically in 4 files — python/semantic_kernel/agents/azure_ai/azure_ai_agent.py, python/semantic_kernel/agents/chat_completion/chat_completion_agent.py, python/semantic_kernel/agents/open_ai/openai_assistant_agent.py, python/semantic_kernel/agents/open_ai/openai_responses_agent.py. 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 python/semantic_kernel/utils/telemetry/agent_diagnostics/decorators.py:45— `MODEL_DIAGNOSTICS_SETTINGS.enable_otel_diagnostics or MODEL_DIAGNOSTICS_SETTINGS.enable_otel_diagnostics_sensitive` appears character-identically in 2 files — python/semantic_kernel/utils/telemetry/agent_diagnostics/decorators.py, python/semantic_kernel/utils/telemetry/model_diagnostics/decorators.py. 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 python/semantic_kernel/agents/azure_ai/agent_content_generation.py:187— `annotation in delta_block.text.annotations or []` appears character-identically in 2 files — python/semantic_kernel/agents/azure_ai/agent_content_generation.py, python/semantic_kernel/agents/open_ai/assistant_content_generation.py. 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.
Disabled test dotnet/samples/Concepts/AudioToText/OpenAI_AudioToText.cs:18— A test is skipped ("Setup and run TextToAudioAsync before running this test.") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/samples/Concepts/Plugins/CreatePluginFromOpenApiSpec_Jira.cs:36— A test is skipped ("Setup credentials") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/samples/Concepts/Plugins/CreatePluginFromOpenApiSpec_Klarna.cs:16— A test is skipped ("Run it only after filling the template below") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/samples/Concepts/Plugins/ImportPluginFromGrpc.cs:11— A test is skipped ("Setup credentials") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/samples/Concepts/RAG/WithPlugins.cs:79— A test is skipped ("Requires ChatGPT Retrieval Plugin and selected vector DB server up and running") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/samples/Concepts/Search/BingAndGooglePlugins.cs:18— A test is skipped ("Setup Credentials") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/samples/Concepts/TextGeneration/HuggingFace_TextGeneration.cs:82— A test is skipped ("Requires local model or Huggingface Pro subscription") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/samples/Concepts/TextToAudio/OpenAI_TextToAudio.cs:16— A test is skipped ("Uncomment the line to write the audio file output before running this test.") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/samples/Concepts/TextToImage/OpenAI_TextToImageLegacy.cs:83— A test is skipped ("Generating the Image can take too long and often break the test") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/samples/GettingStartedWithAgents/BedrockAgent/Step05_BedrockAgent_FileSearch.cs:41— A test is skipped ("This test is skipped because it requires a valid KnowledgeBaseId.") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/src/Agents/UnitTests/AgentChatTests.cs:97— A test is skipped ("Not 100% reliable for github workflows, but useful for dev testing.") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/src/Connectors/Connectors.Amazon.UnitTests/Services/BedrockChatCompletionServiceTests.cs:78— A test is skipped ("For manual verification only") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/src/Connectors/Connectors.Amazon.UnitTests/Services/BedrockTextEmbeddingGenerationServiceTests.cs:77— A test is skipped ("For manual verification only") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/src/Connectors/Connectors.Amazon.UnitTests/Services/BedrockTextGenerationServiceTests.cs:81— A test is skipped ("For manual verification only") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/src/Connectors/Connectors.Ollama.UnitTests/Services/OllamaChatCompletionTests.cs:699— A test is skipped ("AutoFunctionInvocationFilter is not supported yet") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
Disabled test dotnet/src/Connectors/Connectors.OpenAI.UnitTests/Services/OpenAIChatCompletionServiceTests.cs:1068— A test is skipped ("Not working running in the console") — coverage that looks present but never runs in any gate. If it's an opt-in suite, document how it runs; otherwise re-enable or delete it.
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 configured — defense in depth, even when a reverse proxy could set them. (−2.0 on this card.)
No security response headers detected dotnet/samples/Demos/A2AClientServer/A2AServer/Program.cs:26— This web host's pipeline is composed here and adds no security response header (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, a frame policy) to what it serves.
No security response headers detected dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/Program.cs:33— This web host's pipeline is composed here and adds no security response header (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, a frame policy) to what it serves.
No security response headers detected dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.Web/Program.cs:10— This web host's pipeline is composed here and adds no security response header (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, a frame policy) to what it serves.
No security response headers detected dotnet/samples/Demos/ContentSafety/Program.cs:12— This web host's pipeline is composed here and adds no security response header (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, a frame policy) to what it serves.
No security response headers detected dotnet/samples/Demos/ProcessFrameworkWithAspire/ProcessFramework.Aspire/ProcessFramework.Aspire.ProcessOrchestrator/Program.cs:8— This web host's pipeline is composed here and adds no security response header (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, a frame policy) to what it serves.
No security response headers detected dotnet/samples/Demos/ProcessFrameworkWithAspire/ProcessFramework.Aspire/ProcessFramework.Aspire.SummaryAgent/Program.cs:8— This web host's pipeline is composed here and adds no security response header (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, a frame policy) to what it serves.
No security response headers detected dotnet/samples/Demos/ProcessFrameworkWithAspire/ProcessFramework.Aspire/ProcessFramework.Aspire.TranslatorAgent/Program.cs:8— This web host's pipeline is composed here and adds no security response header (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, a frame policy) to what it serves.
No security response headers detected dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.ProcessOrchestrator/Program.cs:9— This web host's pipeline is composed here and adds no security response header (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, a frame policy) to what it serves.
No security response headers detected dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Grpc/Program.cs:9— This web host's pipeline is composed here and adds no security response header (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, a frame policy) to what it serves.
No security response headers detected dotnet/samples/Demos/ProcessWithDapr/Program.cs:5— This web host's pipeline is composed here and adds no security response header (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, a frame policy) to what it serves.
No security response headers detected dotnet/samples/Demos/StepwisePlannerMigration/Program.cs:14— This web host's pipeline is composed here and adds no security response header (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, a frame policy) to what it serves.
Commented-out code dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs:311— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code dotnet/src/Experimental/Process.Abstractions/KernelProcessEdge.cs:55— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code dotnet/src/Experimental/Process.Core/ProcessStepBuilder.cs:203— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:534— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:535— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:542— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:543— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:546— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:549— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:563— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code dotnet/src/Experimental/Process.LocalRuntime/LocalProcess.cs:564— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
P2 · Observability· Console output used as the logging channel · ×8
Console output used as the logging channel REDACTED:108— `REDACTED` reports through `Console.Write…` at line 108 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel REDACTED:121— `REDACTED` reports through `Console.Write…` at line 121 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel REDACTED:135— `REDACTED` reports through `Console.Write…` at line 135 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel REDACTED:156— `REDACTED` reports through `Console.Write…` at line 156 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel REDACTED:168— `REDACTED` reports through `Console.Write…` at line 168 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel REDACTED:174— `REDACTED` reports through `Console.Write…` at line 174 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel dotnet/src/Plugins/Plugins.StructuredData.EntityFramework/StructuredDataService.cs:131— `dotnet/src/Plugins/Plugins.StructuredData.EntityFramework/StructuredDataService.cs` reports through `Console.Write…` at line 131 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
Console output used as the logging channel dotnet/src/Plugins/Plugins.StructuredData.EntityFramework/StructuredDataService.cs:178— `dotnet/src/Plugins/Plugins.StructuredData.EntityFramework/StructuredDataService.cs` reports through `Console.Write…` at line 178 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
D20 · ADR Quality· ADR has no Decision and Consequences section · ×7
ADR has no Decision and Consequences section docs/decisions/0054-processes.md:11— docs/decisions/0054-processes.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/decisions/0051-dotnet-azure-model-as-a-service.md:10— docs/decisions/0051-dotnet-azure-model-as-a-service.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/decisions/0048-agent-chat-serialization.md:8— docs/decisions/0048-agent-chat-serialization.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/decisions/0046-azure-model-as-a-service.md:11— docs/decisions/0046-azure-model-as-a-service.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/decisions/0036-semantic-kernel-release-versioning.md:10— docs/decisions/0036-semantic-kernel-release-versioning.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/decisions/0032-agents.md:11— docs/decisions/0032-agents.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/decisions/0004-error-handling.md:11— docs/decisions/0004-error-handling.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
Interpolated log message defeats structured logging dotnet/samples/Demos/VoiceChat/Pipeline/VoiceChatPipeline.cs:105— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging dotnet/samples/Demos/VoiceChat/Pipeline/VoiceChatPipeline.cs:112— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging dotnet/samples/Demos/VoiceChat/Services/AudioPlaybackService.cs:40— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging dotnet/samples/Demos/VoiceChat/Services/AudioSourceService.cs:50— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging dotnet/samples/Demos/VoiceChat/Services/ChatService.cs:56— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging dotnet/samples/Demos/VoiceChat/Services/ChatService.cs:64— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
Interpolated log message defeats structured logging dotnet/samples/Demos/VoiceChat/Services/ChatService.cs:72— Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
README/code drift README.md:28— README advertises a microservices architecture, but the repo is a single project with no service manifests — searched for: `microservice`, `service-mesh`, `istio`. 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:112— CONTRIBUTING.md runs `yarn lint:fix`, but no package.json declares a `lint:fix` script. 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:61— README.md installs the package `Microsoft.SemanticKernel` (`dotnet add package Microsoft.SemanticKernel`), but no project or props file references 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:62— README.md installs the package `Microsoft.SemanticKernel.Agents.Core` (`dotnet add package Microsoft.SemanticKernel.Agents.Core`), but no project or props file references 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 dotnet/src/IntegrationTests/README.md:20— dotnet/src/IntegrationTests/README.md names `IntegrationTests/Connectors/Weaviate`, but no file or folder `IntegrationTests/Connectors/Weaviate` 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 dotnet/src/Agents/Copilot/README.md:14— dotnet/src/Agents/Copilot/README.md installs the package `Microsoft.SemanticKernel.Agents.CopilotStudio` (`dotnet add package Microsoft.SemanticKernel.Agents.CopilotStudio --prerelease`), but no project or props file references 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.
DuplicateNoWarn dotnet/samples/Concepts/Concepts.csproj:11— NoWarn IDE1006 is listed more than once for the same build configuration — remove the duplicate.
DuplicateNoWarn dotnet/samples/Concepts/Concepts.csproj:11— NoWarn IDE0009 is listed more than once for the same build configuration — remove the duplicate.
DuplicateNoWarn dotnet/samples/Demos/VoiceChat/VoiceChat.csproj:10— NoWarn CS0718 is listed more than once for the same build configuration — remove the duplicate.
D34 · Knowledge Freshness· Most significant orphaned file · ×3
Most significant orphaned file dotnet/src/Connectors/Connectors.MistralAI/Client/MistralClient.cs:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Most significant orphaned file dotnet/src/Experimental/Process.Abstractions/Serialization/Model/Workflow.cs:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Most significant orphaned file dotnet/src/Agents/AzureAI/Internal/AgentThreadActions.cs:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Silent fallback default in catch dotnet/src/SemanticKernel.Abstractions/Functions/KernelFunction.cs:645— `StartFunctionActivity` swallows `NotSupportedException` into `return "Failed to serialize arguments to Json";` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch dotnet/src/Functions/Functions.OpenApi/Extensions/RestApiOperationResponseExtensions.cs:54— `ValidateJson` swallows `JsonException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch dotnet/src/Functions/Functions.OpenApi/Extensions/RestApiOperationResponseExtensions.cs:75— `ValidateTextHtml` swallows `JsonException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
DuplicateAnalyzerSeverity .editorconfig:177— CA2253 severity is assigned none twice in the same [*.cs] section — here and again at line 178. The later assignment is the one that applies; this one is a duplicate to remove. — both lines say the same thing, so nothing about the build changes either way, but the repetition is what makes the next edit dangerous: whoever changes one of them will believe the change took effect, and the surviving copy will silently keep the old behaviour. Delete this one and leave a single entry for the rule.
DuplicateAnalyzerSeverity dotnet/samples/.editorconfig:8— RCS1110 severity is assigned none twice in the same [*.cs] section — here and again at line 18. The later assignment is the one that applies; this one is a duplicate to remove. — both lines say the same thing, so nothing about the build changes either way, but the repetition is what makes the next edit dangerous: whoever changes one of them will believe the change took effect, and the surviving copy will silently keep the old behaviour. Delete this one and leave a single entry for the rule.
ADR Decision section is empty docs/decisions/0066-concepts-guidelines.md:91— docs/decisions/0066-concepts-guidelines.md:91 heads a Decision section with nothing under it but a placeholder. A decision record states the context that forced it, the decision and its consequences; write what this one's decision are.
ADR Decision section is empty docs/decisions/0021-json-serializable-custom-types.md:124— docs/decisions/0021-json-serializable-custom-types.md:124 heads a Decision section with nothing under it but a placeholder. A decision record states the context that forced it, the decision and its consequences; write what this one's decision are.
D20 · ADR Quality· ADR has no Context and Consequences section · ×2
ADR has no Context and Consequences section docs/decisions/0058-vector-search-design.md:11— docs/decisions/0058-vector-search-design.md has no Context and Consequences section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context and Consequences section docs/decisions/0030-branching-strategy.md:11— docs/decisions/0030-branching-strategy.md has no Context and Consequences section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
Pass-through layer dotnet/src/InternalUtilities/src/Http/HttpResponseStream.cs:14— HttpResponseStream: all 5 public methods forward their arguments unchanged to _stream and add no behaviour — an extra hop (and usually an extra interface) to trace through. Call _stream directly, or give the layer a job.
Pass-through layer dotnet/src/Connectors/Connectors.Google/Services/GoogleAIEmbeddingGenerator.cs:17— GoogleAIEmbeddingGenerator: all 3 public methods forward their arguments unchanged to _generator and add no behaviour — an extra hop (and usually an extra interface) to trace through. Call _generator directly, or give the layer a job.
C2 · Access Controls· No named authorization policies · ×1
No named authorization policies — Authorization IS enforced here (by imperative guard methods that throw on violation) — this is NOT a claim that the code is unprotected. What's missing is a NAMED rule set: the guards encode the access rules inline, so the rules can't be listed, reviewed or tested apart from the call sites that apply them. Recommendation, not a defect.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 7 significant file(s) lose their only recent owner: dotnet/src/Plugins/Plugins.MsGraph/CloudDrivePlugin.cs, dotnet/src/Functions/Functions.OpenApi/Extensions/OpenApiFunctionExecutionParameters.cs, dotnet/src/Plugins/Plugins.AI/CrewAI/Client/CrewAIEnterpriseClient.cs, dotnet/src/Functions/Functions.OpenApi/ServerUrlValidator.cs, dotnet/src/Plugins/Plugins.Document/FileSystem/LocalFileSystemConnector.cs, dotnet/src/InternalUtilities/src/Http/HttpClientExtensions.cs, dotnet/src/Functions/Functions.OpenApi/RestApiOperationServerUrlValidationOptions.cs. Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 7 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 (14 single-owned of 593 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; 593 of the 1108 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)) (+1 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.DependencyInjection.cs, dotnet/src/Connectors/Connectors.Google/GeminiToolCallBehavior.cs, dotnet/src/Agents/Magentic/StandardMagenticManager.cs, dotnet/src/Experimental/Process.LocalRuntime/LocalAgentStep.cs, dotnet/src/Agents/Orchestration/AgentActor.cs, REDACTED, dotnet/src/InternalUtilities/src/Diagnostics/ActivityExtensions.cs.
ADR not followed: These are optional elements. Feel free to remove any of them. docs/decisions/0013-memory-as-plugin.md:34— docs/decisions/0013-memory-as-plugin.md:34 rules out `Kernel` in Memory, but production code uses it: dotnet/src/SemanticKernel.Abstractions/Memory/NullMemory.cs:31, dotnet/src/SemanticKernel.Abstractions/Memory/NullMemory.cs:45, dotnet/src/SemanticKernel.Abstractions/Memory/NullMemory.cs:56, dotnet/src/SemanticKernel.Abstractions/Memory/NullMemory.cs:66, dotnet/src/SemanticKernel.Abstractions/Memory/NullMemory.cs:79 (+14 more)
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 153 project(s) overshoot their size bounds, lowering Project Cohesion to 9.9/10. The most over is `SemanticKernel.Abstractions(net10.0)` (15083 LoC, 133 public types across 13 namespaces). Review these for cohesion — draw the boundary inside the assembly first (group each responsibility into its own namespace/folder and keep the cross-boundary members internal), since splitting a published assembly moves types between packages and breaks consumers.
Concentrated knowledge decay — 318 of 593 significant files have no living knowledge, while the repository is still being changed at a low rate (63 commit(s) in the last 90 days) — so this is one repo-wide knowledge-decay state, not 318 separate risks. Counted over 593 of the 1108 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. The code moved on without the people who understood these files: document them or schedule a read-through before the next change lands in them.
No src/ separation — Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
Inconsistent root namespaces — Only 50/153 projects share a common root namespace — the code's module identity is inconsistent.
P12 · CI test-gate honesty· Sleep-based test synchronization · ×1
Sleep-based test synchronization — 19 Task.Delay/Thread.Sleep call(s) in test code synchronize with background work by sleeping — a known flakiness precursor on slow runners. Prefer polling with a deadline or completion signals.
Logging is not universal — Only 63/94 service-like projects use logging (pure contract/DTO projects are excluded — they have nothing to log). Of those 94, 45 ship a process this repository operates; the rest are libraries their consumer hosts, where the logging decision belongs to the host.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
PF1 · Benchmark discipline· No performance benchmarks · ×1
No performance benchmarks — No benchmark suite was found by the two searches this check runs. FIRST, a BenchmarkDotNet package reference in any project file — every project the workspace loaded, plus a walk of project files on disk that never loaded, because a benchmark suite is exactly the project a partial load drops. SECOND, a script harness: a file whose name contains `benchmark` and ends `.py`, `.sh`, `.ps1`, `.bash`, `.rb`, `.js` or `.mjs`, credited ONLY when this repository's CI text also mentions benchmarks — a harness no pipeline runs is read as a fixture, deliberately. Neither search can see a benchmark suite in another ecosystem's idiom (a Go `testing.B` file, a JMH or criterion project, a pytest-benchmark run), so this is 'no benchmark found by those two searches', not a verdict that the repository has none. Where code is performance-sensitive, a benchmark guards against silent regressions — but it's a bonus here, not a deduction.
X2 · Cancellation propagation· Not all async methods take a CancellationToken · ×1
Not all async methods take a CancellationToken — Only 528/843 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
Null-forgiving operator (`!`) suppressions reduce the NRT score — ~1.4 `!` suppressions per 1k syntax nodes — 664 suppression(s) across the 478695 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide.
Skipped (documented): AudioToTextAsync dotnet/samples/Concepts/AudioToText/OpenAI_AudioToText.cs:18— Skipped with a documented reason — a deferral, not lazy debt: Setup and run TextToAudioAsync before running this test.
Skipped (documented): RunAsync dotnet/samples/Concepts/Plugins/CreatePluginFromOpenApiSpec_Jira.cs:36— Skipped with a documented reason — a deferral, not lazy debt: Setup credentials
Skipped (documented): InvokeOpenApiPluginAsync dotnet/samples/Concepts/Plugins/CreatePluginFromOpenApiSpec_Klarna.cs:16— Skipped with a documented reason — a deferral, not lazy debt: Run it only after filling the template below
Skipped (documented): RunAsync dotnet/samples/Concepts/Plugins/ImportPluginFromGrpc.cs:11— Skipped with a documented reason — a deferral, not lazy debt: Setup credentials
Skipped (documented): RAGWithChatGPTRetrievalPluginAsync dotnet/samples/Concepts/RAG/WithPlugins.cs:79— Skipped with a documented reason — a deferral, not lazy debt: Requires ChatGPT Retrieval Plugin and selected vector DB server up and running
Skipped (documented): RunAsync dotnet/samples/Concepts/Search/BingAndGooglePlugins.cs:18— Skipped with a documented reason — a deferral, not lazy debt: Setup Credentials
Skipped (documented): RunLlamaExampleAsync dotnet/samples/Concepts/TextGeneration/HuggingFace_TextGeneration.cs:82— Skipped with a documented reason — a deferral, not lazy debt: Requires local model or Huggingface Pro subscription
Skipped (documented): TextToAudioAsync dotnet/samples/Concepts/TextToAudio/OpenAI_TextToAudio.cs:16— Skipped with a documented reason — a deferral, not lazy debt: Uncomment the line to write the audio file output before running this test.
Skipped (documented): AzureOpenAIDallEAsync dotnet/samples/Concepts/TextToImage/OpenAI_TextToImageLegacy.cs:83— Skipped with a documented reason — a deferral, not lazy debt: Generating the Image can take too long and often break the test
Skipped (documented): UseAgentWithFileSearch dotnet/samples/GettingStartedWithAgents/BedrockAgent/Step05_BedrockAgent_FileSearch.cs:41— Skipped with a documented reason — a deferral, not lazy debt: This test is skipped because it requires a valid KnowledgeBaseId.
Skipped (documented): InvokeTestAsync dotnet/src/IntegrationTests/Agents/BedrockAgentTests.cs:39— Skipped with a documented reason — a deferral, not lazy debt: This test is for manual verification.
Skipped (documented): InvokeStreamingTestAsync dotnet/src/IntegrationTests/Agents/BedrockAgentTests.cs:61— Skipped with a documented reason — a deferral, not lazy debt: This test is for manual verification.
Skipped (documented): InvokeWithCodeInterpreterTestAsync dotnet/src/IntegrationTests/Agents/BedrockAgentTests.cs:83— Skipped with a documented reason — a deferral, not lazy debt: This test is for manual verification.
Skipped (documented): InvokeWithKernelFunctionTestAsync dotnet/src/IntegrationTests/Agents/BedrockAgentTests.cs:120— Skipped with a documented reason — a deferral, not lazy debt: This test is for manual verification.
Skipped (documented): InvokeWithKernelFunctionTestComplexTypesAsync dotnet/src/IntegrationTests/Agents/BedrockAgentTests.cs:149— Skipped with a documented reason — a deferral, not lazy debt: This test is for manual verification.
Skipped (documented): OnNewMessageWithServiceFailureThrowsAgentOperationExceptionAsync dotnet/src/IntegrationTests/Agents/CommonInterfaceConformance/AgentThreadConformance/BedrockAgentThreadTests.cs:12— Skipped with a documented reason — a deferral, not lazy debt: This test is for manual verification.
Skipped (documented): DeletingThreadTwiceDoesNotThrowAsync dotnet/src/IntegrationTests/Agents/CommonInterfaceConformance/AgentThreadConformance/BedrockAgentThreadTests.cs:19— Skipped with a documented reason — a deferral, not lazy debt: This test is for manual verification.
Skipped (documented): UsingThreadAfterDeleteThrowsAsync dotnet/src/IntegrationTests/Agents/CommonInterfaceConformance/AgentThreadConformance/BedrockAgentThreadTests.cs:25— Skipped with a documented reason — a deferral, not lazy debt: This test is for manual verification.
Skipped (documented): DeleteThreadBeforeCreateThrowsAsync dotnet/src/IntegrationTests/Agents/CommonInterfaceConformance/AgentThreadConformance/BedrockAgentThreadTests.cs:31— Skipped with a documented reason — a deferral, not lazy debt: This test is for manual verification.
Skipped (documented): UsingThreadBeforeCreateCreatesAsync dotnet/src/IntegrationTests/Agents/CommonInterfaceConformance/AgentThreadConformance/BedrockAgentThreadTests.cs:37— Skipped with a documented reason — a deferral, not lazy debt: This test is for manual verification.
Skipped (documented): DeleteThreadWithServiceFailureThrowsAgentOperationExceptionAsync dotnet/src/IntegrationTests/Agents/CommonInterfaceConformance/AgentThreadConformance/BedrockAgentThreadTests.cs:43— Skipped with a documented reason — a deferral, not lazy debt: This test is for manual verification.
Skipped (documented): OnNewMessageWithServiceFailureThrowsAgentOperationExceptionAsync dotnet/src/IntegrationTests/Agents/CommonInterfaceConformance/AgentThreadConformance/OpenAIResponseAgentThreadTests.cs:12— Skipped with a documented reason — a deferral, not lazy debt: Temporarily disabled until the OpenAI API key and credits are restored.
Skipped (documented): UsingThreadBeforeCreateCreatesAsync dotnet/src/IntegrationTests/Agents/CommonInterfaceConformance/AgentThreadConformance/OpenAIResponseAgentThreadTests.cs:19— Skipped with a documented reason — a deferral, not lazy debt: Temporarily disabled until the OpenAI API key and credits are restored.
Skipped (documented): DeletingThreadTwiceDoesNotThrowAsync dotnet/src/IntegrationTests/Agents/CommonInterfaceConformance/AgentThreadConformance/OpenAIResponseAgentThreadTests.cs:26— Skipped with a documented reason — a deferral, not lazy debt: Temporarily disabled until the OpenAI API key and credits are restored.
Skipped (documented): UsingThreadAfterDeleteThrowsAsync dotnet/src/IntegrationTests/Agents/CommonInterfaceConformance/AgentThreadConformance/OpenAIResponseAgentThreadTests.cs:32— Skipped with a documented reason — a deferral, not lazy debt: Temporarily disabled until the OpenAI API key and credits are restored.
Off the main sequence: SemanticKernel.Core(net10.0) dotnet/src/SemanticKernel.Core/SemanticKernel.Core.csproj:1— SemanticKernel.Core(net10.0): abstractness 0.04, instability 0.03, distance 0.93 — 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.
Off the main sequence: SemanticKernel.Abstractions(net10.0) dotnet/src/SemanticKernel.Abstractions/SemanticKernel.Abstractions.csproj:1— SemanticKernel.Abstractions(net10.0): abstractness 0.19, instability 0.00, distance 0.81 — 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.
Off the main sequence: Agents.Abstractions(net10.0) dotnet/src/Agents/Abstractions/Agents.Abstractions.csproj:1— Agents.Abstractions(net10.0): abstractness 0.12, instability 0.08, distance 0.79 — 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.
Off the main sequence: Runtime.Abstractions(net10.0) dotnet/src/Agents/Runtime/Abstractions/Runtime.Abstractions.csproj:1— Runtime.Abstractions(net10.0): abstractness 0.25, instability 0.00, distance 0.75 — 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.
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 76 file(s) — `dotnet/src/Agents/Abstractions/AggregatorAgent.cs`, `dotnet/src/Agents/Abstractions/AggregatorChannel.cs`, `dotnet/src/Agents/Abstractions/Internal/ChannelReference.cs`, `dotnet/src/Agents/Abstractions/Serialization/ChatMessageReference.cs`, `dotnet/src/Agents/AzureAI/AzureAIChannel.cs`, … (+71 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a16737-5e5c-7c27-b4e2-080851f6f4e5 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Appendix C — Personal-data map
Every field, property and record parameter whose name is conventional personal data — 1 field(s) across 1 category, each with an exact repo-relative file:line. This is the data inventory a compliance review starts from — right-to-erasure, retention, minimisation. Detected by NAME, from the C# syntax tree, with a deliberately specific identifier classifier — the same one the C1–C5 compliance cards use to decide whether personal data is present, so CardDefinition or FileName don't trip. Two caveats stated rather than glossed: those cards additionally require corroboration (a persistence/account signal, or two distinct PII categories) that this inventory deliberately does not, so it lists more than they gate on; and D32 Data Compliance shares nothing with it — that dimension is a separate semgrep ruleset for personal data leaking into logs, URLs and browser storage, and a clean D32 result says nothing about this list. Informational — it feeds no score.
Issues: 319 · Warnings: 1404 · Recommendations: 535 · Info: 645 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 23-10-2026 @ 05:24 UTC.
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.