Public report of crewAIInc/crewAI, published 25 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, 25 October 2026, 05:41 UTC · Survey ID cd_1e123654a53e471890126b8807ce6831
crewAIInc/crewAI
Measured 25 October 2026, 05:32 UTC, at code version 38db11e
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.
Test reliability is not measured: The suite could not be re-run, but the repository declares tests of its own unreliable.
CAI scoreAt riskDown 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: 299,041 lines of product code in 10 projects, tests not counted · Estimated rebuild effort: about 2.6 person-years · Weakest lens: Accessibility, 24
Findings by how serious they are
32 critical1079 serious192 minor
12 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
25 October 2026, 05:32 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.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
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 ▸
67of 71 dimensions measured by tools. The other 4 are advisory notes from an AI model, which explain the code but don't count towards the score.
1280of 1303 findings point to an exact file and line, so you can open each one in the code. The other 23 concern the repository as a whole, such as missing documentation.
71dimensions across 7 lenses, read from 299,041 lines of product code in 10 projects.
crewAIInc/crewAI scores 41 out of 100, but it is rated At risk while a critical security finding is open; the score itself is unchanged.
The weakest lens counts most in the score, and here that is Accessibility, which scores 24 and is rated Critical. Its Forms & labels dimension scores 1 out of 10, and until that reaches 4, Accessibility can't be rated higher than Adequate. The first actions are to give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label and to make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href, and if Accessibility rose to 70, the score would rise from 41 to about 54.
32 findings are critical: ten in Static Analysis (SAST), seven in Keyboard semantics, six in Dependency Vulnerabilities, five in Knowledge Freshness, two in Forms & labels and two in Test Reliability.
Watchdog couldn't measure 12 dimensions in this code, among them Code Coverage, Navigability and Data Protection, so they are left out of the score. The product code is 299,041 lines, which would take an estimated 2.6 person-years, around €370,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.
Outbound HTTP resilience · Outbound HTTP without resilience lib/crewai-files/src/crewai_files/core/sources.py
Outbound HTTP resilience · Outbound HTTP without resilience lib/crewai-files/src/crewai_files/core/sources.py
Visual & motion safety · Animation without a prefers-reduced-motion guard lib/crewai/src/crewai/flow/visualization/assets/style.css
Visual & motion safety · Animation without a prefers-reduced-motion guard lib/crewai/src/crewai/flow/visualization/assets/style.css
Visual & motion safety · Animation without a prefers-reduced-motion guard lib/crewai/src/crewai/flow/visualization/assets/style.css
Visual & motion safety · Animation without a prefers-reduced-motion guard lib/crewai/src/crewai/flow/visualization/assets/style.css
Visual & motion safety · Animation without a prefers-reduced-motion guard lib/crewai/src/crewai/flow/visualization/assets/style.css
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: 148 findings
These 148 critical or serious findings were in the previous survey, on 11 October 2026, and are gone from this one. The first 100 are listed here.
€120,000 to €620,000, for 2,067 to 6,556 hours of work, about 2.6 person-years for 1 to 5 engineers
Difficulty of the problem
Standard, 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.7 at a score of 41. 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: 299,041 lines of product code
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Raises the score by about 5 points · Medium effort · Forms & labels
2
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 1 point · Low effort · ADR Quality
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €370,000 to build again, about 2.6 person-years of work. Its weakest lens is Accessibility, at 24 (Critical). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
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 6.6 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 8% on every change. The history of the code shows how much it changes: about 4,341,343 lines over the last 90 days, which is about 17,606,558 lines a year. At that pace, the extra work comes to an estimated 1569.7 to 9418.5 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.
652 modules, with 585 dependencies between them. One loop runs through 3 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 612 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.
crewai-tools.src.crewai_tools.rag.base_loader uses crewai-tools.src.crewai_tools.rag.source_content, so a change to crewai-tools.src.crewai_tools.rag.source_content can break crewai-tools.src.crewai_tools.rag.base_loader, while a change to crewai-tools.src.crewai_tools.rag.base_loader can't break crewai-tools.src.crewai_tools.rag.source_content.
Position
Below the diagonal: crewai-tools.src.crewai_tools.rag.base_loader uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agents.agent_builder.base_agent uses crewai.src.crewai.state.runtime, so a change to crewai.src.crewai.state.runtime can break crewai.src.crewai.agents.agent_builder.base_agent, while a change to crewai.src.crewai.agents.agent_builder.base_agent can't break crewai.src.crewai.state.runtime.
Position
Below the diagonal: crewai.src.crewai.agents.agent_builder.base_agent uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agents.agent_builder.base_agent uses crewai.src.crewai.utilities.logger, so a change to crewai.src.crewai.utilities.logger can break crewai.src.crewai.agents.agent_builder.base_agent, while a change to crewai.src.crewai.agents.agent_builder.base_agent can't break crewai.src.crewai.utilities.logger.
Position
Below the diagonal: crewai.src.crewai.agents.agent_builder.base_agent uses a module listed above it, which is the healthy direction.
crewai.src.crewai.events.event_bus uses crewai.src.crewai.events.base_events, so a change to crewai.src.crewai.events.base_events can break crewai.src.crewai.events.event_bus, while a change to crewai.src.crewai.events.event_bus can't break crewai.src.crewai.events.base_events.
Position
Below the diagonal: crewai.src.crewai.events.event_bus uses a module listed above it, which is the healthy direction.
crewai.src.crewai.events.event_bus uses crewai.src.crewai.state.runtime, so a change to crewai.src.crewai.state.runtime can break crewai.src.crewai.events.event_bus, while a change to crewai.src.crewai.events.event_bus can't break crewai.src.crewai.state.runtime.
Position
Below the diagonal: crewai.src.crewai.events.event_bus uses a module listed above it, which is the healthy direction.
crewai.src.crewai.flow uses crewai.src.crewai.flow.flow_definition, so a change to crewai.src.crewai.flow.flow_definition can break crewai.src.crewai.flow, while a change to crewai.src.crewai.flow can't break crewai.src.crewai.flow.flow_definition.
Position
Below the diagonal: crewai.src.crewai.flow uses a module listed above it, which is the healthy direction.
crewai.src.crewai.flow uses crewai.src.crewai.utilities.types, so a change to crewai.src.crewai.utilities.types can break crewai.src.crewai.flow, while a change to crewai.src.crewai.flow can't break crewai.src.crewai.utilities.types.
Position
Below the diagonal: crewai.src.crewai.flow uses a module listed above it, which is the healthy direction.
crewai.src.crewai.flow.runtime uses crewai.src.crewai.flow.flow_definition, so a change to crewai.src.crewai.flow.flow_definition can break crewai.src.crewai.flow.runtime, while a change to crewai.src.crewai.flow.runtime can't break crewai.src.crewai.flow.flow_definition.
Position
Below the diagonal: crewai.src.crewai.flow.runtime uses a module listed above it, which is the healthy direction.
crewai.src.crewai.flow.runtime uses crewai.src.crewai.types.usage_metrics, so a change to crewai.src.crewai.types.usage_metrics can break crewai.src.crewai.flow.runtime, while a change to crewai.src.crewai.flow.runtime can't break crewai.src.crewai.types.usage_metrics.
Position
Below the diagonal: crewai.src.crewai.flow.runtime uses a module listed above it, which is the healthy direction.
crewai.src.crewai.knowledge.source.base_file_knowledge_source uses crewai.src.crewai.utilities.logger, so a change to crewai.src.crewai.utilities.logger can break crewai.src.crewai.knowledge.source.base_file_knowledge_source, while a change to crewai.src.crewai.knowledge.source.base_file_knowledge_source can't break crewai.src.crewai.utilities.logger.
Position
Below the diagonal: crewai.src.crewai.knowledge.source.base_file_knowledge_source uses a module listed above it, which is the healthy direction.
crewai.src.crewai.lite_agent_output uses crewai.src.crewai.types.usage_metrics, so a change to crewai.src.crewai.types.usage_metrics can break crewai.src.crewai.lite_agent_output, while a change to crewai.src.crewai.lite_agent_output can't break crewai.src.crewai.types.usage_metrics.
Position
Below the diagonal: crewai.src.crewai.lite_agent_output uses a module listed above it, which is the healthy direction.
crewai.src.crewai.llms.base_llm uses crewai.src.crewai.types.usage_metrics, so a change to crewai.src.crewai.types.usage_metrics can break crewai.src.crewai.llms.base_llm, while a change to crewai.src.crewai.llms.base_llm can't break crewai.src.crewai.types.usage_metrics.
Position
Below the diagonal: crewai.src.crewai.llms.base_llm uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agents.step_executor uses crewai.src.crewai.agents.parser, so a change to crewai.src.crewai.agents.parser can break crewai.src.crewai.agents.step_executor, while a change to crewai.src.crewai.agents.step_executor can't break crewai.src.crewai.agents.parser.
Position
Below the diagonal: crewai.src.crewai.agents.step_executor uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agents.step_executor uses crewai.src.crewai.utilities.types, so a change to crewai.src.crewai.utilities.types can break crewai.src.crewai.agents.step_executor, while a change to crewai.src.crewai.agents.step_executor can't break crewai.src.crewai.utilities.types.
Position
Below the diagonal: crewai.src.crewai.agents.step_executor uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agents.step_executor uses crewai.src.crewai.agents.agent_builder.base_agent, so a change to crewai.src.crewai.agents.agent_builder.base_agent can break crewai.src.crewai.agents.step_executor, while a change to crewai.src.crewai.agents.step_executor can't break crewai.src.crewai.agents.agent_builder.base_agent.
Position
Below the diagonal: crewai.src.crewai.agents.step_executor uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agents.step_executor uses crewai.src.crewai.llms.base_llm, so a change to crewai.src.crewai.llms.base_llm can break crewai.src.crewai.agents.step_executor, while a change to crewai.src.crewai.agents.step_executor can't break crewai.src.crewai.llms.base_llm.
Position
Below the diagonal: crewai.src.crewai.agents.step_executor uses a module listed above it, which is the healthy direction.
crewai.src.crewai.flow.flow uses crewai.src.crewai.flow.runtime, so a change to crewai.src.crewai.flow.runtime can break crewai.src.crewai.flow.flow, while a change to crewai.src.crewai.flow.flow can't break crewai.src.crewai.flow.runtime.
Position
Below the diagonal: crewai.src.crewai.flow.flow uses a module listed above it, which is the healthy direction.
crewai.src.crewai.llm uses crewai.src.crewai.llms.base_llm, so a change to crewai.src.crewai.llms.base_llm can break crewai.src.crewai.llm, while a change to crewai.src.crewai.llm can't break crewai.src.crewai.llms.base_llm.
Position
Below the diagonal: crewai.src.crewai.llm uses a module listed above it, which is the healthy direction.
crewai.src.crewai.task uses crewai.src.crewai.tasks.task_output, so a change to crewai.src.crewai.tasks.task_output can break crewai.src.crewai.task, while a change to crewai.src.crewai.task can't break crewai.src.crewai.tasks.task_output.
Position
Below the diagonal: crewai.src.crewai.task uses a module listed above it, which is the healthy direction.
crewai.src.crewai.task uses crewai.src.crewai.agents.agent_builder.base_agent, so a change to crewai.src.crewai.agents.agent_builder.base_agent can break crewai.src.crewai.task, while a change to crewai.src.crewai.task can't break crewai.src.crewai.agents.agent_builder.base_agent.
Position
Below the diagonal: crewai.src.crewai.task uses a module listed above it, which is the healthy direction.
crewai.src.crewai.telemetry.tracing uses crewai.src.crewai.events.event_bus, so a change to crewai.src.crewai.events.event_bus can break crewai.src.crewai.telemetry.tracing, while a change to crewai.src.crewai.telemetry.tracing can't break crewai.src.crewai.events.event_bus.
Position
Below the diagonal: crewai.src.crewai.telemetry.tracing uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agents.agent_executor uses crewai.src.crewai.agents.parser, so a change to crewai.src.crewai.agents.parser can break crewai.src.crewai.agents.agent_executor, while a change to crewai.src.crewai.agents.agent_executor can't break crewai.src.crewai.agents.parser.
Position
Below the diagonal: crewai.src.crewai.agents.agent_executor uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agents.agent_executor uses crewai.src.crewai.utilities.types, so a change to crewai.src.crewai.utilities.types can break crewai.src.crewai.agents.agent_executor, while a change to crewai.src.crewai.agents.agent_executor can't break crewai.src.crewai.utilities.types.
Position
Below the diagonal: crewai.src.crewai.agents.agent_executor uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agents.agent_executor uses crewai.src.crewai.flow.flow, so a change to crewai.src.crewai.flow.flow can break crewai.src.crewai.agents.agent_executor, while a change to crewai.src.crewai.agents.agent_executor can't break crewai.src.crewai.flow.flow.
Position
Below the diagonal: crewai.src.crewai.agents.agent_executor uses a module listed above it, which is the healthy direction.
crewai.src.crewai.crew uses crewai.src.crewai.tasks.task_output, so a change to crewai.src.crewai.tasks.task_output can break crewai.src.crewai.crew, while a change to crewai.src.crewai.crew can't break crewai.src.crewai.tasks.task_output.
Position
Below the diagonal: crewai.src.crewai.crew uses a module listed above it, which is the healthy direction.
crewai.src.crewai.crew uses crewai.src.crewai.types.usage_metrics, so a change to crewai.src.crewai.types.usage_metrics can break crewai.src.crewai.crew, while a change to crewai.src.crewai.crew can't break crewai.src.crewai.types.usage_metrics.
Position
Below the diagonal: crewai.src.crewai.crew uses a module listed above it, which is the healthy direction.
crewai.src.crewai.crew uses crewai.src.crewai.utilities.logger, so a change to crewai.src.crewai.utilities.logger can break crewai.src.crewai.crew, while a change to crewai.src.crewai.crew can't break crewai.src.crewai.utilities.logger.
Position
Below the diagonal: crewai.src.crewai.crew uses a module listed above it, which is the healthy direction.
crewai.src.crewai.crew uses crewai.src.crewai.agents.agent_builder.base_agent, so a change to crewai.src.crewai.agents.agent_builder.base_agent can break crewai.src.crewai.crew, while a change to crewai.src.crewai.crew can't break crewai.src.crewai.agents.agent_builder.base_agent.
Position
Below the diagonal: crewai.src.crewai.crew uses a module listed above it, which is the healthy direction.
crewai.src.crewai.crew uses crewai.src.crewai.task, so a change to crewai.src.crewai.task can break crewai.src.crewai.crew, while a change to crewai.src.crewai.crew can't break crewai.src.crewai.task.
Position
Below the diagonal: crewai.src.crewai.crew uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agent.core uses crewai.src.crewai.types.usage_metrics, so a change to crewai.src.crewai.types.usage_metrics can break crewai.src.crewai.agent.core, while a change to crewai.src.crewai.agent.core can't break crewai.src.crewai.types.usage_metrics.
Position
Below the diagonal: crewai.src.crewai.agent.core uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agent.core uses crewai.src.crewai.agents.agent_builder.base_agent, so a change to crewai.src.crewai.agents.agent_builder.base_agent can break crewai.src.crewai.agent.core, while a change to crewai.src.crewai.agent.core can't break crewai.src.crewai.agents.agent_builder.base_agent.
Position
Below the diagonal: crewai.src.crewai.agent.core uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agent.core uses crewai.src.crewai.lite_agent_output, so a change to crewai.src.crewai.lite_agent_output can break crewai.src.crewai.agent.core, while a change to crewai.src.crewai.agent.core can't break crewai.src.crewai.lite_agent_output.
Position
Below the diagonal: crewai.src.crewai.agent.core uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agent.core uses crewai.src.crewai.llms.base_llm, so a change to crewai.src.crewai.llms.base_llm can break crewai.src.crewai.agent.core, while a change to crewai.src.crewai.agent.core can't break crewai.src.crewai.llms.base_llm.
Position
Below the diagonal: crewai.src.crewai.agent.core uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agent.core uses crewai.src.crewai.task, so a change to crewai.src.crewai.task can break crewai.src.crewai.agent.core, while a change to crewai.src.crewai.agent.core can't break crewai.src.crewai.task.
Position
Below the diagonal: crewai.src.crewai.agent.core uses a module listed above it, which is the healthy direction.
crewai.src.crewai.agent.core uses crewai.src.crewai.agents.agent_executor, so a change to crewai.src.crewai.agents.agent_executor can break crewai.src.crewai.agent.core, while a change to crewai.src.crewai.agent.core can't break crewai.src.crewai.agents.agent_executor.
Position
Below the diagonal: crewai.src.crewai.agent.core uses a module listed above it, which is the healthy direction.
crewai.src.crewai.a2a uses crewai.src.crewai.a2a.task_helpers, so a change to crewai.src.crewai.a2a.task_helpers can break crewai.src.crewai.a2a, while a change to crewai.src.crewai.a2a can't break crewai.src.crewai.a2a.task_helpers.
Position
Below the diagonal: crewai.src.crewai.a2a uses a module listed above it, which is the healthy direction.
crewai.src.crewai.a2a uses crewai.src.crewai.lite_agent_output, so a change to crewai.src.crewai.lite_agent_output can break crewai.src.crewai.a2a, while a change to crewai.src.crewai.a2a can't break crewai.src.crewai.lite_agent_output.
Position
Below the diagonal: crewai.src.crewai.a2a uses a module listed above it, which is the healthy direction.
crewai.src.crewai.a2a uses crewai.src.crewai.task, so a change to crewai.src.crewai.task can break crewai.src.crewai.a2a, while a change to crewai.src.crewai.a2a can't break crewai.src.crewai.task.
Position
Below the diagonal: crewai.src.crewai.a2a uses a module listed above it, which is the healthy direction.
crewai.src.crewai.a2a uses crewai.src.crewai.agent.core, so a change to crewai.src.crewai.agent.core can break crewai.src.crewai.a2a, while a change to crewai.src.crewai.a2a can't break crewai.src.crewai.agent.core.
Position
Below the diagonal: crewai.src.crewai.a2a uses a module listed above it, which is the healthy direction.
crewai.src.crewai.a2a.utils uses crewai.src.crewai.a2a.task_helpers, so a change to crewai.src.crewai.a2a.task_helpers can break crewai.src.crewai.a2a.utils, while a change to crewai.src.crewai.a2a.utils can't break crewai.src.crewai.a2a.task_helpers.
Position
Below the diagonal: crewai.src.crewai.a2a.utils uses a module listed above it, which is the healthy direction.
crewai.src.crewai.a2a.utils uses crewai.src.crewai.task, so a change to crewai.src.crewai.task can break crewai.src.crewai.a2a.utils, while a change to crewai.src.crewai.a2a.utils can't break crewai.src.crewai.task.
Position
Below the diagonal: crewai.src.crewai.a2a.utils uses a module listed above it, which is the healthy direction.
crewai.src.crewai.a2a.utils uses crewai.src.crewai.crew, so a change to crewai.src.crewai.crew can break crewai.src.crewai.a2a.utils, while a change to crewai.src.crewai.a2a.utils can't break crewai.src.crewai.crew.
Position
Below the diagonal: crewai.src.crewai.a2a.utils uses a module listed above it, which is the healthy direction.
crewai.src.crewai.a2a.utils uses crewai.src.crewai.agent.core, so a change to crewai.src.crewai.agent.core can break crewai.src.crewai.a2a.utils, while a change to crewai.src.crewai.a2a.utils can't break crewai.src.crewai.agent.core.
Position
Below the diagonal: crewai.src.crewai.a2a.utils uses a module listed above it, which is the healthy direction.
crewai.src.crewai.utilities uses crewai.src.crewai.agents.parser, so a change to crewai.src.crewai.agents.parser can break crewai.src.crewai.utilities, while a change to crewai.src.crewai.utilities can't break crewai.src.crewai.agents.parser.
Position
Below the diagonal: crewai.src.crewai.utilities uses a module listed above it, which is the healthy direction.
crewai.src.crewai.utilities uses crewai.src.crewai.events.base_events, so a change to crewai.src.crewai.events.base_events can break crewai.src.crewai.utilities, while a change to crewai.src.crewai.utilities can't break crewai.src.crewai.events.base_events.
Position
Below the diagonal: crewai.src.crewai.utilities uses a module listed above it, which is the healthy direction.
crewai.src.crewai.utilities uses crewai.src.crewai.utilities.types, so a change to crewai.src.crewai.utilities.types can break crewai.src.crewai.utilities, while a change to crewai.src.crewai.utilities can't break crewai.src.crewai.utilities.types.
Position
Below the diagonal: crewai.src.crewai.utilities uses a module listed above it, which is the healthy direction.
crewai.src.crewai.utilities uses crewai.src.crewai.llms.base_llm, so a change to crewai.src.crewai.llms.base_llm can break crewai.src.crewai.utilities, while a change to crewai.src.crewai.utilities can't break crewai.src.crewai.llms.base_llm.
Position
Below the diagonal: crewai.src.crewai.utilities uses a module listed above it, which is the healthy direction.
crewai.src.crewai.utilities uses crewai.src.crewai.llm, so a change to crewai.src.crewai.llm can break crewai.src.crewai.utilities, while a change to crewai.src.crewai.utilities can't break crewai.src.crewai.llm.
Position
Below the diagonal: crewai.src.crewai.utilities uses a module listed above it, which is the healthy direction.
crewai.src.crewai.utilities uses crewai.src.crewai.task, so a change to crewai.src.crewai.task can break crewai.src.crewai.utilities, while a change to crewai.src.crewai.utilities can't break crewai.src.crewai.task.
Position
Below the diagonal: crewai.src.crewai.utilities uses a module listed above it, which is the healthy direction.
crewai.src.crewai.utilities uses crewai.src.crewai.crew, so a change to crewai.src.crewai.crew can break crewai.src.crewai.utilities, while a change to crewai.src.crewai.utilities can't break crewai.src.crewai.crew.
Position
Below the diagonal: crewai.src.crewai.utilities uses a module listed above it, which is the healthy direction.
crewai.src.crewai.utilities uses crewai.src.crewai.agent.core, so a change to crewai.src.crewai.agent.core can break crewai.src.crewai.utilities, while a change to crewai.src.crewai.utilities can't break crewai.src.crewai.agent.core.
Position
Below the diagonal: crewai.src.crewai.utilities uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 60% · Adequate · gated by D2, X4 ·
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
18
High / Critical
A03:2025 — Software Supply Chain Failures
10
High / Critical
Roadmap
First, ensure all form controls, buttons, and interactive elements have proper programmatic labels and keyboard operability, while replacing placeholders with real text and fixing anchor links. Next, add descriptive text alternatives for all images, media, and custom graphics to guarantee content is accessible to screen readers. Finally, automate the deployment process for repeatable releases and integrate accessibility checks into the test suite to prevent regressions from reaching production.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Automate the release in CI — a deploy stage for a service (Helm/Kubernetes manifests or an equivalent rollout), or a tag-triggered publish job for an artifact — so releases are repeatable and reversible.
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
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 — 32
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 — 1079
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 — 192
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 12
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. 67 of 71 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 71 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, 1280 of 1303 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: test source is present (.py) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository declares 2 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.py), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `lib/cli/src/crewai_cli/templates/crew/crew.py`, `lib/cli/src/crewai_cli/templates/crew/main.py`, `lib/cli/src/crewai_cli/templates/flow/main.py`, `lib/cli/src/crewai_cli/templates/tool/src/{{folder_name}}/__init__.py`, `lib/cli/src/crewai_cli/templates/tool/src/{{folder_name}}/tool.py` 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.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXB1 Runtime evidence locked — no reproducible boot — 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. Subject: 3 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'sqlite3' is imported (lib/cli/src/crewai_cli/task_outputs.py:13), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'sqlite3' is imported (lib/cli/src/crewai_cli/task_outputs.py:13), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'sqlite3' is imported (lib/cli/src/crewai_cli/task_outputs.py:13), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 173 further occurrence(s) are not listed individually; the score already reflects all 213.
P8 Schema migrations — 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. The schema may be created by a runner, a deploy script or a config file outside what this check reads, so an absence here is our blind spot rather than a missing migration strategy. The card abstains instead of scoring. You can widen what we reach: if the schema is created and evolved by a tool this check does not name, naming it lets us teach the detector to read it.
X3 Exception handling — 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. 72 further occurrence(s) are not listed individually; the score already reflects all 112.
X4 Structured logging — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 303 further occurrence(s) are not listed individually; the score already reflects all 343.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
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.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
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.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (4): D19, D21, D22, 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.
181 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was DatabricksQueryTool._run at 143. A further 1 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being EmbeddingService._build_provider_config at 19 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: lib/crewai-tools/src/crewai_tools/rag/embedding_service.py (EmbeddingService._build_provider_config at 19). 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.
+ 172 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with DatabricksQueryTool._run (cyclomatic 143), LLM._handle_streaming_response (cyclomatic 81), Flow.kickoff_async (cyclomatic 66). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cyclomatic Complexity from 5.0 to about 6.1/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
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.
+ 353 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 DatabricksQueryTool._run (cognitive 470), LLM._handle_streaming_response (cognitive 138). — 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 2.0 to about 2.4/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes9.2 / 10Stronggated by 62 serious findings✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 45 FileTooLong finding(s) in God Classes — start with completion.py (5), REDACTED (2), handlers.py. — One of this dimension's main actionable groups (45 warning-level).
Resolve the 15 TooManyMethods finding(s) in God Classes — start with completion.py (5), agent_executor.py, crew_run_tui.py. — One of this dimension's main actionable groups (15 warning-level).
Resolve the 2 ClassTooLong finding(s) in God Classes — start with interactive.js (2). — One of this dimension's main actionable groups (2 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.
339 duplicated block group(s) detected. A further 20 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 164 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 14 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with handler.py (3), run_crew.py (2), llm.py (2). — One of this dimension's main actionable groups (14 warning-level).
Resolve the 12 Duplicated block (16 lines × 2) finding(s) in Code Duplication — start with completion.py (3), crew_run_tui.py, resolver.py. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 12 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with console_formatter.py (3), eval_crew.py, bedrock.py. — One of this dimension's main actionable groups (12 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.7 / 10Strong✓ 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.
6 production modules (Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence.
Off the main sequence: crewai-core
What to do
Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with agent_executor.py, core.py. — One of this dimension's main actionable groups (2 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
7958 test methods: 7829 unit, 126 integration, 0 BDD, 3 e2e. The Python suite contributes 7958 test function(s) across 430 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.
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.
0 outdated, 0 yanked pinned Python distributions. 3 of 54 shipped distributions were graded against pypi.org (0 not published there, 51 declared without an exact pin, which installs the newest release the declaration admits and so cannot be behind one). Only EXACT pins are graded for currency: a floor or a range already installs the newest release it admits, so reporting one would report this repository for being current. Whether a deliberate upper cap has itself gone stale is a different and weaker question, and is not asked. Whether any distribution is UNMAINTAINED is not graded — PyPI publishes no maintenance status, and release age does not stand in for one. Lockfiles are not read (poetry.lock, REDACTED, Pipfile.lock, pdm.lock), so a lock-resolved install is outside this verdict. Known CVEs in this dependency graph are D30's question.
What to do
Maintain Dependency Hygiene — already on the Gold path. — No findings, and enforcement is at this dimension's ceiling.
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 164 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 54 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (110 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 16 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged.
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.
Top hotspots: lib/crewai/src/crewai/llm.py (19×81=1539); lib/crewai/src/crewai/flow/runtime/__init__.py (19×66=1254); lib/crewai/src/crewai/agents/agent_executor.py (13×45=585) Repeated repair below the complexity floor: lib/crewai/src/crewai/telemetry/tracing/grants.py (4 of 7 changes were fixes); lib/crewai/src/crewai/agents/step_executor.py (3 of 5 changes were fixes); REDACTED (3 of 5 changes were fixes)
Resolve the 19 Hotspot finding(s) in Churn × Complexity Hotspots — start with completion.py (2), llm.py, __init__.py. — One of this dimension's main actionable groups (19 warning-level).
Resolve the 5 Repeated repair finding(s) in Churn × Complexity Hotspots — start with grants.py, step_executor.py, REDACTED. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.7 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
58 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is lib/cli/src/crewai_cli/experimental/eval_crew.py. Counted over 458 of the 956 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 · ×6
Further sole-owners (lower concentration)
What to do
Resolve the 6 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (6 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
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.
13 deducted task-comment markers across 299041 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 12 TodoComment finding(s) in Explicit Debt — start with brave_search_tool.py (2), misc.py, process.py. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 1 HackComment finding(s) in Explicit Debt — start with llamaindex_tool.py. — One of this dimension's main actionable groups (1 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
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: a strong branding banner with Trendshift repo badge, an overview of CrewAI as a multi-agent orchestration framework, and links to every major asset (homepage, docs, cloud trial, blog, forum). The lib/cli/README provides installation instructions for the CLI tool that pulls in crewai-core transitively, distinguishing commands requiring vs not requiring crewai. The lib/crewai-core/README is a shared-utilities leaf with no dependency on the main framework; it documents its own directory and does not contradict the root README's overview of CrewAI as an orchestration suite. All visible documents are well structured per their directories — none is missing installation, usage, or architecture docs despite the summary noting only architecture/Docs markdown files exist. The READMEs for contextualai-create-agent-tool, contextualai-parse-tool, and contextualai-query-tool each document their respective directories (tools/crewai-tools/src/crewai_tools/tools/contextualai_*) rather than the repository root, so they are scoped to those subdirectories. The three tools share a consistent structure: an overview describing what the tool does, installation with a Contextual AI API key note pointing to app.contextual.ai, an example showing how to run it (with placeholder values), parameters table including defaults and output types, key features, and use cases. All sections are present in the visible outline; no clipped section is flagged as missing. (9 of 25 sampled documents could not be assessed: 1 of 3 evaluation groups failed.)
Documentation: no project overview · ×2README.md
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
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.
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 0 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.
5 API inconsistencies across a 400-member sample of 122 exposed types.
Duplicate intent with divergent signatures. `cli.train_crew` takes no arguments (likely relying on defaults or context), while `train_crew.train_crew` requires explicit `n_iterations` and `filename`. This creates confusion about whether the user should call the CLI wrapper or the underlying function directly.
Severe naming and functional inconsistency. `cli.evaluate_crew` and `cli.eval_crew` appear to be duplicate CLI commands for the same operation. Furthermore, the underlying implementations (`evaluate_crew` vs `eval_crew`) have completely different signatures and responsibilities (one takes iterations/model, the other takes run_id/args). This suggests a copy-paste error or legacy code remnants where two different evaluation flows were not merged.
Typo in CLI command name. `cli.deply_status` is a typo for `deploy_status`. This breaks the consistency of the `deploy_*` namespace (e.g., `deploy_create`, `deploy_list`, `deploy_push`).
Inconsistent parameter naming and structure. The CLI command `cli.checkpoint` takes a `location` argument, but the underlying `checkpoint_cli` functions use `location` for some (`list`, `resume`) and `path` for others (`info`). Additionally, `cli.checkpoint` is a generic entry point that likely dispatches, but the underlying functions are not consistently named as sub-commands (e.g., `list_checkpoints` vs `info_checkpoint`).
Minor inconsistency in naming convention. The CLI command uses snake_case (`tool_create`), while the underlying command class uses camelCase (`create`). While this is a common pattern in CLI frameworks (kebab-case to snake_case to camelCase), the presence of `cli.tool_install` vs `ToolCommand.install` shows a mix. It is better to be consistent across the board.
What to do
Resolve the 1 Duplicate intent with divergent signatures. `cli.train_crew` takes no… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Severe naming and functional inconsistency. `cli.evaluate_crew` and… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Typo in CLI command name. `cli.deply_status` is a typo for… 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?
D26 · Project Cohesion4.0 / 10Weak✓ Tool-verified
What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.
3 of 10 build units (Python) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
18 finding(s): 0 critical, 10 high, 6 medium, 2 low. semgrep hit a parse error in 5 file(s) — `lib/cli/src/crewai_cli/templates/crew/crew.py` (line 7), `lib/cli/src/crewai_cli/templates/crew/main.py`, `lib/cli/src/crewai_cli/templates/flow/main.py` (line 8), `lib/cli/src/crewai_cli/templates/tool/src/{{folder_name}}/__init__.py` (lines 1–3), `lib/cli/src/crewai_cli/templates/tool/src/{{folder_name}}/tool.py` (line 4) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 7 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
+ 6 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5). — One of this dimension's main actionable groups (5 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
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 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 3 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-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.
56 of 458 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is lib/crewai/src/crewai/a2a/extensions/a2ui/v0_9.py. Counted over 458 of the 956 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 5 Orphaned knowledge finding(s) in Knowledge Freshness — start with v0_9.py, handler.py, server_schemes.py. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 51 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED (4), base.py (3), bedrock.py (2). — One of this dimension's main actionable groups (51 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
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 core.py, tools_handler.py. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with __init__.py. — One of this dimension's main actionable groups (1 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.
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 2 platform declaration(s) and 54 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives3.5 / 10Weak✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. — lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:19
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels1.0 / 10Critical✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. — lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:141
This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:142
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Do you agree with this assessment?
AC3 · Page structure4.3 / 10Weak✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:2
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
The repo's own CSS styles .accordion-subheader with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — lib/crewai/src/crewai/flow/visualization/assets/interactive.js:1761
The repo's own CSS styles .nav-button with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. (×6) — lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:49, lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:52, lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:55, …
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
`#legend-panel` moves (`transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, right 0.3s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — lib/crewai/src/crewai/flow/visualization/assets/style.css:206
`#drawer` moves (`transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, box-shadow 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — lib/crewai/src/crewai/flow/visualization/assets/style.css:395
`.code-copy-button svg` moves (`transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — lib/crewai/src/crewai/flow/visualization/assets/style.css:819
`.accordion-icon` moves (`transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — lib/crewai/src/crewai/flow/visualization/assets/style.css:940
`.accordion-content` moves (`transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — lib/crewai/src/crewai/flow/visualization/assets/style.css:951
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 3 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
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.
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.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
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.md runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:219
lib/crewai-tools/README.md links to `./assets/crewai_logo.png`, but `lib/crewai-tools/assets/crewai_logo.png` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — lib/crewai-tools/README.md:3
lib/crewai/README.md runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — lib/crewai/README.md:189
docs/edge/ar/installation.mdx runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ar/installation.mdx:75
docs/edge/ar/introduction.mdx links to `/ar/guides/flows/first-flow`, but `ar/guides/flows/first-flow` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ar/introduction.mdx:14
docs/edge/ar/introduction.mdx links to `/ar/guides/crews/first-crew`, but `ar/guides/crews/first-crew` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ar/introduction.mdx:15
docs/edge/ar/quickstart.mdx links to `/ar/installation`, but `ar/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ar/quickstart.mdx:18
docs/edge/ar/quickstart.mdx links to `/ar/guides/flows/first-flow`, but `ar/guides/flows/first-flow` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ar/quickstart.mdx:201
docs/edge/ar/quickstart.mdx links to `/ar/concepts/flows`, but `ar/concepts/flows` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ar/quickstart.mdx:201
docs/edge/ar/quickstart.mdx links to `/ar/concepts/crews`, but `ar/concepts/crews` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ar/quickstart.mdx:201
docs/edge/ar/quickstart.mdx links to `/ar/concepts/agents#direct-agent-interaction-with-kickoff`, but `ar/concepts/agents` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ar/quickstart.mdx:201
docs/edge/ar/telemetry.mdx links to `/ar/observability/tracing`, but `ar/observability/tracing` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ar/telemetry.mdx:27
docs/edge/en/installation.mdx runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/en/installation.mdx:190
docs/edge/en/installation.mdx links to `/en/guides/migration/upgrading-crewai`, but `en/guides/migration/upgrading-crewai` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/en/installation.mdx:225
docs/edge/en/introduction.mdx links to `/en/guides/flows/first-flow`, but `en/guides/flows/first-flow` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/en/introduction.mdx:14
docs/edge/en/introduction.mdx links to `/en/guides/crews/first-crew`, but `en/guides/crews/first-crew` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/en/introduction.mdx:15
docs/edge/en/quickstart.mdx links to `/en/installation`, but `en/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/en/quickstart.mdx:18
docs/edge/ko/installation.mdx runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ko/installation.mdx:68
docs/edge/ko/introduction.mdx links to `/ko/guides/flows/first-flow`, but `ko/guides/flows/first-flow` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ko/introduction.mdx:14
docs/edge/ko/introduction.mdx links to `/ko/guides/crews/first-crew`, but `ko/guides/crews/first-crew` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ko/introduction.mdx:15
docs/edge/ko/quickstart.mdx links to `/ko/installation`, but `ko/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ko/quickstart.mdx:18
docs/edge/ko/quickstart.mdx links to `/ko/guides/flows/first-flow`, but `ko/guides/flows/first-flow` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ko/quickstart.mdx:201
docs/edge/ko/quickstart.mdx links to `/ko/concepts/flows`, but `ko/concepts/flows` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ko/quickstart.mdx:201
docs/edge/ko/quickstart.mdx links to `/ko/concepts/crews`, but `ko/concepts/crews` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ko/quickstart.mdx:201
docs/edge/ko/quickstart.mdx links to `/ko/concepts/agents#direct-agent-interaction-with-kickoff`, but `ko/concepts/agents` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ko/quickstart.mdx:201
docs/edge/ko/telemetry.mdx links to `/ko/observability/tracing`, but `ko/observability/tracing` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/ko/telemetry.mdx:26
docs/edge/pt-BR/installation.mdx runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/pt-BR/installation.mdx:68
docs/edge/pt-BR/introduction.mdx links to `/pt-BR/guides/flows/first-flow`, but `pt-BR/guides/flows/first-flow` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/pt-BR/introduction.mdx:14
docs/edge/pt-BR/introduction.mdx links to `/pt-BR/guides/crews/first-crew`, but `pt-BR/guides/crews/first-crew` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/pt-BR/introduction.mdx:15
docs/edge/pt-BR/quickstart.mdx links to `/pt-BR/installation`, but `pt-BR/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/pt-BR/quickstart.mdx:18
docs/edge/pt-BR/quickstart.mdx links to `/pt-BR/guides/flows/first-flow`, but `pt-BR/guides/flows/first-flow` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/pt-BR/quickstart.mdx:201
docs/edge/pt-BR/quickstart.mdx links to `/pt-BR/concepts/flows`, but `pt-BR/concepts/flows` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/pt-BR/quickstart.mdx:201
docs/edge/pt-BR/quickstart.mdx links to `/pt-BR/concepts/crews`, but `pt-BR/concepts/crews` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/pt-BR/quickstart.mdx:201
docs/edge/pt-BR/quickstart.mdx links to `/pt-BR/concepts/agents#direct-agent-interaction-with-kickoff`, but `pt-BR/concepts/agents` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/pt-BR/quickstart.mdx:201
docs/edge/pt-BR/telemetry.mdx links to `/pt-BR/observability/tracing`, but `pt-BR/observability/tracing` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/edge/pt-BR/telemetry.mdx:27
docs/v1.10.0/en/installation.mdx runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/v1.10.0/en/installation.mdx:67
docs/v1.10.0/en/introduction.mdx links to `/en/guides/flows/first-flow`, but `en/guides/flows/first-flow` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/v1.10.0/en/introduction.mdx:14
docs/v1.10.0/en/introduction.mdx links to `/en/guides/crews/first-crew`, but `en/guides/crews/first-crew` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/v1.10.0/en/introduction.mdx:15
docs/v1.10.0/en/quickstart.mdx links to `/en/installation`, but `en/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/v1.10.0/en/quickstart.mdx:13
docs/v1.10.0/en/quickstart.mdx links to `/images/enterprise/crew-studio-interface.png`, but `images/enterprise/crew-studio-interface.png` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/v1.10.0/en/quickstart.mdx:225
What to do
Reconcile the README with reality: README.md runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist; lib/crewai-tools/README.md links to `./assets/crewai_logo.png`, but `lib/crewai-tools/assets/crewai_logo.png` does not exist; lib/crewai/README.md runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist; docs/edge/ar/installation.mdx runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist; docs/edge/ar/introduction.mdx links to `/ar/guides/flows/first-flow`, but `ar/guides/flows/first-flow` does not exist.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability7.9 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 5/8 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `lib/cli/src/crewai_cli/templates/crew`, `lib/cli/src/crewai_cli/templates/flow`, `lib/devtools`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
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 `github-actions`, `pip` — add those `package-ecosystem` entries 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.
No release automation was found in CI — neither a deploy stage (Helm/Kubernetes/compose manifests, an orchestrated rollout) nor a publish job that ships the built artifact. Releases appear to be run by hand, which is slower, less repeatable and harder to reverse.
What to do
Automate the release in CI — a deploy stage for a service (Helm/Kubernetes manifests or an equivalent rollout), or a tag-triggered publish job for an artifact — so releases are repeatable and reversible.
Do you agree with this assessment?
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`httpx.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — lib/cli/src/crewai_cli/skills/main.py:133, lib/crewai-files/src/crewai_files/core/sources.py:533, lib/crewai/src/crewai/skills/registry.py:365
`httpx.AsyncClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — lib/crewai-files/src/crewai_files/core/sources.py:545, lib/crewai/src/crewai/a2a/auth/server_schemes.py:588
`requests.post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — lib/crewai-tools/src/crewai_tools/tools/generate_crewai_automation_tool/generate_crewai_automation_tool.py:52
`urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — REDACTED:1721
What to do
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
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.
Other · Security — Only what this repository's own non-C# files could be read for was assessed — markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.
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.
`https://unpkg.com/lucide@latest` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 3 such include(s) across the repository's markup. — lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:9
What to do
Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception. — lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py:572
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 document2.2 / 10Critical✓ Tool-verified
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.
`render_schema_type` is public and takes `field_schema: dict[str, Any]` from its caller, and it calls itself at line 470 (`self.render_schema_type`) with a piece of `field_schema` (and at line 480, line 489) — and nowhere in `render_schema_type` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `render_schema_type` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:470
`contains_python_reference` is public and takes `value: Any` from its caller, and it calls itself at line 604 (`contains_python_reference`) with a piece of `value` (and at line 607) — and nowhere in `contains_python_reference` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `contains_python_reference` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:604
`force_additional_properties_false` is public and takes `d: Any` from its caller, and it calls itself at line 212 (`force_additional_properties_false`) with a piece of `d` (and at line 218) — and nowhere in `force_additional_properties_false` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `force_additional_properties_false` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:212
`strip_unsupported_formats` is public and takes `d: Any` from its caller, and it calls itself at line 258 (`strip_unsupported_formats`) with a piece of `d` (and at line 264) — and nowhere in `strip_unsupported_formats` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `strip_unsupported_formats` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:258
`ensure_type_in_schemas` is public and takes `d: Any` from its caller, and it calls itself at line 294 (`ensure_type_in_schemas`) with a piece of `d` (and at line 296, line 302) — and nowhere in `ensure_type_in_schemas` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `ensure_type_in_schemas` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:294
`convert_oneof_to_anyof` is public and takes `schema: dict[str, Any]` from its caller, and it calls itself at line 411 (`convert_oneof_to_anyof`) with a piece of `schema` (and at line 418) — and nowhere in `convert_oneof_to_anyof` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `convert_oneof_to_anyof` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:411
`ensure_all_properties_required` is public and takes `schema: dict[str, Any]` from its caller, and it calls itself at line 452 (`ensure_all_properties_required`) with a piece of `schema` (and at line 459) — and nowhere in `ensure_all_properties_required` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `ensure_all_properties_required` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:452
`strip_null_from_types` is public and takes `schema: dict[str, Any]` from its caller, and it calls itself at line 505 (`strip_null_from_types`) with a piece of `schema` (and at line 512) — and nowhere in `strip_null_from_types` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `strip_null_from_types` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:505
`create_model_from_schema` is public, takes a document from its caller (line 811) and hands it to `_json_schema_to_pydantic_type`, which calls itself at line 1173 (`_json_schema_to_pydantic_type`) with a piece of `json_schema` (and at line 1193, line 1207, line 1223, line 1266) — and nowhere in `_json_schema_to_pydantic_type` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_json_schema_to_pydantic_type` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:1173
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
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.
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 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.
`debug` at line 94 is called with an argument built by `json.dumps(payload, indent = 2)` (line 94), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — lib/crewai-tools/src/crewai_tools/tools/merge_agent_handler_tool/merge_agent_handler_tool.py:94
`debug` at line 1111 is called with an argument built by `json.dumps(current_tool_use)` (line 1112), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1111
What to do
In Python, put the construction behind the logger's own check (`if logger.isEnabledFor(logging.DEBUG):`), or pass the collection itself with a `%s` placeholder (`logger.debug("Items %s", items)`) so the logging module renders it only when the record is emitted. The placeholder alone is not the fix when the argument is still built first: it defers the formatting, not a `json.dumps`, a `join` or a comprehension in the argument, and an f-string defers nothing at all.
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.
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.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
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.
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. (×18) — conftest.py:201, lib/cli/src/crewai_cli/crew_run_tui.py:91, lib/cli/src/crewai_cli/crew_run_tui.py:975, …
`except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×22) — lib/cli/src/crewai_cli/tui_picker.py:27, lib/cli/src/crewai_cli/run_declarative_flow.py:443, lib/cli/src/crewai_cli/kickoff_flow.py:18, …
What to do
Swallowed exception (empty catch)
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.
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.
`info` at line 106 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-core/src/crewai_core/settings.py:106
`debug` at line 188 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/upload_cache.py:188
`debug` at line 304 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/upload_cache.py:304
`debug` at line 366 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/upload_cache.py:366
`debug` at line 380 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/upload_cache.py:380
`debug` at line 550 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/upload_cache.py:550
`debug` at line 50 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:50
`warning` at line 52 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:52
`warning` at line 55 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:55
`warning` at line 88 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:88
`info` at line 99 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:99
`debug` at line 137 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:137
`warning` at line 163 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:163
`warning` at line 174 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:174
`info` at line 182 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:182
`debug` at line 215 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:215
`warning` at line 217 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:217
`warning` at line 220 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:220
`warning` at line 265 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:265
`info` at line 279 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:279
`debug` at line 319 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:319
`warning` at line 353 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:353
`warning` at line 374 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:374
`info` at line 386 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/cache/cleanup.py:386
`debug` at line 101 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/validators.py:101
`debug` at line 145 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/validators.py:145
`info` at line 75 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/transformers.py:75
`info` at line 143 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/transformers.py:143
`info` at line 217 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/transformers.py:217
`info` at line 275 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/transformers.py:275
`warning` at line 310 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/transformers.py:310
`warning` at line 335 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/transformers.py:335
`warning` at line 65 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/processor.py:65
`error` at line 153 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/processor.py:153
`error` at line 219 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/processor.py:219
`warning` at line 250 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/processor.py:250
`warning` at line 257 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/processor.py:257
`warning` at line 295 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/processor.py:295
`warning` at line 301 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/processor.py:301
`warning` at line 325 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — lib/crewai-files/src/crewai_files/processing/processor.py:325
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
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.
D11 Test Reliability — 2 observation(s) recorded · This repository declares 2 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.py), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 15 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: this repository stores data through 'sqlite3' (lib/cli/src/crewai_cli/task_outputs.py:13) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and MongoEngine model fields, Alembic and Django migration columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
C4 Data Retention — Not assessed: this repository stores data through 'sqlite3' (lib/cli/src/crewai_cli/task_outputs.py:13) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and mongoengine model fields, Alembic and Django migration columns, SQL schemas). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'sqlite3' (lib/cli/src/crewai_cli/task_outputs.py:13) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and mongoengine model fields, Alembic and Django migration columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
Not included — 43 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.
AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D10 Test Quality — ~139474 lines of test source are present (.py) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.py), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 5 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
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.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 442 value object(s); 171 domain event(s); its domain events are published by services or handlers — no domain entity raises one
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P8 Schema migrations — SQLAlchemy is declared, but the schema-migration mechanism could not be identified. Our limit, not a verdict on this repository.
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) 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
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a pytest-benchmark or pytest-codspeed dependency with tests taking the `benchmark` fixture, an asv.conf.json with its `time_`/`mem_`/`peakmem_` benchmarks, or a pyperf Runner, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not applicable: Python runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
X2 Cancellation propagation — no C# was loaded; this repository's Python was read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Critical — 32 finding(s)
AC4 · Keyboard semantics· Clickable element isn't keyboard-operable · ×7
Clickable element isn't keyboard-operable lib/crewai/src/crewai/flow/visualization/assets/interactive.js:1761— The repo's own CSS styles .accordion-subheader with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:49— The repo's own CSS styles .nav-button with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:52— The repo's own CSS styles .nav-button with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:55— The repo's own CSS styles .nav-button with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:58— The repo's own CSS styles .nav-button with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:61— The repo's own CSS styles .nav-button with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:64— The repo's own CSS styles .nav-button with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Orphaned knowledge lib/crewai/src/crewai/a2a/extensions/a2ui/v0_9.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge lib/crewai/src/crewai/a2a/updates/streaming/handler.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge lib/crewai/src/crewai/a2a/auth/server_schemes.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge lib/crewai-files/src/crewai_files/uploaders/openai.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge lib/crewai/src/crewai/rag/qdrant/client.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
D11 · Test Reliability· Test declared unreliable · ×2
Test declared unreliable: test_llm_call_when_stop_is_unsupported lib/crewai/tests/test_llm.py:760— This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Highly flaky on ci". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
Test declared unreliable: test_llm_call_when_stop_is_unsupported_when_additional_drop_params_is_provided lib/crewai/tests/test_llm.py:771— This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Highly flaky on ci". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
AC2 · Forms & labels· <label> that labels no control · ×1
<label> that labels no control lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:141— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels· <select> without a programmatic label · ×1
<select> without a programmatic label lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:142— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
FileTooLong: tracing/handlers.py lib/crewai/src/crewai/telemetry/tracing/handlers.py— FileTooLong — 2587 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2087 over it, 5.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: runtime/__init__.py lib/crewai/src/crewai/flow/runtime/__init__.py— FileTooLong — 2544 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2044 over it, 5.09× 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: crewai_cli/crew_run_tui.py lib/cli/src/crewai_cli/crew_run_tui.py— FileTooLong — 2432 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1932 over it, 4.86× 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_executor.py lib/crewai/src/crewai/agents/agent_executor.py— FileTooLong — 2347 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1847 over it, 4.69× 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: openai/completion.py lib/crewai/src/crewai/llms/providers/openai/completion.py— FileTooLong — 2155 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1655 over it, 4.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: crewai/llm.py lib/crewai/src/crewai/llm.py— FileTooLong — 1885 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1385 over it, 3.77× 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: crewai/crew.py lib/crewai/src/crewai/crew.py— FileTooLong — 1754 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1254 over it, 3.51× 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: REDACTED REDACTED— FileTooLong — 1691 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1191 over it, 3.38× 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: assets/interactive.js lib/crewai/src/crewai/flow/visualization/assets/interactive.js— FileTooLong — 1689 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 1189 over it, 3.38× 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: experimental/eval_crew.py lib/cli/src/crewai_cli/experimental/eval_crew.py— FileTooLong — 1681 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1181 over it, 3.36× 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: bedrock/completion.py lib/crewai/src/crewai/llms/providers/bedrock/completion.py— FileTooLong — 1625 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1125 over it, 3.25× 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: project/json_loader.py lib/crewai/src/crewai/project/json_loader.py— FileTooLong — 1625 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1125 over it, 3.25× 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: anthropic/completion.py lib/crewai/src/crewai/llms/providers/anthropic/completion.py— FileTooLong — 1469 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 969 over it, 2.94× 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: agent/core.py lib/crewai/src/crewai/agent/core.py— FileTooLong — 1374 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 874 over it, 2.75× 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: utils/console_formatter.py lib/crewai/src/crewai/events/utils/console_formatter.py— FileTooLong — 1373 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 873 over it, 2.75× 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: a2a/wrapper.py lib/crewai/src/crewai/a2a/wrapper.py— FileTooLong — 1230 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 730 over it, 2.46× 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: utilities/agent_utils.py lib/crewai/src/crewai/utilities/agent_utils.py— FileTooLong — 1159 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 659 over it, 2.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: crewai/task.py lib/crewai/src/crewai/task.py— FileTooLong — 1133 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 633 over it, 2.27× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: flow/conversational_mixin.py lib/crewai/src/crewai/flow/conversational_mixin.py— FileTooLong — 1104 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 604 over it, 2.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: gemini/completion.py lib/crewai/src/crewai/llms/providers/gemini/completion.py— FileTooLong — 1085 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 585 over it, 2.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: crewai_cli/create_json_crew.py lib/cli/src/crewai_cli/create_json_crew.py— FileTooLong — 1047 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 547 over it, 2.09× 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: crewai_cli/cli.py lib/cli/src/crewai_cli/cli.py— FileTooLong — 1010 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 510 over it, 2.02× 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/completion.py lib/crewai/src/crewai/llms/providers/azure/completion.py— FileTooLong — 959 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 459 over it, 1.92× 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: tools/tool_usage.py lib/crewai/src/crewai/tools/tool_usage.py— FileTooLong — 852 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 352 over it, 1.70× 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: tracing/trace_listener.py lib/crewai/src/crewai/events/listeners/tracing/trace_listener.py— FileTooLong — 821 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 321 over it, 1.64× 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.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/tui_picker.py:27— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/run_declarative_flow.py:443— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/kickoff_flow.py:18— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/kickoff_flow.py:44— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/crew_run_tui.py:1211— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/crew_run_tui.py:1226— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/crew_run_tui.py:1241— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/crew_run_tui.py:1712— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/cli.py:121— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/cli.py:315— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/checkpoint_cli.py:256— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/checkpoint_cli.py:300— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/deploy/validate.py:298— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/deploy/main.py:354— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/deploy/main.py:393— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/deploy/main.py:469— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/cli/src/crewai_cli/skills/main.py:419— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/crewai-core/src/crewai_core/settings.py:108— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/crewai-core/src/crewai_core/settings.py:116— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/crewai-core/src/crewai_core/settings.py:228— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/crewai-tools/src/crewai_tools/adapters/enterprise_adapter.py:58— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) lib/crewai-tools/src/crewai_tools/adapters/enterprise_adapter.py:172— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Hotspot: lib/crewai/src/crewai/llm.py lib/crewai/src/crewai/llm.py:815— lib/crewai/src/crewai/llm.py changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in LLM._handle_streaming_response at line 815. 9 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/llm.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/crewai/src/crewai/flow/runtime/__init__.py lib/crewai/src/crewai/flow/runtime/__init__.py:2181— lib/crewai/src/crewai/flow/runtime/__init__.py changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in Flow.kickoff_async at line 2181. 8 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/flow/runtime/__init__.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/crewai/src/crewai/agents/agent_executor.py lib/crewai/src/crewai/agents/agent_executor.py:2118— lib/crewai/src/crewai/agents/agent_executor.py changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in AgentExecutor._execute_single_native_tool_call at line 2118. 2 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/agents/agent_executor.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/crewai/src/crewai/agent/core.py lib/crewai/src/crewai/agent/core.py:1594— lib/crewai/src/crewai/agent/core.py changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in Agent._prepare_kickoff at line 1594. 5 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/agent/core.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/crewai/src/crewai/utilities/agent_utils.py lib/crewai/src/crewai/utilities/agent_utils.py:1440— lib/crewai/src/crewai/utilities/agent_utils.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in agent_utils.execute_single_native_tool_call at line 1440. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/utilities/agent_utils.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/cli/src/crewai_cli/create_json_crew.py lib/cli/src/crewai_cli/create_json_crew.py:374— lib/cli/src/crewai_cli/create_json_crew.py changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in create_json_crew._select_tools at line 374. 2 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/cli/src/crewai_cli/create_json_crew.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/cli/src/crewai_cli/cli.py lib/cli/src/crewai_cli/cli.py:209— lib/cli/src/crewai_cli/cli.py changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in cli.create at line 209. 4 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/cli/src/crewai_cli/cli.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/crewai/src/crewai/llms/providers/openai/completion.py lib/crewai/src/crewai/llms/providers/openai/completion.py:1014— lib/crewai/src/crewai/llms/providers/openai/completion.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in OpenAICompletion._prepare_responses_params at line 1014. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/llms/providers/openai/completion.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/cli/src/crewai_cli/experimental/eval_crew.py lib/cli/src/crewai_cli/experimental/eval_crew.py:1918— lib/cli/src/crewai_cli/experimental/eval_crew.py changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in eval_crew._print_comparison at line 1918. 5 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/cli/src/crewai_cli/experimental/eval_crew.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/crewai/src/crewai/llms/providers/gemini/completion.py lib/crewai/src/crewai/llms/providers/gemini/completion.py:615— lib/crewai/src/crewai/llms/providers/gemini/completion.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in GeminiCompletion._format_messages_for_gemini at line 615. 3 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/llms/providers/gemini/completion.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/cli/src/crewai_cli/tui_picker.py lib/cli/src/crewai_cli/tui_picker.py:273— lib/cli/src/crewai_cli/tui_picker.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in tui_picker._arrow_select_multi at line 273. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/cli/src/crewai_cli/tui_picker.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/crewai/src/crewai/lite_agent.py lib/crewai/src/crewai/lite_agent.py:915— lib/crewai/src/crewai/lite_agent.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in LiteAgent._invoke_loop at line 915. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/lite_agent.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/cli/src/crewai_cli/create_crew.py lib/cli/src/crewai_cli/create_crew.py:203— lib/cli/src/crewai_cli/create_crew.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in create_crew.create_crew at line 203. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/cli/src/crewai_cli/create_crew.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/crewai/src/crewai/tools/tool_usage.py lib/crewai/src/crewai/tools/tool_usage.py:238— lib/crewai/src/crewai/tools/tool_usage.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in ToolUsage._ause at line 238. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/tools/tool_usage.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/crewai/src/crewai/mcp/tool_resolver.py lib/crewai/src/crewai/mcp/tool_resolver.py:335— lib/crewai/src/crewai/mcp/tool_resolver.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in MCPToolResolver._resolve_native at line 335. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/mcp/tool_resolver.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/crewai/src/crewai/task.py lib/crewai/src/crewai/task.py:650— lib/crewai/src/crewai/task.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in Task._aexecute_core at line 650. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/task.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/crewai-tools/src/crewai_tools/rag/loaders/docs_site_loader.py lib/crewai-tools/src/crewai_tools/rag/loaders/docs_site_loader.py:17— lib/crewai-tools/src/crewai_tools/rag/loaders/docs_site_loader.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in DocsSiteLoader.load at line 17. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai-tools/src/crewai_tools/rag/loaders/docs_site_loader.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/crewai/src/crewai/memory/unified_memory.py lib/crewai/src/crewai/memory/unified_memory.py:686— lib/crewai/src/crewai/memory/unified_memory.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in Memory.recall at line 686. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/memory/unified_memory.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/crewai/src/crewai/skills/registry.py lib/crewai/src/crewai/skills/registry.py:275— lib/crewai/src/crewai/skills/registry.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in registry.download_skill at line 275. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/skills/registry.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Swallowed exception (empty catch) conftest.py:201— 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) lib/cli/src/crewai_cli/crew_run_tui.py:91— 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) lib/cli/src/crewai_cli/crew_run_tui.py:975— 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) lib/cli/src/crewai_cli/crew_run_tui.py:1072— 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) lib/cli/src/crewai_cli/crew_run_tui.py:1086— 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) lib/cli/src/crewai_cli/crew_run_tui.py:1092— 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) lib/cli/src/crewai_cli/crew_run_tui.py:1183— 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) lib/cli/src/crewai_cli/crew_run_tui.py:1400— 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) lib/cli/src/crewai_cli/crew_run_tui.py:1677— 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) lib/cli/src/crewai_cli/crew_run_tui.py:1692— 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) lib/cli/src/crewai_cli/crew_run_tui.py:2068— 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) lib/cli/src/crewai_cli/crew_run_tui.py:2156— 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) lib/cli/src/crewai_cli/crew_run_tui.py:2274— 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) lib/cli/src/crewai_cli/crew_run_tui.py:2546— 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) lib/cli/src/crewai_cli/cli.py:117— 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) lib/cli/src/crewai_cli/tools/main.py:157— 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) lib/crewai-core/src/crewai_core/tool_credentials.py: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) lib/crewai-core/src/crewai_core/settings.py:261— 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.
TooManyMethods: AgentExecutor lib/crewai/src/crewai/agents/agent_executor.py:187— TooManyMethods — 95 methods. The bar is 30 methods; this is 65 over it, 3.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.
TooManyMethods: CrewRunApp lib/cli/src/crewai_cli/crew_run_tui.py:482— TooManyMethods — 85 methods. The bar is 30 methods; this is 55 over it, 2.83× 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: ConsoleFormatter lib/crewai/src/crewai/events/utils/console_formatter.py:31— TooManyMethods — 78 methods. The bar is 30 methods; this is 48 over it, 2.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: _ConversationalMixin lib/crewai/src/crewai/flow/conversational_mixin.py:232— TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× 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: OpenAICompletion lib/crewai/src/crewai/llms/providers/openai/completion.py:333— TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× 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: Agent lib/crewai/src/crewai/agent/core.py:213— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× 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: LLM lib/crewai/src/crewai/llm.py:258— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× 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: AzureCompletion lib/crewai/src/crewai/llms/providers/azure/completion.py:77— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Telemetry lib/crewai/src/crewai/telemetry/telemetry.py:69— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 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.
TooManyMethods: PlusAPI lib/crewai-core/src/crewai_core/plus_api.py:255— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GeminiCompletion lib/crewai/src/crewai/llms/providers/gemini/completion.py:38— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 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.
TooManyMethods: AnthropicCompletion lib/crewai/src/crewai/llms/providers/anthropic/completion.py:249— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DeployCommand lib/cli/src/crewai_cli/deploy/main.py:274— TooManyMethods — 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.
TooManyMethods: BedrockCompletion lib/crewai/src/crewai/llms/providers/bedrock/completion.py:227— TooManyMethods — 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.
TooManyMethods: QdrantEdgeStorage lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:81— TooManyMethods — 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 lines × 2) lib/cli/src/crewai_cli/create_crew.py:172— lib/cli/src/crewai_cli/create_crew.py:172-184 | lib/cli/src/crewai_cli/create_crew.py:294-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 `lib/cli/src/crewai_cli/create_crew.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 (12 lines × 2) lib/cli/src/crewai_cli/run_crew.py:148— lib/cli/src/crewai_cli/run_crew.py:148-159 | lib/cli/src/crewai_cli/run_declarative_flow.py:554-565 — 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 (12 lines × 2) lib/cli/src/crewai_cli/run_crew.py:376— lib/cli/src/crewai_cli/run_crew.py:376-389 | lib/cli/src/crewai_cli/run_declarative_flow.py:210-221 — 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) lib/crewai/src/crewai/a2a/updates/streaming/handler.py:97— lib/crewai/src/crewai/a2a/updates/streaming/handler.py:97-108 | lib/crewai/src/crewai/a2a/updates/streaming/handler.py:191-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/crewai/src/crewai/a2a/updates/streaming/handler.py:97` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) lib/crewai/src/crewai/a2a/updates/streaming/handler.py:168— lib/crewai/src/crewai/a2a/updates/streaming/handler.py:168-179 | lib/crewai/src/crewai/a2a/updates/streaming/handler.py:367-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 `lib/crewai/src/crewai/a2a/updates/streaming/handler.py:168` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) lib/crewai/src/crewai/a2a/updates/streaming/handler.py:510— lib/crewai/src/crewai/a2a/updates/streaming/handler.py:510-521 | lib/crewai/src/crewai/a2a/updates/streaming/handler.py:569-580 — 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 `lib/crewai/src/crewai/a2a/updates/streaming/handler.py:510` 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) lib/crewai/src/crewai/events/event_bus.py:607— lib/crewai/src/crewai/events/event_bus.py:607-618 | lib/crewai/src/crewai/events/event_bus.py:692-703 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/crewai/src/crewai/events/event_bus.py:704` calls `set` and `lib/crewai/src/crewai/events/event_bus.py:620` 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 (12 lines × 2) lib/crewai/src/crewai/llm.py:966— lib/crewai/src/crewai/llm.py:966-977 | lib/crewai/src/crewai/llm.py:1007-1018 — 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) lib/crewai/src/crewai/llm.py:1035— lib/crewai/src/crewai/llm.py:1035-1046 | lib/crewai/src/crewai/llm.py:1689-1701 — 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) lib/crewai/src/crewai/llms/providers/azure/completion.py:367— lib/crewai/src/crewai/llms/providers/azure/completion.py:367-378 | lib/crewai/src/crewai/llms/providers/openai/completion.py:522-533 — 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) lib/crewai/src/crewai/rag/qdrant/client.py:342— lib/crewai/src/crewai/rag/qdrant/client.py:342-353 | lib/crewai/src/crewai/rag/qdrant/client.py:397-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) lib/crewai/src/crewai/utilities/converter.py:238— lib/crewai/src/crewai/utilities/converter.py:238-249 | lib/crewai/src/crewai/utilities/converter.py:431-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 `lib/crewai/src/crewai/utilities/converter.py:238` 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 (12 lines × 2) lib/crewai/src/crewai/utilities/project_utils.py:59— lib/crewai/src/crewai/utilities/project_utils.py:59-70 | lib/crewai/src/crewai/utilities/project_utils.py:209-220 — 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) REDACTED:2104— REDACTED:2104-2115 | REDACTED:2395-2406 — 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.
TodoComment lib/crewai-tools/src/crewai_tools/tools/brave_search_tool/brave_search_tool.py:27— # TODO: Extend support to additional endpoints (e.g., /images, /news, etc.) — 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 lib/crewai-tools/src/crewai_tools/tools/brave_search_tool/brave_search_tool.py:139— # TODO: Handle other result types like "discussions", "faq", etc. — 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 lib/crewai-tools/src/crewai_tools/tools/crewai_platform_tools/misc.py:12— # TODO: Use context manager to get token — 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 lib/crewai/src/crewai/process.py:11— # TODO: consensual = 'consensual' — 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 lib/crewai/src/crewai/llm.py:2390— # TODO: Remove this code after merging PR https://github.com/BerriAI/litellm/pull/10917
TodoComment lib/crewai/src/crewai/crew.py:630— # TODO: Improve typing — 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 lib/crewai/src/crewai/agents/agent_executor.py:1467— # todo ↔ result (or exception) mapping. — 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 lib/crewai/src/crewai/hooks/llm_hooks.py:72— # TODO: look into — 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 lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1530— # TODO: we drop this — 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 lib/crewai/tests/test_llm.py:26— # TODO: This test fails without print statement, which makes me think that something is happening asynchronously that we need to eventually fix and dive deeper into at a later date — 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 lib/crewai/tests/agents/test_crew_agent_parser.py:370— # TODO: ADD TEST TO MAKE SURE ** REMOVAL DOESN'T MESS UP ANYTHING — 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 lib/crewai/tests/agents/test_agent_executor.py:3008— # Todo Status Tracking — 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.
Duplicated block (16 lines × 2) lib/cli/src/crewai_cli/crew_run_tui.py:3151— lib/cli/src/crewai_cli/crew_run_tui.py:3151-3166 | lib/cli/src/crewai_cli/crew_run_tui.py:3208-3223 — 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) lib/crewai-files/src/crewai_files/resolution/resolver.py:352— lib/crewai-files/src/crewai_files/resolution/resolver.py:352-367 | lib/crewai-files/src/crewai_files/resolution/resolver.py:571-586 — 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) lib/crewai-files/src/crewai_files/uploaders/anthropic.py:101— lib/crewai-files/src/crewai_files/uploaders/anthropic.py:101-116 | lib/crewai-files/src/crewai_files/uploaders/anthropic.py:209-224 — 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 `lib/crewai-files/src/crewai_files/uploaders/anthropic.py:101` 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 (16 lines × 2) lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py:341— lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py:341-356 | lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py:372-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. 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 lines × 2) lib/crewai/src/crewai/a2a/updates/push_notifications/handler.py:207— lib/crewai/src/crewai/a2a/updates/push_notifications/handler.py:207-222 | lib/crewai/src/crewai/a2a/updates/push_notifications/handler.py:231-246 — 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 `lib/crewai/src/crewai/a2a/updates/push_notifications/handler.py:207` 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) lib/crewai/src/crewai/knowledge/storage/knowledge_storage.py:121— lib/crewai/src/crewai/knowledge/storage/knowledge_storage.py:121-136 | lib/crewai/src/crewai/knowledge/storage/knowledge_storage.py:202-217 — 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 `lib/crewai/src/crewai/knowledge/storage/knowledge_storage.py:121` 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) lib/crewai/src/crewai/llm.py:2273— lib/crewai/src/crewai/llm.py:2273-2288 | lib/crewai/src/crewai/llm.py:2331-2346 — 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 (16 lines × 2) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1206— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1206-1221 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1590-1605 — 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, `lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1607` calls `_extract_finish_reason_and_id` and `lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1222` 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 (16 lines × 2) lib/crewai/src/crewai/llms/providers/azure/completion.py:1107— lib/crewai/src/crewai/llms/providers/azure/completion.py:1107-1122 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2440-2455 — 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 `lib/crewai/src/crewai/llms/providers/azure/completion.py:1107` 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 (16 lines × 2) lib/crewai/src/crewai/llms/providers/openai/completion.py:673— lib/crewai/src/crewai/llms/providers/openai/completion.py:673-688 | lib/crewai/src/crewai/llms/providers/openai/completion.py:818-833 — 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 `lib/crewai/src/crewai/llms/providers/openai/completion.py:673` 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) lib/crewai/src/crewai/state/runtime.py:302— lib/crewai/src/crewai/state/runtime.py:302-317 | lib/crewai/src/crewai/state/runtime.py:335-350 — 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 `lib/crewai/src/crewai/state/runtime.py:302` 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 (16 lines × 2) scripts/wharf_runner.py:155— scripts/wharf_runner.py:155-170 | scripts/wharf_runner.py:174-189 — 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 (11 lines × 2) lib/cli/src/crewai_cli/experimental/eval_crew.py:644— lib/cli/src/crewai_cli/experimental/eval_crew.py:644-654 | lib/crewai-core/src/crewai_core/eval_handshake.py:128-138 — 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) lib/crewai-files/src/crewai_files/uploaders/bedrock.py:257— lib/crewai-files/src/crewai_files/uploaders/bedrock.py:257-267 | lib/crewai-files/src/crewai_files/uploaders/bedrock.py:404-414 — 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) lib/crewai/src/crewai/a2a/task_helpers.py:381— lib/crewai/src/crewai/a2a/task_helpers.py:381-391 | lib/crewai/src/crewai/a2a/updates/polling/handler.py:261-271 — before extracting anything, compare `lib/crewai/src/crewai/a2a/task_helpers.py` and `lib/crewai/src/crewai/a2a/updates/polling/handler.py` as WHOLE FILES: this scan already matched 3 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 `lib/crewai/src/crewai/a2a/task_helpers.py:381` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) lib/crewai/src/crewai/a2a/wrapper.py:333— lib/crewai/src/crewai/a2a/wrapper.py:333-343 | lib/crewai/src/crewai/a2a/wrapper.py:1480-1490 — 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) lib/crewai/src/crewai/agents/agent_executor.py:979— lib/crewai/src/crewai/agents/agent_executor.py:979-989 | lib/crewai/src/crewai/agents/agent_executor.py:1009-1019 — 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 (11 lines × 2) lib/crewai/src/crewai/events/utils/console_formatter.py:693— lib/crewai/src/crewai/events/utils/console_formatter.py:693-703 | lib/crewai/src/crewai/events/utils/console_formatter.py:708-718 — 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 (11 lines × 2) lib/crewai/src/crewai/events/utils/console_formatter.py:721— lib/crewai/src/crewai/events/utils/console_formatter.py:721-731 | lib/crewai/src/crewai/events/utils/console_formatter.py:734-744 — 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 (11 lines × 2) lib/crewai/src/crewai/events/utils/console_formatter.py:1668— lib/crewai/src/crewai/events/utils/console_formatter.py:1668-1678 | lib/crewai/src/crewai/events/utils/console_formatter.py:1708-1718 — 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 (11 lines × 2) lib/crewai/src/crewai/telemetry/tracing/handlers.py:1319— lib/crewai/src/crewai/telemetry/tracing/handlers.py:1319-1329 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:3341-3351 — 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) lib/cli/src/crewai_cli/tools/main.py:360— lib/cli/src/crewai_cli/tools/main.py:360-370 | lib/crewai/src/crewai/utilities/agent_utils.py:1057-1067 — 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: `Settings` names `crewai_cli.config` in one and `crewai_core.settings` 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 (11 lines × 2) lib/crewai-tools/src/crewai_tools/tools/ocr_tool/ocr_tool.py:95— lib/crewai-tools/src/crewai_tools/tools/ocr_tool/ocr_tool.py:95-105 | lib/crewai-tools/src/crewai_tools/tools/vision_tool/vision_tool.py:177-187 — 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 (11 lines × 2) lib/crewai/src/crewai/a2a/extensions/a2ui/models.py:187— lib/crewai/src/crewai/a2a/extensions/a2ui/models.py:187-197 | lib/crewai/src/crewai/a2a/extensions/a2ui/v0_9.py:714-726 — 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 (15 lines × 2) lib/crewai-files/src/crewai_files/resolution/resolver.py:316— lib/crewai-files/src/crewai_files/resolution/resolver.py:316-330 | lib/crewai-files/src/crewai_files/resolution/resolver.py:537-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 `lib/crewai-files/src/crewai_files/resolution/resolver.py:316` 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) lib/crewai/src/crewai/a2a/updates/polling/handler.py:267— lib/crewai/src/crewai/a2a/updates/polling/handler.py:267-281 | lib/crewai/src/crewai/a2a/updates/polling/handler.py:316-330 — 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 `lib/crewai/src/crewai/a2a/updates/polling/handler.py:267` 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) lib/crewai/src/crewai/a2a/updates/streaming/handler.py:92— lib/crewai/src/crewai/a2a/updates/streaming/handler.py:92-106 | lib/crewai/src/crewai/a2a/updates/streaming/handler.py:111-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/crewai/src/crewai/a2a/updates/streaming/handler.py:92` 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) lib/crewai/src/crewai/a2a/utils/delegation.py:211— lib/crewai/src/crewai/a2a/utils/delegation.py:211-225 | lib/crewai/src/crewai/a2a/utils/delegation.py:319-333 — 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 `lib/crewai/src/crewai/a2a/utils/delegation.py:211` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) lib/crewai/src/crewai/a2a/wrapper.py:453— lib/crewai/src/crewai/a2a/wrapper.py:453-467 | lib/crewai/src/crewai/a2a/wrapper.py:578-592 — 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 `lib/crewai/src/crewai/a2a/wrapper.py:453` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) lib/crewai/src/crewai/a2a/wrapper.py:1285— lib/crewai/src/crewai/a2a/wrapper.py:1285-1299 | lib/crewai/src/crewai/a2a/wrapper.py:1639-1653 — 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 (15 lines × 2) lib/crewai/src/crewai/knowledge/source/base_file_knowledge_source.py:55— lib/crewai/src/crewai/knowledge/source/base_file_knowledge_source.py:55-69 | lib/crewai/src/crewai/knowledge/source/excel_knowledge_source.py:75-89 — before extracting anything, compare `lib/crewai/src/crewai/knowledge/source/base_file_knowledge_source.py` and `lib/crewai/src/crewai/knowledge/source/excel_knowledge_source.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 (15 lines × 2) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:521— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:521-535 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:596-610 — 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 `lib/crewai/src/crewai/llms/providers/anthropic/completion.py:521` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) lib/crewai/src/crewai/task.py:1431— lib/crewai/src/crewai/task.py:1431-1445 | lib/crewai/src/crewai/task.py:1552-1566 — 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 (15 lines × 2) lib/crewai/src/crewai/telemetry/telemetry.py:775— lib/crewai/src/crewai/telemetry/telemetry.py:775-789 | lib/crewai/src/crewai/telemetry/telemetry.py:824-838 — 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 (15 lines × 2) lib/crewai/src/crewai/utilities/streaming.py:272— lib/crewai/src/crewai/utilities/streaming.py:272-286 | lib/crewai/src/crewai/utilities/streaming.py:502-516 — 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 (13 lines × 2) lib/cli/src/crewai_cli/crew_run_tui.py:960— lib/cli/src/crewai_cli/crew_run_tui.py:960-972 | lib/cli/src/crewai_cli/crew_run_tui.py:1026-1038 — 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 (13 lines × 2) lib/cli/src/crewai_cli/tools/main.py:146— lib/cli/src/crewai_cli/tools/main.py:146-158 | lib/crewai-core/src/crewai_core/tool_credentials.py:42-54 — 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) lib/crewai-files/src/crewai_files/formatting/api.py:135— lib/crewai-files/src/crewai_files/formatting/api.py:135-147 | lib/crewai-files/src/crewai_files/formatting/api.py:201-213 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/crewai-files/src/crewai_files/formatting/api.py:215` calls `aresolve_files` and `lib/crewai-files/src/crewai_files/formatting/api.py:149` 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 (13 lines × 2) lib/crewai-tools/src/crewai_tools/tools/tavily_extractor_tool/tavily_extractor_tool.py:88— lib/crewai-tools/src/crewai_tools/tools/tavily_extractor_tool/tavily_extractor_tool.py:88-100 | lib/crewai-tools/src/crewai_tools/tools/tavily_search_tool/tavily_search_tool.py:116-128 — 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) lib/crewai/src/crewai/a2a/wrapper.py:359— lib/crewai/src/crewai/a2a/wrapper.py:359-371 | lib/crewai/src/crewai/a2a/wrapper.py:1506-1518 — 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) lib/crewai/src/crewai/agents/agent_builder/base_agent.py:489— lib/crewai/src/crewai/agents/agent_builder/base_agent.py:489-501 | lib/crewai/src/crewai/crew.py:594-606 — 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) lib/crewai/src/crewai/llm.py:2636— lib/crewai/src/crewai/llm.py:2636-2648 | lib/crewai/src/crewai/llm.py:2699-2711 — 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 `lib/crewai/src/crewai/llm.py:2636` 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 (13 lines × 2) lib/crewai/src/crewai/project/annotations.py:165— lib/crewai/src/crewai/project/annotations.py:165-177 | lib/crewai/src/crewai/project/wrappers.py:142-154 — 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 (13 lines × 2) lib/crewai/src/crewai/rag/qdrant/client.py:247— lib/crewai/src/crewai/rag/qdrant/client.py:247-259 | lib/crewai/src/crewai/rag/qdrant/client.py:292-304 — 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) lib/crewai/src/crewai/tools/base_tool.py:239— lib/crewai/src/crewai/tools/base_tool.py:239-251 | lib/crewai/src/crewai/tools/base_tool.py:476-488 — 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 (13 lines × 2) REDACTED:2272— REDACTED:2272-2284 | REDACTED:2479-2491 — 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 `REDACTED:2272` 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) lib/crewai-files/src/crewai_files/cache/cleanup.py:50— lib/crewai-files/src/crewai_files/cache/cleanup.py:50-56 | lib/crewai-files/src/crewai_files/cache/cleanup.py:215-221 — 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 (7 lines × 2) lib/crewai/src/crewai/events/utils/console_formatter.py:884— lib/crewai/src/crewai/events/utils/console_formatter.py:884-890 | lib/crewai/src/crewai/events/utils/console_formatter.py:1414-1422 — 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) lib/crewai/src/crewai/events/utils/console_formatter.py:1438— lib/crewai/src/crewai/events/utils/console_formatter.py:1438-1444 | lib/crewai/src/crewai/events/utils/console_formatter.py:1446-1452 — 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) lib/crewai/src/crewai/experimental/evaluation/experiment/result_display.py:46— lib/crewai/src/crewai/experimental/evaluation/experiment/result_display.py:46-52 | lib/crewai/src/crewai/experimental/evaluation/experiment/result_display.py:57-63 — 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) lib/crewai/src/crewai/rag/qdrant/client.py:262— lib/crewai/src/crewai/rag/qdrant/client.py:262-268 | lib/crewai/src/crewai/rag/qdrant/client.py:307-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.
Duplicated block (7 lines × 2) lib/crewai/src/crewai/telemetry/telemetry.py:495— lib/crewai/src/crewai/telemetry/telemetry.py:495-503 | lib/crewai/src/crewai/telemetry/telemetry.py:531-537 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) lib/crewai/src/crewai/telemetry/telemetry.py:1165— lib/crewai/src/crewai/telemetry/telemetry.py:1165-1171 | lib/crewai/src/crewai/telemetry/telemetry.py:1273-1279 — 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) REDACTED:637— REDACTED:637-643 | REDACTED:1479-1485 — 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 (7 lines × 2) lib/cli/src/crewai_cli/skills/main.py:462— lib/cli/src/crewai_cli/skills/main.py:462-468 | lib/crewai/src/crewai/skills/cache.py:203-209 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) lib/crewai/src/crewai/knowledge/source/csv_knowledge_source.py:38— lib/crewai/src/crewai/knowledge/source/csv_knowledge_source.py:38-44 | lib/crewai/src/crewai/knowledge/source/json_knowledge_source.py:50-56 — 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) scripts/docs/freeze_current_edge.py:33— scripts/docs/freeze_current_edge.py:33-39 | scripts/docs/freeze_historical_versions.py:66-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. 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) lib/cli/src/crewai_cli/deploy/validate.py:1162— lib/cli/src/crewai_cli/deploy/validate.py:1162-1170 | lib/cli/src/crewai_cli/deploy/validate.py:1172-1180 — 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) lib/crewai-files/src/crewai_files/core/sources.py:565— lib/crewai-files/src/crewai_files/core/sources.py:565-573 | lib/crewai-files/src/crewai_files/core/types.py:35-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. 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) lib/crewai-tools/src/crewai_tools/tools/e2b_sandbox_tool/e2b_exec_tool.py:45— lib/crewai-tools/src/crewai_tools/tools/e2b_sandbox_tool/e2b_exec_tool.py:45-53 | lib/crewai-tools/src/crewai_tools/tools/e2b_sandbox_tool/e2b_python_tool.py:80-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) lib/crewai/src/crewai/agents/agent_executor.py:975— lib/crewai/src/crewai/agents/agent_executor.py:975-984 | lib/crewai/src/crewai/agents/agent_executor.py:1127-1135 — 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 `lib/crewai/src/crewai/agents/agent_executor.py:975` 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 (9 lines × 2) lib/crewai/src/crewai/project/json_loader.py:1325— lib/crewai/src/crewai/project/json_loader.py:1325-1333 | lib/crewai/src/crewai/project/json_loader.py:1340-1348 — 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 (9 lines × 2) lib/crewai/src/crewai/project/utils.py:60— lib/crewai/src/crewai/project/utils.py:60-68 | lib/crewai/src/crewai/project/utils.py:84-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. 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) lib/crewai/src/crewai/rag/chromadb/client.py:343— lib/crewai/src/crewai/rag/chromadb/client.py:343-352 | lib/crewai/src/crewai/rag/chromadb/client.py:394-402 — 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 `lib/crewai/src/crewai/rag/chromadb/client.py:343` 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) lib/crewai/src/crewai/utilities/crew_chat.py:429— lib/crewai/src/crewai/utilities/crew_chat.py:429-437 | lib/crewai/src/crewai/utilities/crew_chat.py:492-500 — 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) lib/cli/src/crewai_cli/checkpoint_cli.py:21— lib/cli/src/crewai_cli/checkpoint_cli.py:21-29 | lib/cli/src/crewai_cli/run_crew.py:532-544 — 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) lib/crewai-tools/src/crewai_tools/tools/contextualai_create_agent_tool/contextual_create_agent_tool.py:34— lib/crewai-tools/src/crewai_tools/tools/contextualai_create_agent_tool/contextual_create_agent_tool.py:34-42 | lib/crewai-tools/src/crewai_tools/tools/contextualai_query_tool/contextual_query_tool.py:35-43 — 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) lib/cli/src/crewai_cli/checkpoint_cli.py:270— lib/cli/src/crewai_cli/checkpoint_cli.py:270-277 | lib/cli/src/crewai_cli/checkpoint_cli.py:281-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. 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) lib/cli/src/crewai_cli/deploy/validate.py:455— lib/cli/src/crewai_cli/deploy/validate.py:455-462 | lib/cli/src/crewai_cli/deploy/validate.py:1075-1082 — 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 (8 lines × 2) lib/cli/src/crewai_cli/skills/main.py:133— lib/cli/src/crewai_cli/skills/main.py:133-140 | lib/crewai/src/crewai/skills/registry.py:365-372 — 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) lib/crewai-tools/src/crewai_tools/aws/bedrock/agents/invoke_agent_tool.py:162— lib/crewai-tools/src/crewai_tools/aws/bedrock/agents/invoke_agent_tool.py:162-169 | lib/crewai-tools/src/crewai_tools/aws/bedrock/knowledge_base/retriever_tool.py:237-244 — 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 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) lib/crewai-tools/src/crewai_tools/rag/loaders/github_loader.py:79— lib/crewai-tools/src/crewai_tools/rag/loaders/github_loader.py:79-86 | lib/crewai-tools/src/crewai_tools/rag/loaders/github_loader.py:91-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.
Duplicated block (8 lines × 2) lib/crewai/src/crewai/agents/agent_builder/base_agent.py:420— lib/crewai/src/crewai/agents/agent_builder/base_agent.py:420-427 | lib/crewai/src/crewai/crew.py:446-453 — 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) lib/crewai/src/crewai/llms/providers/azure/completion.py:691— lib/crewai/src/crewai/llms/providers/azure/completion.py:691-698 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2128-2135 — 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) lib/crewai/src/crewai/memory/storage/lancedb_storage.py:417— lib/crewai/src/crewai/memory/storage/lancedb_storage.py:417-424 | lib/crewai/src/crewai/memory/storage/lancedb_storage.py:451-460 — 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 (8 lines × 2) lib/crewai/src/crewai/tools/base_tool.py:221— lib/crewai/src/crewai/tools/base_tool.py:221-228 | lib/crewai/src/crewai/tools/base_tool.py:473-480 — 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 (8 lines × 2) lib/crewai/src/crewai/knowledge/source/pdf_knowledge_source.py:42— lib/crewai/src/crewai/knowledge/source/pdf_knowledge_source.py:42-49 | lib/crewai/src/crewai/knowledge/source/text_file_knowledge_source.py:22-29 — 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 (18 lines × 2) lib/cli/src/crewai_cli/deploy/validate.py:465— lib/cli/src/crewai_cli/deploy/validate.py:465-482 | lib/cli/src/crewai_cli/deploy/validate.py:1085-1102 — 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 `lib/cli/src/crewai_cli/deploy/validate.py:465` 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) lib/crewai-files/src/crewai_files/uploaders/openai.py:289— lib/crewai-files/src/crewai_files/uploaders/openai.py:289-306 | lib/crewai-files/src/crewai_files/uploaders/openai.py:566-583 — 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 `lib/crewai-files/src/crewai_files/uploaders/openai.py:289` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) lib/crewai-files/src/crewai_files/uploaders/openai.py:315— lib/crewai-files/src/crewai_files/uploaders/openai.py:315-332 | lib/crewai-files/src/crewai_files/uploaders/openai.py:383-400 — 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 (18 lines × 2) lib/crewai-files/src/crewai_files/uploaders/openai.py:592— lib/crewai-files/src/crewai_files/uploaders/openai.py:592-609 | lib/crewai-files/src/crewai_files/uploaders/openai.py:660-677 — 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 (18 lines × 2) lib/crewai-tools/src/crewai_tools/tools/tavily_extractor_tool/tavily_extractor_tool.py:107— lib/crewai-tools/src/crewai_tools/tools/tavily_extractor_tool/tavily_extractor_tool.py:107-124 | lib/crewai-tools/src/crewai_tools/tools/tavily_search_tool/tavily_search_tool.py:135-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.
Duplicated block (18 lines × 2) lib/crewai/src/crewai/a2a/wrapper.py:373— lib/crewai/src/crewai/a2a/wrapper.py:373-390 | lib/crewai/src/crewai/a2a/wrapper.py:1520-1537 — 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 `lib/crewai/src/crewai/a2a/wrapper.py:373` 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 (18 lines × 2) lib/crewai/src/crewai/task.py:1411— lib/crewai/src/crewai/task.py:1411-1428 | lib/crewai/src/crewai/task.py:1532-1549 — 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 (18 lines × 2) lib/crewai/src/crewai/utilities/project_utils.py:72— lib/crewai/src/crewai/utilities/project_utils.py:72-89 | lib/crewai/src/crewai/utilities/project_utils.py:225-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. 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, `lib/crewai/src/crewai/utilities/project_utils.py:223` calls `startswith` and `lib/crewai/src/crewai/utilities/project_utils.py:71` 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) lib/crewai/src/crewai/agents/agent_adapters/langgraph/langgraph_adapter.py:144— lib/crewai/src/crewai/agents/agent_adapters/langgraph/langgraph_adapter.py:144-161 | lib/crewai/src/crewai/agents/agent_adapters/openai_agents/openai_adapter.py:90-107 — 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 (10 lines × 2) lib/cli/src/crewai_cli/plus_api.py:141— lib/cli/src/crewai_cli/plus_api.py:141-150 | lib/crewai-core/src/crewai_core/plus_api.py:332-341 — before extracting anything, compare `lib/cli/src/crewai_cli/plus_api.py` and `lib/crewai-core/src/crewai_core/plus_api.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 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, `lib/cli/src/crewai_cli/plus_api.py:152` calls `getattr` and `lib/crewai-core/src/crewai_core/plus_api.py:343` 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 × 2) lib/crewai-files/src/crewai_files/processing/validators.py:376— lib/crewai-files/src/crewai_files/processing/validators.py:376-385 | lib/crewai-files/src/crewai_files/processing/validators.py:433-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. 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) lib/crewai/src/crewai/a2a/wrapper.py:418— lib/crewai/src/crewai/a2a/wrapper.py:418-427 | lib/crewai/src/crewai/lite_agent.py:144-153 — 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) lib/crewai/src/crewai/crew.py:1378— lib/crewai/src/crewai/crew.py:1378-1387 | lib/crewai/src/crewai/crew.py:1599-1608 — 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 × 2) lib/crewai/src/crewai/llm.py:892— lib/crewai/src/crewai/llm.py:892-901 | lib/crewai/src/crewai/llm.py:1013-1022 — 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) lib/crewai/src/crewai/rag/qdrant/utils.py:96— lib/crewai/src/crewai/rag/qdrant/utils.py:96-105 | lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:1021-1030 — 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) lib/crewai/src/crewai/utilities/crew_chat.py:444— lib/crewai/src/crewai/utilities/crew_chat.py:444-453 | lib/crewai/src/crewai/utilities/crew_chat.py:502-511 — 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) lib/crewai/src/crewai/knowledge/source/base_file_knowledge_source.py:33— lib/crewai/src/crewai/knowledge/source/base_file_knowledge_source.py:33-42 | lib/crewai/src/crewai/knowledge/source/excel_knowledge_source.py:34-43 — before extracting anything, compare `lib/crewai/src/crewai/knowledge/source/base_file_knowledge_source.py` and `lib/crewai/src/crewai/knowledge/source/excel_knowledge_source.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. 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) lib/crewai/src/crewai/knowledge/source/csv_knowledge_source.py:26— lib/crewai/src/crewai/knowledge/source/csv_knowledge_source.py:26-35 | lib/crewai/src/crewai/knowledge/source/json_knowledge_source.py:38-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.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×9
Recursive walk over a caller-supplied document has no depth cap REDACTED:470— `render_schema_type` is public and takes `field_schema: dict[str, Any]` from its caller, and it calls itself at line 470 (`self.render_schema_type`) with a piece of `field_schema` (and at line 480, line 489) — and nowhere in `render_schema_type` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `render_schema_type` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap REDACTED:604— `contains_python_reference` is public and takes `value: Any` from its caller, and it calls itself at line 604 (`contains_python_reference`) with a piece of `value` (and at line 607) — and nowhere in `contains_python_reference` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `contains_python_reference` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:212— `force_additional_properties_false` is public and takes `d: Any` from its caller, and it calls itself at line 212 (`force_additional_properties_false`) with a piece of `d` (and at line 218) — and nowhere in `force_additional_properties_false` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `force_additional_properties_false` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:258— `strip_unsupported_formats` is public and takes `d: Any` from its caller, and it calls itself at line 258 (`strip_unsupported_formats`) with a piece of `d` (and at line 264) — and nowhere in `strip_unsupported_formats` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `strip_unsupported_formats` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:294— `ensure_type_in_schemas` is public and takes `d: Any` from its caller, and it calls itself at line 294 (`ensure_type_in_schemas`) with a piece of `d` (and at line 296, line 302) — and nowhere in `ensure_type_in_schemas` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `ensure_type_in_schemas` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:411— `convert_oneof_to_anyof` is public and takes `schema: dict[str, Any]` from its caller, and it calls itself at line 411 (`convert_oneof_to_anyof`) with a piece of `schema` (and at line 418) — and nowhere in `convert_oneof_to_anyof` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `convert_oneof_to_anyof` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:452— `ensure_all_properties_required` is public and takes `schema: dict[str, Any]` from its caller, and it calls itself at line 452 (`ensure_all_properties_required`) with a piece of `schema` (and at line 459) — and nowhere in `ensure_all_properties_required` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `ensure_all_properties_required` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:505— `strip_null_from_types` is public and takes `schema: dict[str, Any]` from its caller, and it calls itself at line 505 (`strip_null_from_types`) with a piece of `schema` (and at line 512) — and nowhere in `strip_null_from_types` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `strip_null_from_types` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:1173— `create_model_from_schema` is public, takes a document from its caller (line 811) and hands it to `_json_schema_to_pydantic_type`, which calls itself at line 1173 (`_json_schema_to_pydantic_type`) with a piece of `json_schema` (and at line 1193, line 1207, line 1223, line 1266) — and nowhere in `_json_schema_to_pydantic_type` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_json_schema_to_pydantic_type` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Duplicated block (14 lines × 2) lib/cli/src/crewai_cli/skills/main.py:424— lib/cli/src/crewai_cli/skills/main.py:424-438 | lib/crewai/src/crewai/skills/cache.py:169-182 — 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 (14 lines × 2) lib/crewai-files/src/crewai_files/uploaders/openai.py:283— lib/crewai-files/src/crewai_files/uploaders/openai.py:283-296 | lib/crewai-files/src/crewai_files/uploaders/openai.py:357-370 — 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 (14 lines × 2) lib/crewai-files/src/crewai_files/uploaders/openai.py:560— lib/crewai-files/src/crewai_files/uploaders/openai.py:560-573 | lib/crewai-files/src/crewai_files/uploaders/openai.py:634-647 — 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 (14 lines × 2) lib/crewai/src/crewai/a2a/extensions/a2ui/models.py:258— lib/crewai/src/crewai/a2a/extensions/a2ui/models.py:258-271 | lib/crewai/src/crewai/a2a/extensions/a2ui/v0_9.py:812-825 — 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 (14 lines × 2) lib/crewai/src/crewai/a2a/task_helpers.py:387— lib/crewai/src/crewai/a2a/task_helpers.py:387-400 | lib/crewai/src/crewai/a2a/task_helpers.py:434-447 — 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 `lib/crewai/src/crewai/a2a/task_helpers.py:387` 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) lib/crewai/src/crewai/agents/agent_executor.py:3396— lib/crewai/src/crewai/agents/agent_executor.py:3396-3409 | lib/crewai/src/crewai/agents/agent_executor.py:3417-3430 — 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 (14 lines × 2) lib/crewai/src/crewai/llm.py:870— lib/crewai/src/crewai/llm.py:870-883 | lib/crewai/src/crewai/llm.py:1603-1616 — 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 (14 lines × 2) lib/crewai-files/src/crewai_files/uploaders/bedrock.py:68— lib/crewai-files/src/crewai_files/uploaders/bedrock.py:68-81 | lib/crewai-files/src/crewai_files/uploaders/openai.py:47-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 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) lib/cli/src/crewai_cli/checkpoint_tui.py:612— lib/cli/src/crewai_cli/checkpoint_tui.py:612-617 | lib/cli/src/crewai_cli/checkpoint_tui.py:632-637 — 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 (6 lines × 2) lib/crewai-core/src/crewai_core/telemetry.py:609— lib/crewai-core/src/crewai_core/telemetry.py:609-614 | lib/crewai/src/crewai/telemetry/telemetry.py:1322-1327 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) lib/crewai/src/crewai/experimental/evaluation/experiment/result_display.py:71— lib/crewai/src/crewai/experimental/evaluation/experiment/result_display.py:71-76 | lib/crewai/src/crewai/experimental/evaluation/experiment/result_display.py:78-83 — 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 (6 lines × 2) lib/cli/src/crewai_cli/checkpoint_cli.py:475— lib/cli/src/crewai_cli/checkpoint_cli.py:475-480 | lib/cli/src/crewai_cli/checkpoint_tui.py:683-688 — 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 (6 lines × 2) lib/cli/src/crewai_cli/experimental/eval_crew.py:632— lib/cli/src/crewai_cli/experimental/eval_crew.py:632-637 | lib/crewai-core/src/crewai_core/eval_handshake.py:118-123 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) lib/crewai-core/src/crewai_core/telemetry.py:279— lib/crewai-core/src/crewai_core/telemetry.py:279-284 | lib/crewai/src/crewai/telemetry/telemetry.py:83-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. 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) lib/crewai/src/crewai/a2a/extensions/a2ui/models.py:234— lib/crewai/src/crewai/a2a/extensions/a2ui/models.py:234-239 | lib/crewai/src/crewai/a2a/extensions/a2ui/v0_9.py:782-789 — 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) lib/cli/src/crewai_cli/run_crew.py:173— lib/cli/src/crewai_cli/run_crew.py:173-177 | lib/cli/src/crewai_cli/run_crew.py: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.
Duplicated block (5 lines × 2) lib/crewai/src/crewai/events/utils/console_formatter.py:1409— lib/crewai/src/crewai/events/utils/console_formatter.py:1409-1413 | lib/crewai/src/crewai/events/utils/console_formatter.py:1639-1645 — 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 `lib/crewai/src/crewai/events/utils/console_formatter.py:1639` 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) lib/crewai/src/crewai/experimental/evaluation/metrics/tools_metrics.py:188— lib/crewai/src/crewai/experimental/evaluation/metrics/tools_metrics.py:188-192 | lib/crewai/src/crewai/experimental/evaluation/metrics/tools_metrics.py:348-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.
Duplicated block (5 lines × 2) lib/crewai/src/crewai/memory/storage/lancedb_storage.py:608— lib/crewai/src/crewai/memory/storage/lancedb_storage.py:608-612 | lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:648-652 — 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 after the matched lines, `lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:654` calls `debug` and `lib/crewai/src/crewai/memory/storage/lancedb_storage.py:613` 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) lib/crewai/src/crewai/agents/agent_builder/base_agent.py:613— lib/crewai/src/crewai/agents/agent_builder/base_agent.py:613-617 | lib/crewai/src/crewai/task.py:476-480 — 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 (5 lines × 2) lib/crewai/src/crewai/knowledge/source/pdf_knowledge_source.py:52— lib/crewai/src/crewai/knowledge/source/pdf_knowledge_source.py:52-56 | lib/crewai/src/crewai/knowledge/source/text_file_knowledge_source.py:32-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) REDACTED:1814— REDACTED:1814-1818 | REDACTED:1835-1839 — 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.
Outbound HTTP without resilience lib/cli/src/crewai_cli/skills/main.py:133— `httpx.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience lib/crewai-files/src/crewai_files/core/sources.py:533— `httpx.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience lib/crewai-files/src/crewai_files/core/sources.py:545— `httpx.AsyncClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience lib/crewai-tools/src/crewai_tools/tools/generate_crewai_automation_tool/generate_crewai_automation_tool.py:52— `requests.post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience lib/crewai/src/crewai/a2a/auth/server_schemes.py:588— `httpx.AsyncClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience lib/crewai/src/crewai/skills/registry.py:365— `httpx.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:1721— `urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×5
Animation without a prefers-reduced-motion guard lib/crewai/src/crewai/flow/visualization/assets/style.css:206— `#legend-panel` moves (`transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, right 0.3s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard lib/crewai/src/crewai/flow/visualization/assets/style.css:395— `#drawer` moves (`transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, box-shadow 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard lib/crewai/src/crewai/flow/visualization/assets/style.css:819— `.code-copy-button svg` moves (`transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard lib/crewai/src/crewai/flow/visualization/assets/style.css:940— `.accordion-icon` moves (`transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard lib/crewai/src/crewai/flow/visualization/assets/style.css:951— `.accordion-content` moves (`transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Repeated repair: lib/crewai/src/crewai/telemetry/tracing/grants.py lib/crewai/src/crewai/telemetry/tracing/grants.py:44— lib/crewai/src/crewai/telemetry/tracing/grants.py changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is grants._fit_span at line 44), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tracing): keep tool and task outputs whole in exported spans (#7833)”; “fix(tracing): a refused trace grant runs the crew untraced instead of failing it (#7812)”; “fix(tracing): report tracing sent usage from the grant exporter (#7810)”; “fix(tracing): turning tracing on is the answer, and an Evaluate button in the TUI (#7765)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/telemetry/tracing/grants.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: lib/crewai/src/crewai/agents/step_executor.py lib/crewai/src/crewai/agents/step_executor.py:562— lib/crewai/src/crewai/agents/step_executor.py changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is StepExecutor._execute_native at line 562), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: stop an agent that repeats the same tool call (#8164)”; “fix: run model call hooks on every path and propagate a deny (#7111)”; “fix(agents): preserve tool results when final answer is empty (#7133)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/agents/step_executor.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: REDACTED REDACTED:487— REDACTED changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is _actions._resolve_crew_declaration at line 487), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(flow): tool actions honor the tool's tool_failure_policy (#8426)”; “fix(flow): tool actions get a fresh usage budget per kickoff (#8424)”; “fix(agents): keep message roles when Agent.kickoff gets a conversation (#7065)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: lib/crewai-tools/src/crewai_tools/security/safe_path.py lib/crewai-tools/src/crewai_tools/security/safe_path.py:225— lib/crewai-tools/src/crewai_tools/security/safe_path.py changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is safe_path.validate_url at line 225), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tools): default-deny non-global IPs in SSRF check (#7826)”; “fix(tools): pin SSRF checks to each redirect hop and peer IP (#6981)”; “fix(tools): sandbox FileWriterTool writes and fix file tool rough edges (#6692)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai-tools/src/crewai_tools/security/safe_path.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: lib/crewai/src/crewai/flow/persistence/sqlite.py lib/crewai/src/crewai/flow/persistence/sqlite.py:91— lib/crewai/src/crewai/flow/persistence/sqlite.py changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is SQLiteFlowPersistence.init_db at line 91), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “COR-891 Fix SQLite flow initialization contention (#7821)”; “fix: close sqlite connections in flow persistence and sqlite provider (#7511)”; “fix(flow): support non-primitive types in SQLiteFlowPersistence (#7358) (#7376)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:55:48 -03:00' --until='2026-10-23 22:55:48 -03:00' --full-history --no-merges -- lib/crewai/src/crewai/flow/persistence/sqlite.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (32 lines × 2) lib/crewai-tools/src/crewai_tools/tools/tavily_search_tool/tavily_search_tool.py:173— lib/crewai-tools/src/crewai_tools/tools/tavily_search_tool/tavily_search_tool.py:173-204 | lib/crewai-tools/src/crewai_tools/tools/tavily_search_tool/tavily_search_tool.py:225-256 — 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 `lib/crewai-tools/src/crewai_tools/tools/tavily_search_tool/tavily_search_tool.py:173` 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 (32 lines × 2) lib/crewai/src/crewai/agent/utils.py:176— lib/crewai/src/crewai/agent/utils.py:176-207 | lib/crewai/src/crewai/agent/utils.py:375-406 — 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 `lib/crewai/src/crewai/agent/utils.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. 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 (32 lines × 2) lib/crewai/src/crewai/crew.py:2569— lib/crewai/src/crewai/crew.py:2569-2600 | lib/crewai/src/crewai/events/listeners/tracing/trace_listener.py:1077-1108 — 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 (32 lines × 2) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1094— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1094-1125 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1652-1683 — 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 (32 lines × 2) lib/crewai/src/crewai/task.py:1335— lib/crewai/src/crewai/task.py:1335-1366 | lib/crewai/src/crewai/task.py:1456-1487 — 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 (23 lines × 2) lib/crewai-tools/src/crewai_tools/tools/firecrawl_crawl_website_tool/firecrawl_crawl_website_tool.py:83— lib/crewai-tools/src/crewai_tools/tools/firecrawl_crawl_website_tool/firecrawl_crawl_website_tool.py:83-105 | lib/crewai-tools/src/crewai_tools/tools/firecrawl_search_tool/firecrawl_search_tool.py:82-104 — 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) lib/crewai/src/crewai/llms/providers/gemini/completion.py:1261— lib/crewai/src/crewai/llms/providers/gemini/completion.py:1261-1283 | lib/crewai/src/crewai/llms/providers/gemini/completion.py:1354-1376 — 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 `lib/crewai/src/crewai/llms/providers/gemini/completion.py:1261` 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 (23 lines × 2) lib/crewai/src/crewai/task.py:745— lib/crewai/src/crewai/task.py:745-767 | lib/crewai/src/crewai/task.py:904-926 — 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 `lib/crewai/src/crewai/task.py:745` 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) REDACTED:1644— REDACTED:1644-1666 | REDACTED:1884-1906 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:1667` calls `extend` and `REDACTED:1908` 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) lib/crewai-tools/src/crewai_tools/tools/serpapi_tool/serpapi_google_search_tool.py:39— lib/crewai-tools/src/crewai_tools/tools/serpapi_tool/serpapi_google_search_tool.py:39-61 | lib/crewai-tools/src/crewai_tools/tools/serpapi_tool/serpapi_google_shopping_tool.py:39-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. 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) lib/cli/src/crewai_cli/plus_api.py:175— lib/cli/src/crewai_cli/plus_api.py:175-193 | lib/crewai-core/src/crewai_core/plus_api.py:519-537 — before extracting anything, compare `lib/cli/src/crewai_cli/plus_api.py` and `lib/crewai-core/src/crewai_core/plus_api.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 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 (19 lines × 2) lib/crewai/src/crewai/a2a/extensions/a2ui/validator.py:198— lib/crewai/src/crewai/a2a/extensions/a2ui/validator.py:198-216 | lib/crewai/src/crewai/a2a/extensions/a2ui/validator.py:267-285 — 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 (19 lines × 2) lib/crewai/src/crewai/llm.py:1968— lib/crewai/src/crewai/llm.py:1968-1986 | lib/crewai/src/crewai/llm.py:2106-2124 — 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 `lib/crewai/src/crewai/llm.py:1968` 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) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:539— lib/crewai/src/crewai/llms/providers/bedrock/completion.py:539-557 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:682-700 — 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 `lib/crewai/src/crewai/llms/providers/bedrock/completion.py:539` 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) lib/crewai/src/crewai/task.py:716— lib/crewai/src/crewai/task.py:716-734 | lib/crewai/src/crewai/task.py:875-893 — 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 `lib/crewai/src/crewai/task.py:716` 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) lib/crewai-tools/src/crewai_tools/aws/s3/reader_tool.py:23— lib/crewai-tools/src/crewai_tools/aws/s3/reader_tool.py:23-39 | lib/crewai-tools/src/crewai_tools/aws/s3/writer_tool.py:23-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.
Duplicated block (17 lines × 2) lib/crewai/src/crewai/a2a/wrapper.py:1212— lib/crewai/src/crewai/a2a/wrapper.py:1212-1228 | lib/crewai/src/crewai/a2a/wrapper.py:1584-1600 — 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 (17 lines × 2) lib/crewai/src/crewai/agent/core.py:990— lib/crewai/src/crewai/agent/core.py:990-1006 | lib/crewai/src/crewai/agent/core.py:1125-1141 — 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 `lib/crewai/src/crewai/agent/core.py:990` 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) lib/crewai/src/crewai/agents/agent_executor.py:944— lib/crewai/src/crewai/agents/agent_executor.py:944-960 | lib/crewai/src/crewai/agents/agent_executor.py:1024-1040 — 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 (17 lines × 2) lib/crewai/src/crewai/events/utils/console_formatter.py:383— lib/crewai/src/crewai/events/utils/console_formatter.py:383-399 | lib/crewai/src/crewai/events/utils/console_formatter.py:1808-1824 — 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 (4 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (4 members, 50+ identical tokens) lib/cli/src/crewai_cli/evaluate_crew.py:12— lib/cli/src/crewai_cli/evaluate_crew.py:12-41 | lib/cli/src/crewai_cli/kickoff_flow.py:97-118 | lib/cli/src/crewai_cli/replay_from_task.py:10-34 | lib/cli/src/crewai_cli/train_crew.py:7-34 — 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) lib/crewai-files/src/crewai_files/uploaders/openai.py:268— lib/crewai-files/src/crewai_files/uploaders/openai.py:268-332 | lib/crewai-files/src/crewai_files/uploaders/openai.py:340-400 | lib/crewai-files/src/crewai_files/uploaders/openai.py:545-609 | lib/crewai-files/src/crewai_files/uploaders/openai.py:617-677 — 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) lib/crewai/src/crewai/a2a/utils/agent_card.py:110— lib/crewai/src/crewai/a2a/utils/agent_card.py:110-154 | lib/crewai/src/crewai/a2a/utils/agent_card.py:209-223 | lib/crewai/src/crewai/a2a/utils/delegation.py:161-236 | lib/crewai/src/crewai/tasks/llm_guardrail.py:25-36 — 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) lib/crewai/src/crewai/llms/providers/azure/completion.py:361— lib/crewai/src/crewai/llms/providers/azure/completion.py:361-391 | lib/crewai/src/crewai/llms/providers/azure/completion.py:656-725 | lib/crewai/src/crewai/llms/providers/openai/completion.py:516-549 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2117-2180 — 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 (27 lines × 2) lib/crewai-files/src/crewai_files/uploaders/gemini.py:131— lib/crewai-files/src/crewai_files/uploaders/gemini.py:131-157 | lib/crewai-files/src/crewai_files/uploaders/gemini.py:212-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) lib/crewai/src/crewai/a2a/wrapper.py:1341— lib/crewai/src/crewai/a2a/wrapper.py:1341-1367 | lib/crewai/src/crewai/a2a/wrapper.py:1695-1721 — 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 `lib/crewai/src/crewai/a2a/wrapper.py:1341` 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 (27 lines × 2) lib/crewai/src/crewai/knowledge/source/base_file_knowledge_source.py:90— lib/crewai/src/crewai/knowledge/source/base_file_knowledge_source.py:90-116 | lib/crewai/src/crewai/knowledge/source/excel_knowledge_source.py:46-72 — before extracting anything, compare `lib/crewai/src/crewai/knowledge/source/base_file_knowledge_source.py` and `lib/crewai/src/crewai/knowledge/source/excel_knowledge_source.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. 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 (27 lines × 2) lib/devtools/src/crewai_devtools/docs_versioning.py:352— lib/devtools/src/crewai_devtools/docs_versioning.py:352-378 | scripts/docs/prefix_version_paths.py:329-355 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (25 lines × 2) lib/crewai/src/crewai/a2a/task_helpers.py:402— lib/crewai/src/crewai/a2a/task_helpers.py:402-426 | lib/crewai/src/crewai/a2a/task_helpers.py:448-472 — 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 `lib/crewai/src/crewai/a2a/task_helpers.py:402` 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 (25 lines × 2) lib/crewai/src/crewai/a2a/task_helpers.py:414— lib/crewai/src/crewai/a2a/task_helpers.py:414-438 | lib/crewai/src/crewai/a2a/updates/polling/handler.py:296-320 — before extracting anything, compare `lib/crewai/src/crewai/a2a/task_helpers.py` and `lib/crewai/src/crewai/a2a/updates/polling/handler.py` as WHOLE FILES: this scan already matched 3 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 `lib/crewai/src/crewai/a2a/task_helpers.py:414` 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 (25 lines × 2) lib/crewai/src/crewai/a2a/updates/polling/handler.py:283— lib/crewai/src/crewai/a2a/updates/polling/handler.py:283-307 | lib/crewai/src/crewai/a2a/updates/polling/handler.py:331-355 — 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 `lib/crewai/src/crewai/a2a/updates/polling/handler.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. 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) lib/crewai/src/crewai/llms/providers/gemini/completion.py:393— lib/crewai/src/crewai/llms/providers/gemini/completion.py:393-417 | lib/crewai/src/crewai/llms/providers/gemini/completion.py:479-503 — 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 `lib/crewai/src/crewai/llms/providers/gemini/completion.py:393` 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–17 lines × 2) lib/crewai/src/crewai/agents/agent_executor.py:1224— lib/crewai/src/crewai/agents/agent_executor.py:1224-1239 | lib/crewai/src/crewai/agents/agent_executor.py:2964-2980 — 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 (16–17 lines × 2) lib/crewai/src/crewai/flow/runtime/__init__.py:1608— lib/crewai/src/crewai/flow/runtime/__init__.py:1608-1623 | lib/crewai/src/crewai/flow/runtime/__init__.py:2459-2475 — 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 `lib/crewai/src/crewai/flow/runtime/__init__.py:1608` 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–17 lines × 2) lib/crewai/src/crewai/llm.py:1896— lib/crewai/src/crewai/llm.py:1896-1911 | lib/crewai/src/crewai/llm.py:2041-2057 — 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 `lib/crewai/src/crewai/llm.py:2041` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/crewai/src/crewai/llm.py:2039` calls `_aprocess_message_files` and `lib/crewai/src/crewai/llm.py:1895` 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 (16–17 lines × 2) lib/devtools/src/crewai_devtools/docs_versioning.py:270— lib/devtools/src/crewai_devtools/docs_versioning.py:270-285 | scripts/docs/prefix_version_paths.py:232-248 — 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 (15 lines × 4) lib/crewai/src/crewai/a2a/wrapper.py:1338— lib/crewai/src/crewai/a2a/wrapper.py:1338-1352 | lib/crewai/src/crewai/a2a/wrapper.py:1370-1384 | lib/crewai/src/crewai/a2a/wrapper.py:1692-1706 | lib/crewai/src/crewai/a2a/wrapper.py:1724-1738 — all 4 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 (15 lines × 4) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1190— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1190-1204 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1420-1434 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1746-1760 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1954-1968 — all 4 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 `lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1190` 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 × 4) lib/crewai/src/crewai/llms/providers/openai/completion.py:1266— lib/crewai/src/crewai/llms/providers/openai/completion.py:1266-1280 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1413-1427 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2332-2346 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2776-2790 — all 4 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 `lib/crewai/src/crewai/llms/providers/openai/completion.py:1266` 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 × 4) lib/crewai/src/crewai/llms/providers/openai/completion.py:1262— lib/crewai/src/crewai/llms/providers/openai/completion.py:1262-1276 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1409-1423 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1570-1584 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1707-1721 — all 4 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 `lib/crewai/src/crewai/llms/providers/openai/completion.py:1262` 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 (38 lines × 2) lib/crewai-files/src/crewai_files/processing/validators.py:337— lib/crewai-files/src/crewai_files/processing/validators.py:337-374 | lib/crewai-files/src/crewai_files/processing/validators.py:394-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.
Duplicated block (38 lines × 2) lib/crewai/src/crewai/agents/agent_executor.py:3045— lib/crewai/src/crewai/agents/agent_executor.py:3045-3082 | lib/crewai/src/crewai/agents/agent_executor.py:3136-3173 — 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 (38 lines × 2) lib/crewai/src/crewai/task.py:656— lib/crewai/src/crewai/task.py:656-693 | lib/crewai/src/crewai/task.py:815-852 — 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 (37–38 lines × 2) lib/crewai/src/crewai/hooks/llm_hooks.py:121— lib/crewai/src/crewai/hooks/llm_hooks.py:121-157 | lib/crewai/src/crewai/hooks/tool_hooks.py:91-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.
Duplicated block (37–38 lines × 2) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:475— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:475-511 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:549-586 — 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 (37–38 lines × 2) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1605— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1605-1642 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:2031-2067 — 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 (31 lines × 2) lib/crewai-core/src/crewai_core/telemetry.py:294— lib/crewai-core/src/crewai_core/telemetry.py:294-324 | lib/crewai/src/crewai/telemetry/telemetry.py:100-130 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/crewai/src/crewai/telemetry/telemetry.py:98` calls `Lock` and `lib/crewai-core/src/crewai_core/telemetry.py:292` 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 (31 lines × 2) lib/crewai/src/crewai/llms/providers/azure/completion.py:515— lib/crewai/src/crewai/llms/providers/azure/completion.py:515-545 | lib/crewai/src/crewai/llms/providers/azure/completion.py:597-627 — 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 `lib/crewai/src/crewai/llms/providers/azure/completion.py:515` 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) lib/crewai/src/crewai/llms/providers/gemini/completion.py:1308— lib/crewai/src/crewai/llms/providers/gemini/completion.py:1308-1338 | lib/crewai/src/crewai/llms/providers/gemini/completion.py:1402-1432 — 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 (28 lines × 2) lib/crewai/src/crewai/a2a/wrapper.py:484— lib/crewai/src/crewai/a2a/wrapper.py:484-511 | lib/crewai/src/crewai/a2a/wrapper.py:609-636 — 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 `lib/crewai/src/crewai/a2a/wrapper.py:484` 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 (28 lines × 2) lib/crewai/src/crewai/llms/providers/azure/completion.py:1182— lib/crewai/src/crewai/llms/providers/azure/completion.py:1182-1209 | lib/crewai/src/crewai/llms/providers/azure/completion.py:1261-1288 — 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 (28 lines × 2) lib/crewai/src/crewai/state/runtime.py:415— lib/crewai/src/crewai/state/runtime.py:415-442 | lib/crewai/src/crewai/state/runtime.py:470-497 — 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 (24 lines × 2) lib/crewai-files/src/crewai_files/uploaders/gemini.py:184— lib/crewai-files/src/crewai_files/uploaders/gemini.py:184-207 | lib/crewai-files/src/crewai_files/uploaders/gemini.py:265-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. 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) lib/crewai/src/crewai/project/json_loader.py:509— lib/crewai/src/crewai/project/json_loader.py:509-532 | lib/crewai/src/crewai/project/json_loader.py:563-586 — 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) lib/crewai/src/crewai/tools/tool_usage.py:151— lib/crewai/src/crewai/tools/tool_usage.py:151-174 | lib/crewai/src/crewai/tools/tool_usage.py:199-222 — 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 (21 lines × 2) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:511— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:511-531 | lib/crewai/src/crewai/llms/providers/azure/completion.py:545-565 — 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 (21 lines × 2) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:586— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:586-606 | lib/crewai/src/crewai/llms/providers/azure/completion.py:627-647 — 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 (21 lines × 2) lib/crewai/src/crewai/state/runtime.py:393— lib/crewai/src/crewai/state/runtime.py:393-413 | lib/crewai/src/crewai/state/runtime.py:448-468 — 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) lib/crewai-files/src/crewai_files/resolution/resolver.py:369— lib/crewai-files/src/crewai_files/resolution/resolver.py:369-388 | lib/crewai-files/src/crewai_files/resolution/resolver.py:588-607 — 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 (20 lines × 2) lib/crewai/src/crewai/task.py:695— lib/crewai/src/crewai/task.py:695-714 | lib/crewai/src/crewai/task.py:854-873 — 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 `lib/crewai/src/crewai/task.py:695` 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) lib/crewai/src/crewai/utilities/converter.py:321— lib/crewai/src/crewai/utilities/converter.py:321-340 | lib/crewai/src/crewai/utilities/converter.py:474-493 — 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 `lib/crewai/src/crewai/utilities/converter.py:321` 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 (13 lines × 3) lib/crewai/src/crewai/events/types/llm_events.py:16— lib/crewai/src/crewai/events/types/llm_events.py:16-28 | lib/crewai/src/crewai/events/types/llm_events.py:132-144 | lib/crewai/src/crewai/events/types/tool_usage_events.py:33-45 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/crewai/src/crewai/events/types/tool_usage_events.py:30` calls `ConfigDict` and `lib/crewai/src/crewai/events/types/llm_events.py:129` 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 × 3) lib/crewai/src/crewai/events/utils/console_formatter.py:385— lib/crewai/src/crewai/events/utils/console_formatter.py:385-397 | lib/crewai/src/crewai/events/utils/console_formatter.py:1514-1526 | lib/crewai/src/crewai/events/utils/console_formatter.py:1810-1822 — 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 (13 lines × 3) lib/crewai/src/crewai/telemetry/tracing/handlers.py:3070— lib/crewai/src/crewai/telemetry/tracing/handlers.py:3070-3082 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:3135-3147 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:3156-3168 — 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 (11 lines × 4) lib/crewai-files/src/crewai_files/uploaders/openai.py:318— lib/crewai-files/src/crewai_files/uploaders/openai.py:318-328 | lib/crewai-files/src/crewai_files/uploaders/openai.py:386-396 | lib/crewai-files/src/crewai_files/uploaders/openai.py:595-605 | lib/crewai-files/src/crewai_files/uploaders/openai.py:663-673 — all 4 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 `lib/crewai-files/src/crewai_files/uploaders/openai.py:318` 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 × 4) lib/crewai/src/crewai/a2a/utils/agent_card.py:144— lib/crewai/src/crewai/a2a/utils/agent_card.py:144-154 | lib/crewai/src/crewai/a2a/utils/agent_card.py:213-223 | lib/crewai/src/crewai/a2a/utils/delegation.py:226-236 | lib/crewai/src/crewai/tasks/llm_guardrail.py:26-36 — there are 4 copies across 3 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. 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 × 4) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:550— lib/crewai/src/crewai/llms/providers/bedrock/completion.py:550-560 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:693-703 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1305-1315 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1448-1458 — 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.
factory.get_uploader (cognitive 19) lib/crewai-files/src/crewai_files/uploaders/factory.py:121— factory.get_uploader has cognitive complexity 19 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 5 (6 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (factory.get_uploader) 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.
factory.get_uploader (cognitive 19) lib/crewai-files/src/crewai_files/uploaders/factory.py:127— factory.get_uploader has cognitive complexity 19 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 5 (6 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (factory.get_uploader) 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.
ClassTooLong: TriggeredByHighlighter lib/crewai/src/crewai/flow/visualization/assets/interactive.js:630— ClassTooLong — 489 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 89 over it, 1.22× 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: DrawerManager lib/crewai/src/crewai/flow/visualization/assets/interactive.js:1373— ClassTooLong — 425 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 25 over it, 1.06× 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.
Change coupling: core.py ↔ tools_handler.py lib/crewai/src/crewai/agent/core.py:1— `lib/crewai/src/crewai/agent/core.py` and `lib/crewai/src/crewai/agents/tools_handler.py` change together 57% of the time (8 of the 14 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `1ec4da69` feat: add mypy as type checker, update code and add comment to refere… (at that commit the files were still `src/crewai/agent.py` and `src/crewai/agents/tools_handler.py`); `5977c442` Adding custom caching (at that commit the files were still `src/crewai/agent.py` and `src/crewai/agents/tools_handler.py`); `e55cee73` adding function calling llm support (at that commit the files were still `src/crewai/agent.py` and `src/crewai/agents/tools_handler.py`) — run `git show` on any of them.
Change coupling: tools_handler.py ↔ crew.py lib/crewai/src/crewai/agents/tools_handler.py:1— `lib/crewai/src/crewai/agents/tools_handler.py` and `lib/crewai/src/crewai/crew.py` change together 50% of the time (7 of the 14 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `1ec4da69` feat: add mypy as type checker, update code and add comment to refere… (at that commit the files were still `src/crewai/agents/tools_handler.py` and `src/crewai/crew.py`); `e55cee73` adding function calling llm support (at that commit the files were still `src/crewai/agents/tools_handler.py` and `src/crewai/crew.py`); `00206a62` Revamping tool usage (at that commit the files were still `src/crewai/agents/tools_handler.py` and `src/crewai/crew.py`) — run `git show` on any of them.
Duplicated block (65–66 lines × 2) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1293— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1293-1358 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1838-1902 — 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 (65–66 lines × 2) lib/crewai/src/crewai/llms/providers/openai/completion.py:1479— lib/crewai/src/crewai/llms/providers/openai/completion.py:1479-1544 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1617-1681 — 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 (55 lines × 2) lib/crewai/src/crewai/llms/providers/openai/completion.py:2297— lib/crewai/src/crewai/llms/providers/openai/completion.py:2297-2351 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2741-2795 — 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, `lib/crewai/src/crewai/llms/providers/openai/completion.py:2737` calls `import` and `lib/crewai/src/crewai/llms/providers/openai/completion.py:2296` 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 (55 lines × 2) lib/crewai-tools/src/crewai_tools/rag/chunkers/structured_chunker.py:12— lib/crewai-tools/src/crewai_tools/rag/chunkers/structured_chunker.py:12-66 | lib/crewai-tools/src/crewai_tools/rag/chunkers/text_chunker.py:12-76 — 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 (48–52 lines × 2) lib/crewai/src/crewai/llm.py:1247— lib/crewai/src/crewai/llm.py:1247-1298 | lib/crewai/src/crewai/llm.py:1406-1453 — 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. Note first that the copies are not typed on the same thing: `InternalInstructor` names `crewai.utilities` in one and `crewai.utilities.internal_instructor` 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 (48–52 lines × 2) lib/devtools/src/crewai_devtools/docs_versioning.py:297— lib/devtools/src/crewai_devtools/docs_versioning.py:297-348 | scripts/docs/prefix_version_paths.py:278-325 — 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 `data` to `dict[str, Any]` in one and `dict` 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 (52 lines × 2) lib/crewai/src/crewai/llms/providers/openai/completion.py:2583— lib/crewai/src/crewai/llms/providers/openai/completion.py:2583-2634 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2935-2986 — 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 (52 lines × 2) lib/crewai/src/crewai/utilities/tool_utils.py:146— lib/crewai/src/crewai/utilities/tool_utils.py:146-197 | lib/crewai/src/crewai/utilities/tool_utils.py:309-360 — 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 (40 lines × 2) lib/crewai/src/crewai/llm.py:1856— lib/crewai/src/crewai/llm.py:1856-1895 | lib/crewai/src/crewai/llm.py:1998-2037 — 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, `lib/crewai/src/crewai/llm.py:2039` calls `_aprocess_message_files` and `lib/crewai/src/crewai/llm.py:1896` 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 (40 lines × 2) lib/crewai/src/crewai/llms/providers/gemini/completion.py:343— lib/crewai/src/crewai/llms/providers/gemini/completion.py:343-382 | lib/crewai/src/crewai/llms/providers/gemini/completion.py:429-468 — 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 (32–33 lines × 2) lib/cli/src/crewai_cli/run_crew.py:669— lib/cli/src/crewai_cli/run_crew.py:669-701 | lib/cli/src/crewai_cli/run_declarative_flow.py:315-346 — 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 `lib/cli/src/crewai_cli/run_crew.py:669` 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 `app` to `CrewRunApp` in one and `Any` 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 (32–33 lines × 2) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1079— lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1079-1111 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1690-1721 — 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 `lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1079` 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) lib/crewai/src/crewai/llms/providers/openai/completion.py:633— lib/crewai/src/crewai/llms/providers/openai/completion.py:633-662 | lib/crewai/src/crewai/llms/providers/openai/completion.py:778-807 — 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 (30 lines × 2) lib/crewai/src/crewai/llms/providers/openai/completion.py:2264— lib/crewai/src/crewai/llms/providers/openai/completion.py:2264-2293 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2704-2733 — 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 `lib/crewai/src/crewai/llms/providers/openai/completion.py:2264` 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 lines × 2) lib/crewai/src/crewai/llm.py:2242— lib/crewai/src/crewai/llm.py:2242-2270 | lib/crewai/src/crewai/llm.py:2300-2328 — 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 (29 lines × 2) lib/crewai/src/crewai/llms/providers/openai/completion.py:1289— lib/crewai/src/crewai/llms/providers/openai/completion.py:1289-1317 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1432-1460 — 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 `lib/crewai/src/crewai/llms/providers/openai/completion.py:1289` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/crewai/src/crewai/llms/providers/openai/completion.py:1287` calls `_invoke_after_llm_call_hooks`, `get` and `lib/crewai/src/crewai/llms/providers/openai/completion.py:1431` 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 (26 lines × 2) lib/crewai/src/crewai/task.py:782— lib/crewai/src/crewai/task.py:782-807 | lib/crewai/src/crewai/task.py:941-966 — 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 (26 lines × 2) lib/crewai/src/crewai/telemetry/tracing/handlers.py:3485— lib/crewai/src/crewai/telemetry/tracing/handlers.py:3485-3510 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:3559-3584 — 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–22 lines × 2) lib/crewai-files/src/crewai_files/uploaders/bedrock.py:286— lib/crewai-files/src/crewai_files/uploaders/bedrock.py:286-307 | lib/crewai-files/src/crewai_files/uploaders/bedrock.py:436-456 — 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 `lib/crewai-files/src/crewai_files/uploaders/bedrock.py:436` 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 (21–22 lines × 2) lib/crewai/src/crewai/agents/step_executor.py:172— lib/crewai/src/crewai/agents/step_executor.py:172-193 | lib/crewai/src/crewai/agents/step_executor.py:217-237 — 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) lib/crewai/src/crewai/a2a/task_helpers.py:185— lib/crewai/src/crewai/a2a/task_helpers.py:185-206 | lib/crewai/src/crewai/a2a/task_helpers.py:228-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 `lib/crewai/src/crewai/a2a/task_helpers.py:185` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/crewai/src/crewai/a2a/task_helpers.py:208` calls `model_dump` and `lib/crewai/src/crewai/a2a/task_helpers.py:251` 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 (22 lines × 2) lib/crewai/src/crewai/telemetry/telemetry.py:697— lib/crewai/src/crewai/telemetry/telemetry.py:697-718 | lib/crewai/src/crewai/telemetry/telemetry.py:732-753 — 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–21 lines × 2) lib/crewai/src/crewai/crew.py:1038— lib/crewai/src/crewai/crew.py:1038-1057 | lib/crewai/src/crewai/crew.py:1259-1279 — 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 `lib/crewai/src/crewai/crew.py:1038` 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 (20–21 lines × 2) lib/crewai/src/crewai/telemetry/telemetry.py:610— lib/crewai/src/crewai/telemetry/telemetry.py:610-629 | lib/crewai/src/crewai/telemetry/telemetry.py:637-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/crewai/src/crewai/telemetry/telemetry.py:659` calls `add_agent_fingerprint_to_span` and `lib/crewai/src/crewai/telemetry/telemetry.py:630` 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) lib/cli/src/crewai_cli/plus_api.py:204— lib/cli/src/crewai_cli/plus_api.py:204-223 | lib/crewai-core/src/crewai_core/plus_api.py:548-565 — before extracting anything, compare `lib/cli/src/crewai_cli/plus_api.py` and `lib/crewai-core/src/crewai_core/plus_api.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 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–20 lines × 2) lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:99— lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:99-116 | lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:122-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:122` 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 × 2) lib/cli/src/crewai_cli/organization/main.py:36— lib/cli/src/crewai_cli/organization/main.py:36-51 | lib/cli/src/crewai_cli/organization/main.py: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 `lib/cli/src/crewai_cli/organization/main.py: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. 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–16 lines × 2) lib/cli/src/crewai_cli/run_crew.py:651— lib/cli/src/crewai_cli/run_crew.py:651-666 | lib/cli/src/crewai_cli/run_declarative_flow.py:299-313 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/crewai_cli/run_crew.py:651` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `app` to `CrewRunApp` in one and `Any` 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 (14–15 lines × 2) lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_session_manager.py:221— lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_session_manager.py:221-234 | lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_session_manager.py:251-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.
Duplicated block (14–15 lines × 2) lib/crewai/src/crewai/a2a/updates/streaming/handler.py:390— lib/crewai/src/crewai/a2a/updates/streaming/handler.py:390-404 | lib/crewai/src/crewai/a2a/updates/streaming/handler.py:478-491 — 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 `lib/crewai/src/crewai/a2a/updates/streaming/handler.py:390` 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) lib/crewai-tools/src/crewai_tools/tools/serply_api_tool/serply_news_search_tool.py:58— lib/crewai-tools/src/crewai_tools/tools/serply_api_tool/serply_news_search_tool.py:58-71 | lib/crewai-tools/src/crewai_tools/tools/serply_api_tool/serply_scholar_search_tool.py:62-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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–14 lines × 2) lib/crewai/src/crewai/utilities/converter.py:261— lib/crewai/src/crewai/utilities/converter.py:261-274 | lib/crewai/src/crewai/utilities/converter.py:445-457 — 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 `lib/crewai/src/crewai/utilities/converter.py:261` 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 (10–14 lines × 2) lib/crewai/src/crewai/types/streaming.py:183— lib/crewai/src/crewai/types/streaming.py:183-192 | lib/crewai/src/crewai/types/streaming.py:429-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. 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–14 lines × 2) lib/crewai/src/crewai/types/streaming.py:265— lib/crewai/src/crewai/types/streaming.py:265-274 | lib/crewai/src/crewai/types/streaming.py:413-426 — 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–13 lines × 2) lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py:197— lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py:197-209 | lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py:224-235 — 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 `lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py:224` 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 (12–13 lines × 2) lib/crewai/src/crewai/agents/agent_executor.py:567— lib/crewai/src/crewai/agents/agent_executor.py:567-579 | lib/crewai/src/crewai/agents/agent_executor.py:2833-2844 — 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–13 lines × 2) lib/crewai/src/crewai/agents/agent_executor.py:899— lib/crewai/src/crewai/agents/agent_executor.py:899-911 | lib/crewai/src/crewai/agents/agent_executor.py:1553-1563 — 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 `lib/crewai/src/crewai/agents/agent_executor.py:899` 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) lib/crewai/src/crewai/telemetry/tracing/handlers.py:2129— lib/crewai/src/crewai/telemetry/tracing/handlers.py:2129-2139 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:2298-2310 — 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–12 lines × 2) lib/cli/src/crewai_cli/evaluate_crew.py:29— lib/cli/src/crewai_cli/evaluate_crew.py:29-40 | lib/cli/src/crewai_cli/replay_from_task.py:23-33 — 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, `lib/cli/src/crewai_cli/evaluate_crew.py:27` calls `ValueError` and `lib/cli/src/crewai_cli/replay_from_task.py:22` 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–12 lines × 2) lib/crewai/src/crewai/agents/agent_executor.py:966— lib/crewai/src/crewai/agents/agent_executor.py:966-977 | lib/crewai/src/crewai/agents/agent_executor.py:1045-1055 — 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 `lib/crewai/src/crewai/agents/agent_executor.py:966` 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–11 lines × 2) lib/crewai-tools/src/crewai_tools/adapters/crewai_rag_adapter.py:269— lib/crewai-tools/src/crewai_tools/adapters/crewai_rag_adapter.py:269-279 | lib/crewai-tools/src/crewai_tools/adapters/crewai_rag_adapter.py:322-330 — 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–11 lines × 2) lib/crewai/src/crewai/memory/storage/lancedb_storage.py:453— lib/crewai/src/crewai/memory/storage/lancedb_storage.py:453-463 | lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:465-473 — 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–10 lines × 2) lib/crewai/src/crewai/events/types/tool_usage_events.py:45— lib/crewai/src/crewai/events/types/tool_usage_events.py:45-54 | lib/crewai/src/crewai/events/types/tool_usage_events.py:124-132 — 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–10 lines × 2) lib/crewai/src/crewai/rag/chromadb/client.py:138— lib/crewai/src/crewai/rag/chromadb/client.py:138-147 | lib/crewai/src/crewai/rag/chromadb/client.py:196-204 — 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 `lib/crewai/src/crewai/rag/chromadb/client.py:196` 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) lib/cli/src/crewai_cli/crew_run_tui.py:1772— lib/cli/src/crewai_cli/crew_run_tui.py:1772-1776 | lib/cli/src/crewai_cli/crew_run_tui.py:1815-1819 | lib/cli/src/crewai_cli/crew_run_tui.py:1861-1866 — 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, `lib/cli/src/crewai_cli/crew_run_tui.py:1811` calls `get` and `lib/cli/src/crewai_cli/crew_run_tui.py:1771` 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 × 3) lib/crewai/src/crewai/events/utils/console_formatter.py:484— lib/crewai/src/crewai/events/utils/console_formatter.py:484-490 | lib/crewai/src/crewai/events/utils/console_formatter.py:1409-1413 | lib/crewai/src/crewai/events/utils/console_formatter.py:1578-1582 — 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.
Low cohesion: AgentExecutor (LCOM4 12) lib/crewai/src/crewai/agents/agent_executor.py:187— AgentExecutor's methods fall into 12 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 12 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.
Low cohesion: Agent (LCOM4 5) lib/crewai/src/crewai/agent/core.py:213— Agent's methods fall into 5 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 5 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.
AC1 · Text alternatives· <canvas> without a text alternative · ×1
<canvas> without a text alternative lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:19— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
AC3 · Page structure· Page without a main landmark · ×1
Page without a main landmark lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 3 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
DatabricksQueryTool._run (cyclomatic 143) lib/crewai-tools/src/crewai_tools/tools/databricks_query_tool/databricks_query_tool.py:209— DatabricksQueryTool._run has cyclomatic complexity 143 (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.
LLM._handle_streaming_response (cyclomatic 81) lib/crewai/src/crewai/llm.py:815— LLM._handle_streaming_response has cyclomatic complexity 81 (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.
Flow.kickoff_async (cyclomatic 66) lib/crewai/src/crewai/flow/runtime/__init__.py:2181— Flow.kickoff_async has cyclomatic complexity 66 (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.
WatsonXEmbeddingFunction.__call__ (cyclomatic 58) lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:33— WatsonXEmbeddingFunction.__call__ has cyclomatic complexity 58 (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.
AnthropicCompletion._format_messages_for_anthropic (cyclomatic 51) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:868— AnthropicCompletion._format_messages_for_anthropic has cyclomatic complexity 51 (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.
BedrockCompletion._handle_converse (cyclomatic 48) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:705— BedrockCompletion._handle_converse has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (BedrockCompletion._ahandle_converse) 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.
BedrockCompletion._ahandle_converse (cyclomatic 48) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1320— BedrockCompletion._ahandle_converse has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (BedrockCompletion._handle_converse) 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.
ToolUsage._ause (cyclomatic 47) lib/crewai/src/crewai/tools/tool_usage.py:238— ToolUsage._ause has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ToolUsage._use) 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.
ToolUsage._use (cyclomatic 47) lib/crewai/src/crewai/tools/tool_usage.py:503— ToolUsage._use has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ToolUsage._ause) 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.
AgentExecutor._execute_single_native_tool_call (cyclomatic 45) lib/crewai/src/crewai/agents/agent_executor.py:2118— AgentExecutor._execute_single_native_tool_call 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.
LLM._ahandle_streaming_response (cyclomatic 44) lib/crewai/src/crewai/llm.py:1553— LLM._ahandle_streaming_response has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CrewRunApp._render_main_content (cyclomatic 40) lib/cli/src/crewai_cli/crew_run_tui.py:2032— CrewRunApp._render_main_content has cyclomatic complexity 40 (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.
BedrockCompletion._handle_streaming_converse (cyclomatic 40) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:993— BedrockCompletion._handle_streaming_converse has cyclomatic complexity 40 (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.
BedrockCompletion._ahandle_streaming_converse (cyclomatic 40) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1602— BedrockCompletion._ahandle_streaming_converse has cyclomatic complexity 40 (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.
GeminiCompletion._format_messages_for_gemini (cyclomatic 38) lib/crewai/src/crewai/llms/providers/gemini/completion.py:615— GeminiCompletion._format_messages_for_gemini has cyclomatic complexity 38 (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.
TurnRunner.stream_turn (cyclomatic 37) lib/crewai/src/crewai/experimental/flow_turns.py:259— TurnRunner.stream_turn 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.
CrewAIRagAdapter.add (cyclomatic 37) lib/crewai-tools/src/crewai_tools/adapters/crewai_rag_adapter.py:115— CrewAIRagAdapter.add 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.
create_crew.create_crew (cyclomatic 35) lib/cli/src/crewai_cli/create_crew.py:203— create_crew.create_crew has cyclomatic complexity 35 (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.
Flow._resume_async_body (cyclomatic 35) lib/crewai/src/crewai/flow/runtime/__init__.py:1468— Flow._resume_async_body has cyclomatic complexity 35 (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.
OpenAICompletion._prepare_responses_params (cyclomatic 35) lib/crewai/src/crewai/llms/providers/openai/completion.py:1014— OpenAICompletion._prepare_responses_params has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StreamingHandler.execute (cyclomatic 34) lib/crewai/src/crewai/a2a/updates/streaming/handler.py:236— StreamingHandler.execute has cyclomatic complexity 34 (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.
delegation._aexecute_a2a_delegation_impl (cyclomatic 34) lib/crewai/src/crewai/a2a/utils/delegation.py:375— delegation._aexecute_a2a_delegation_impl has cyclomatic complexity 34 (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.
DaytonaFileTool._run (cyclomatic 34) lib/crewai-tools/src/crewai_tools/tools/daytona_sandbox_tool/daytona_file_tool.py:238— DaytonaFileTool._run has cyclomatic complexity 34 (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.
TriggeredByHighlighter.highlightTriggeredBy (cyclomatic 34) lib/crewai/src/crewai/flow/visualization/assets/interactive.js:860— TriggeredByHighlighter.highlightTriggeredBy has cyclomatic complexity 34 (threshold 15). Of this number, 28 points are the body's own statements and 6 belong to 5 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.
pydantic_schema_utils._json_schema_to_pydantic_field (cyclomatic 33) lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:968— pydantic_schema_utils._json_schema_to_pydantic_field has cyclomatic complexity 33 (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.
create_json_crew._select_tools (cyclomatic 32) lib/cli/src/crewai_cli/create_json_crew.py:374— create_json_crew._select_tools has cyclomatic complexity 32 (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.
CrewRunApp._render_task_header (cyclomatic 32) lib/cli/src/crewai_cli/crew_run_tui.py:1913— CrewRunApp._render_task_header has cyclomatic complexity 32 (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.
CrewRunApp._render_log_panel (cyclomatic 32) lib/cli/src/crewai_cli/crew_run_tui.py:2161— CrewRunApp._render_log_panel has cyclomatic complexity 32 (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.
EvaluationDisplayFormatter.display_summary_results (cyclomatic 32) lib/crewai/src/crewai/experimental/evaluation/evaluation_display.py:103— EvaluationDisplayFormatter.display_summary_results has cyclomatic complexity 32 (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.
OpenAICompletion._ahandle_streaming_completion (cyclomatic 32) lib/crewai/src/crewai/llms/providers/openai/completion.py:2834— OpenAICompletion._ahandle_streaming_completion has cyclomatic complexity 32 (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.
EncodingFlow.execute_plans (cyclomatic 32) lib/crewai/src/crewai/memory/encoding_flow.py:372— EncodingFlow.execute_plans has cyclomatic complexity 32 (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.
LLM._handle_non_streaming_response (cyclomatic 31) lib/crewai/src/crewai/llm.py:1238— LLM._handle_non_streaming_response has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (LLM._ahandle_non_streaming_response) 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.
LLM._ahandle_non_streaming_response (cyclomatic 31) lib/crewai/src/crewai/llm.py:1397— LLM._ahandle_non_streaming_response has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (LLM._handle_non_streaming_response) 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.
OpenAICompletion._handle_streaming_completion (cyclomatic 31) lib/crewai/src/crewai/llms/providers/openai/completion.py:2499— OpenAICompletion._handle_streaming_completion has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Agent._prepare_kickoff (cyclomatic 30) lib/crewai/src/crewai/agent/core.py:1594— Agent._prepare_kickoff has cyclomatic complexity 30 (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.
AnthropicCompletion._handle_streaming_completion (cyclomatic 30) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1240— AnthropicCompletion._handle_streaming_completion has cyclomatic complexity 30 (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.
checkpoint_cli._parse_checkpoint_json (cyclomatic 29) lib/cli/src/crewai_cli/checkpoint_cli.py:107— checkpoint_cli._parse_checkpoint_json 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.
interactive.calculate_node_positions (cyclomatic 29) lib/crewai/src/crewai/flow/visualization/renderers/interactive.py:94— interactive.calculate_node_positions 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.
agent_utils.execute_single_native_tool_call (cyclomatic 29) lib/crewai/src/crewai/utilities/agent_utils.py:1440— agent_utils.execute_single_native_tool_call 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.
pydantic_schema_utils._json_schema_to_pydantic_type (cyclomatic 29) lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:1138— pydantic_schema_utils._json_schema_to_pydantic_type 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.
cli.release (cyclomatic 29) REDACTED:2316— cli.release 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.
builder.build_flow_structure (cyclomatic 28) lib/crewai/src/crewai/flow/visualization/builder.py:169— builder.build_flow_structure 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.
CheckpointTUI._refresh_tree (cyclomatic 27) lib/cli/src/crewai_cli/checkpoint_tui.py:335— CheckpointTUI._refresh_tree 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.
A2UIClientExtension.extract_state_from_history (cyclomatic 27) lib/crewai/src/crewai/a2a/extensions/a2ui/client_extension.py:215— A2UIClientExtension.extract_state_from_history 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.
OpenAICompletion._handle_streaming_responses (cyclomatic 27) lib/crewai/src/crewai/llms/providers/openai/completion.py:1462— OpenAICompletion._handle_streaming_responses 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. This shape REPEATS in the file: one other method here (OpenAICompletion._ahandle_streaming_responses) 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.
OpenAICompletion._ahandle_streaming_responses (cyclomatic 27) lib/crewai/src/crewai/llms/providers/openai/completion.py:1599— OpenAICompletion._ahandle_streaming_responses 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. This shape REPEATS in the file: one other method here (OpenAICompletion._handle_streaming_responses) 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.
RagTool.add (cyclomatic 27) lib/crewai-tools/src/crewai_tools/tools/rag/rag_tool.py:248— RagTool.add 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.
checkpoint_cli.diff_checkpoints (cyclomatic 26) lib/cli/src/crewai_cli/checkpoint_cli.py:542— checkpoint_cli.diff_checkpoints 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.
cli.create (cyclomatic 26) lib/cli/src/crewai_cli/cli.py:209— cli.create 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.
Crew._restore_runtime (cyclomatic 26) lib/crewai/src/crewai/crew.py:483— Crew._restore_runtime 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.
Crew._prepare_tools (cyclomatic 26) lib/crewai/src/crewai/crew.py:1664— Crew._prepare_tools 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.
AnthropicCompletion._ahandle_streaming_completion (cyclomatic 26) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1786— AnthropicCompletion._ahandle_streaming_completion 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.
GeminiCompletion._process_response_with_tools (cyclomatic 26) lib/crewai/src/crewai/llms/providers/gemini/completion.py:923— GeminiCompletion._process_response_with_tools 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.
EncodingFlow.parallel_analyze (cyclomatic 26) lib/crewai/src/crewai/memory/encoding_flow.py:224— EncodingFlow.parallel_analyze 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.
Task._aexecute_core (cyclomatic 26) lib/crewai/src/crewai/task.py:650— Task._aexecute_core has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (Task._execute_core) 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.
Task._execute_core (cyclomatic 26) lib/crewai/src/crewai/task.py:809— Task._execute_core has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (Task._aexecute_core) 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.
utils.prepare_kickoff (cyclomatic 25) lib/crewai/src/crewai/crews/utils.py:243— utils.prepare_kickoff 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.
flow_jobs.commit_job_update (cyclomatic 25) lib/crewai/src/crewai/experimental/flow_jobs.py:111— flow_jobs.commit_job_update 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.
Flow._create_initial_state (cyclomatic 25) lib/crewai/src/crewai/flow/runtime/__init__.py:1706— Flow._create_initial_state 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.
AnthropicCompletion._handle_completion (cyclomatic 25) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1086— AnthropicCompletion._handle_completion 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.
OracleVectorSearchTool._run (cyclomatic 25) lib/crewai-tools/src/crewai_tools/tools/oracle_vector_search_tool/vector_search.py:864— OracleVectorSearchTool._run 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.
vector_search._generate_condition (cyclomatic 25) lib/crewai-tools/src/crewai_tools/tools/oracle_vector_search_tool/vector_search.py:257— vector_search._generate_condition 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.
eval_crew._print_comparison (cyclomatic 24) lib/cli/src/crewai_cli/experimental/eval_crew.py:1918— eval_crew._print_comparison 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.
Flow._execute_method (cyclomatic 24) lib/crewai/src/crewai/flow/runtime/__init__.py:2924— Flow._execute_method 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.
LiteAgent._execute_core (cyclomatic 24) lib/crewai/src/crewai/lite_agent.py:671— LiteAgent._execute_core 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.
BedrockCompletion._format_messages_for_converse (cyclomatic 24) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1919— BedrockCompletion._format_messages_for_converse 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.
BraveSearchTool._run (cyclomatic 24) lib/crewai-tools/src/crewai_tools/tools/brave_search_tool/brave_search_tool.py:60— BraveSearchTool._run 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.
StagehandTool._async_run (cyclomatic 24) lib/crewai-tools/src/crewai_tools/tools/stagehand_tool/stagehand_tool.py:392— StagehandTool._async_run 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.
TriggeredByHighlighter.highlightTriggeredByGroup (cyclomatic 24) lib/crewai/src/crewai/flow/visualization/assets/interactive.js:662— TriggeredByHighlighter.highlightTriggeredByGroup has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 674, 676, 691, …). 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.
AnthropicCompletion._ahandle_completion (cyclomatic 23) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1644— AnthropicCompletion._ahandle_completion 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.
OpenAICompletion._handle_completion (cyclomatic 23) lib/crewai/src/crewai/llms/providers/openai/completion.py:2211— OpenAICompletion._handle_completion has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (OpenAICompletion._ahandle_completion) 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.
OpenAICompletion._ahandle_completion (cyclomatic 23) lib/crewai/src/crewai/llms/providers/openai/completion.py:2653— OpenAICompletion._ahandle_completion has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (OpenAICompletion._handle_completion) 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.
LanceDBStorage.get_scope_info (cyclomatic 23) lib/crewai/src/crewai/memory/storage/lancedb_storage.py:545— LanceDBStorage.get_scope_info 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.
Task.prompt (cyclomatic 23) lib/crewai/src/crewai/task.py:971— Task.prompt 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.
GithubLoader.load (cyclomatic 23) lib/crewai-tools/src/crewai_tools/rag/loaders/github_loader.py:14— GithubLoader.load 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.
BrightDataSearchTool._run (cyclomatic 23) lib/crewai-tools/src/crewai_tools/tools/brightdata_tool/brightdata_serp.py:139— BrightDataSearchTool._run has cyclomatic complexity 23 (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.
docs_check.docs_check (cyclomatic 23) lib/devtools/src/crewai_devtools/docs_check.py:352— docs_check.docs_check 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.
CrewRunApp._render_sidebar (cyclomatic 22) lib/cli/src/crewai_cli/crew_run_tui.py:1756— CrewRunApp._render_sidebar 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.
eval_crew.eval_crew (cyclomatic 22) lib/cli/src/crewai_cli/experimental/eval_crew.py:299— eval_crew.eval_crew 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.
tui_picker._arrow_select_multi (cyclomatic 22) lib/cli/src/crewai_cli/tui_picker.py:273— tui_picker._arrow_select_multi 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.
_utils._iter_flow_methods (cyclomatic 22) lib/crewai/src/crewai/flow/dsl/_utils.py:438— _utils._iter_flow_methods 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.
gen_ai_shapes.to_tool_definitions (cyclomatic 22) lib/crewai/src/crewai/telemetry/tracing/gen_ai_shapes.py:225— gen_ai_shapes.to_tool_definitions 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.
project_utils.get_crews (cyclomatic 22) lib/crewai/src/crewai/utilities/project_utils.py:56— project_utils.get_crews 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.
reset_memories.reset_memories_command (cyclomatic 22) lib/crewai/src/crewai/utilities/reset_memories.py:63— reset_memories.reset_memories_command 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.
StagehandTool._run (cyclomatic 22) lib/crewai-tools/src/crewai_tools/tools/stagehand_tool/stagehand_tool.py:577— StagehandTool._run 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.
checkpoint_tui._apply_task_overrides (cyclomatic 21) lib/cli/src/crewai_cli/checkpoint_tui.py:726— checkpoint_tui._apply_task_overrides 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.
wrapper._augment_prompt_with_a2a (cyclomatic 21) lib/crewai/src/crewai/a2a/wrapper.py:639— wrapper._augment_prompt_with_a2a 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.
AgentExecutor.execute_native_tool (cyclomatic 21) lib/crewai/src/crewai/agents/agent_executor.py:1917— AgentExecutor.execute_native_tool 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.
ToolInvocationEvaluator.evaluate (cyclomatic 21) lib/crewai/src/crewai/experimental/evaluation/metrics/tools_metrics.py:310— ToolInvocationEvaluator.evaluate 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.
OpenAICompletion._handle_responses (cyclomatic 21) lib/crewai/src/crewai/llms/providers/openai/completion.py:1174— OpenAICompletion._handle_responses has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (OpenAICompletion._ahandle_responses) 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.
OpenAICompletion._ahandle_responses (cyclomatic 21) lib/crewai/src/crewai/llms/providers/openai/completion.py:1319— OpenAICompletion._ahandle_responses has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (OpenAICompletion._handle_responses) 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.
QdrantEdgeStorage.search (cyclomatic 21) lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:314— QdrantEdgeStorage.search 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.
json_loader._load_json_crew_project_definition (cyclomatic 21) lib/crewai/src/crewai/project/json_loader.py:329— json_loader._load_json_crew_project_definition 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.
llm_utils._llm_via_environment_or_fallback (cyclomatic 21) lib/crewai/src/crewai/utilities/llm_utils.py:494— llm_utils._llm_via_environment_or_fallback 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.
project_utils.get_flows (cyclomatic 21) lib/crewai/src/crewai/utilities/project_utils.py:195— project_utils.get_flows 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.
DocsSiteLoader.load (cyclomatic 21) lib/crewai-tools/src/crewai_tools/rag/loaders/docs_site_loader.py:17— DocsSiteLoader.load 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.
SingleStoreSearchTool.__init__ (cyclomatic 21) lib/crewai-tools/src/crewai_tools/tools/singlestore_search_tool/singlestore_search_tool.py:123— SingleStoreSearchTool.__init__ 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.
cli._release_enterprise (cyclomatic 21) REDACTED:1768— cli._release_enterprise 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.
eval_crew._run_the_crew_to_evaluate (cyclomatic 20) lib/cli/src/crewai_cli/experimental/eval_crew.py:945— eval_crew._run_the_crew_to_evaluate 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.
eval_crew._wait (cyclomatic 20) lib/cli/src/crewai_cli/experimental/eval_crew.py:1320— eval_crew._wait 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.
eval_crew._progress_line (cyclomatic 20) lib/cli/src/crewai_cli/experimental/eval_crew.py:1729— eval_crew._progress_line 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.
update_crew.migrate_pyproject (cyclomatic 20) lib/cli/src/crewai_cli/update_crew.py:15— update_crew.migrate_pyproject 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.
FlowMeta.__new__ (cyclomatic 20) lib/crewai/src/crewai/flow/runtime/__init__.py:392— FlowMeta.__new__ 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.
Flow._execute_listeners (cyclomatic 20) lib/crewai/src/crewai/flow/runtime/__init__.py:3168— Flow._execute_listeners 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.
AzureCompletion._prepare_completion_params (cyclomatic 20) lib/crewai/src/crewai/llms/providers/azure/completion.py:650— AzureCompletion._prepare_completion_params 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.
MCPToolResolver._resolve_native (cyclomatic 20) lib/crewai/src/crewai/mcp/tool_resolver.py:335— MCPToolResolver._resolve_native 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.
LanceDBStorage.delete (cyclomatic 20) lib/crewai/src/crewai/memory/storage/lancedb_storage.py:433— LanceDBStorage.delete 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.
QdrantEdgeStorage._delete_from_shard (cyclomatic 20) lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:437— QdrantEdgeStorage._delete_from_shard 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.
QdrantEdgeStorage.get_scope_info (cyclomatic 20) lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:566— QdrantEdgeStorage.get_scope_info 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.
crew_base._register_crew_hooks (cyclomatic 20) lib/crewai/src/crewai/project/crew_base.py:434— crew_base._register_crew_hooks 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.
serialization.to_serializable (cyclomatic 20) lib/crewai/src/crewai/utilities/serialization.py:18— serialization.to_serializable 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.
YoutubeChannelLoader.load (cyclomatic 20) lib/crewai-tools/src/crewai_tools/rag/loaders/youtube_channel_loader.py:13— YoutubeChannelLoader.load 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.
MergeAgentHandlerTool.from_tool_name (cyclomatic 20) lib/crewai-tools/src/crewai_tools/tools/merge_agent_handler_tool/merge_agent_handler_tool.py:145— MergeAgentHandlerTool.from_tool_name 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.
checkpoint_tui._run_checkpoint_tui_async (cyclomatic 19) lib/cli/src/crewai_cli/checkpoint_tui.py:774— checkpoint_tui._run_checkpoint_tui_async 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.
create_crew.create_folder_structure (cyclomatic 19) lib/cli/src/crewai_cli/create_crew.py:48— create_crew.create_folder_structure 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.
eval_crew._export_refusal (cyclomatic 19) lib/cli/src/crewai_cli/experimental/eval_crew.py:2428— eval_crew._export_refusal has cyclomatic complexity 19 (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.
task_helpers.process_task_state (cyclomatic 19) lib/crewai/src/crewai/a2a/task_helpers.py:138— task_helpers.process_task_state 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.
agent_card._agent_to_agent_card (cyclomatic 19) lib/crewai/src/crewai/a2a/utils/agent_card.py:485— agent_card._agent_to_agent_card 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.
task.list_tasks (cyclomatic 19) lib/crewai/src/crewai/a2a/utils/task.py:506— task.list_tasks 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.
TraceBatchManager._initialize_backend_batch (cyclomatic 19) lib/crewai/src/crewai/events/listeners/tracing/trace_batch_manager.py:129— TraceBatchManager._initialize_backend_batch 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.
utils._get_machine_id (cyclomatic 19) lib/crewai/src/crewai/events/listeners/tracing/utils.py:235— utils._get_machine_id 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.
ReasoningEfficiencyEvaluator._analyze_reasoning_patterns (cyclomatic 19) lib/crewai/src/crewai/experimental/evaluation/metrics/reasoning_metrics.py:273— ReasoningEfficiencyEvaluator._analyze_reasoning_patterns 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.
ParameterExtractionEvaluator.evaluate (cyclomatic 19) lib/crewai/src/crewai/experimental/evaluation/metrics/tools_metrics.py:154— ParameterExtractionEvaluator.evaluate 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.
interactive.render_interactive (cyclomatic 19) lib/crewai/src/crewai/flow/visualization/renderers/interactive.py:204— interactive.render_interactive 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.
LLM._format_messages_for_provider (cyclomatic 19) lib/crewai/src/crewai/llm.py:2348— LLM._format_messages_for_provider 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.
AzureCompletion._init_responses_delegate (cyclomatic 19) lib/crewai/src/crewai/llms/providers/azure/completion.py:192— AzureCompletion._init_responses_delegate 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.
OpenAICompletion._prepare_completion_params (cyclomatic 19) lib/crewai/src/crewai/llms/providers/openai/completion.py:2114— OpenAICompletion._prepare_completion_params 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.
json_loader._strip_jsonc_comments (cyclomatic 19) lib/crewai/src/crewai/project/json_loader.py:508— json_loader._strip_jsonc_comments 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.
pydantic_schema_utils.strip_null_from_types (cyclomatic 19) lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:464— pydantic_schema_utils.strip_null_from_types 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.
CheckpointTUI._render_overview (cyclomatic 18) lib/cli/src/crewai_cli/checkpoint_tui.py:489— CheckpointTUI._render_overview 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.
crew_run_tui._colorize_json_line (cyclomatic 18) lib/cli/src/crewai_cli/crew_run_tui.py:140— crew_run_tui._colorize_json_line 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.
tui_picker._draw_multi (cyclomatic 18) lib/cli/src/crewai_cli/tui_picker.py:93— tui_picker._draw_multi 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.
agent_card._afetch_agent_card_impl (cyclomatic 18) lib/crewai/src/crewai/a2a/utils/agent_card.py:237— agent_card._afetch_agent_card_impl 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.
TraceCollectionListener._build_event_data (cyclomatic 18) lib/crewai/src/crewai/events/listeners/tracing/trace_listener.py:1010— TraceCollectionListener._build_event_data 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.
EvaluationDisplayFormatter.display_evaluation_with_feedback (cyclomatic 18) lib/crewai/src/crewai/experimental/evaluation/evaluation_display.py:24— EvaluationDisplayFormatter.display_evaluation_with_feedback 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.
LLM._matches_provider_pattern (cyclomatic 18) lib/crewai/src/crewai/llm.py:384— LLM._matches_provider_pattern 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.
AzureCompletion._process_streaming_update (cyclomatic 18) lib/crewai/src/crewai/llms/providers/azure/completion.py:975— AzureCompletion._process_streaming_update 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.
QdrantEdgeStorage._cleanup_orphaned_shards (cyclomatic 18) lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:807— QdrantEdgeStorage._cleanup_orphaned_shards 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.
Memory.recall (cyclomatic 18) lib/crewai/src/crewai/memory/unified_memory.py:686— Memory.recall 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.
utils._convert_chromadb_results_to_search_results (cyclomatic 18) lib/crewai/src/crewai/rag/chromadb/utils.py:192— utils._convert_chromadb_results_to_search_results 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.
Task._invoke_guardrail_function (cyclomatic 18) lib/crewai/src/crewai/task.py:1327— Task._invoke_guardrail_function has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (Task._ainvoke_guardrail_function) 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.
Task._ainvoke_guardrail_function (cyclomatic 18) lib/crewai/src/crewai/task.py:1447— Task._ainvoke_guardrail_function has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (Task._invoke_guardrail_function) 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.
handlers.handle_llm_call_completed (cyclomatic 18) lib/crewai/src/crewai/telemetry/tracing/handlers.py:2142— handlers.handle_llm_call_completed has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
tool_utils.aexecute_tool_and_check_finality (cyclomatic 18) lib/crewai/src/crewai/utilities/tool_utils.py:35— tool_utils.aexecute_tool_and_check_finality has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (tool_utils.execute_tool_and_check_finality) 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.
tool_utils.execute_tool_and_check_finality (cyclomatic 18) lib/crewai/src/crewai/utilities/tool_utils.py:200— tool_utils.execute_tool_and_check_finality has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (tool_utils.aexecute_tool_and_check_finality) 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.
RecursiveCharacterTextSplitter._merge_splits (cyclomatic 18) lib/crewai-tools/src/crewai_tools/rag/chunkers/base_chunker.py:108— RecursiveCharacterTextSplitter._merge_splits 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.
DataTypes.from_content (cyclomatic 18) lib/crewai-tools/src/crewai_tools/rag/data_types.py:100— DataTypes.from_content 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.
DaytonaFileToolSchema._validate_action_args (cyclomatic 18) lib/crewai-tools/src/crewai_tools/tools/daytona_sandbox_tool/daytona_file_tool.py:186— DaytonaFileToolSchema._validate_action_args 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.
cli._generate_release_notes (cyclomatic 18) REDACTED:938— cli._generate_release_notes 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.
NodeRenderer.drawNodeText (cyclomatic 18) lib/crewai/src/crewai/flow/visualization/assets/interactive.js:489— NodeRenderer.drawNodeText has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
StreamingHandler._try_recover_from_interruption (cyclomatic 17) lib/crewai/src/crewai/a2a/updates/streaming/handler.py:57— StreamingHandler._try_recover_from_interruption 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.
task._execute_impl (cyclomatic 17) lib/crewai/src/crewai/a2a/utils/task.py:306— task._execute_impl 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.
transport.negotiate_transport (cyclomatic 17) lib/crewai/src/crewai/a2a/utils/transport.py:109— transport.negotiate_transport 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.
AgentExecutor._prepare_tool_result_for_context (cyclomatic 17) lib/crewai/src/crewai/agents/agent_executor.py:296— AgentExecutor._prepare_tool_result_for_context 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.
ReasoningEfficiencyEvaluator.evaluate (cyclomatic 17) lib/crewai/src/crewai/experimental/evaluation/metrics/reasoning_metrics.py:48— ReasoningEfficiencyEvaluator.evaluate 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.
LLM.call (cyclomatic 17) lib/crewai/src/crewai/llm.py:1846— LLM.call 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.
MCPClient._clean_tool_arguments (cyclomatic 17) lib/crewai/src/crewai/mcp/client.py:564— MCPClient._clean_tool_arguments 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.
Task.interpolate_inputs_and_add_conversation_history (cyclomatic 17) lib/crewai/src/crewai/task.py:1063— Task.interpolate_inputs_and_add_conversation_history 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.
BaseTool._default_args_schema (cyclomatic 17) lib/crewai/src/crewai/tools/base_tool.py:209— BaseTool._default_args_schema 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.
BedrockInvokeAgentTool._run (cyclomatic 17) lib/crewai-tools/src/crewai_tools/aws/bedrock/agents/invoke_agent_tool.py:92— BedrockInvokeAgentTool._run 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.
cli.tag (cyclomatic 17) REDACTED:2196— cli.tag 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.
create_json_crew.create_json_crew (cyclomatic 16) lib/cli/src/crewai_cli/create_json_crew.py:1312— create_json_crew.create_json_crew 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.
eval_crew._refusal_message (cyclomatic 16) lib/cli/src/crewai_cli/experimental/eval_crew.py:2145— eval_crew._refusal_message 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.
SkillCommand.publish (cyclomatic 16) lib/cli/src/crewai_cli/skills/main.py:181— SkillCommand.publish 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.
PersistenceDecorator.persist_state (cyclomatic 16) lib/crewai/src/crewai/flow/persistence/decorators.py:71— PersistenceDecorator.persist_state 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.
FlowSkillReferenceExtractor.render_schema_type (cyclomatic 16) REDACTED:456— FlowSkillReferenceExtractor.render_schema_type 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.
LLM._resolve_route (cyclomatic 16) lib/crewai/src/crewai/llm.py:461— LLM._resolve_route 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.
LLM.acall (cyclomatic 16) lib/crewai/src/crewai/llm.py:1988— LLM.acall 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.
AzureCompletion.to_config_dict (cyclomatic 16) lib/crewai/src/crewai/llms/providers/azure/completion.py:360— AzureCompletion.to_config_dict 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.
GeminiCompletion._finalize_streaming_response (cyclomatic 16) lib/crewai/src/crewai/llms/providers/gemini/completion.py:1140— GeminiCompletion._finalize_streaming_response 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.
LanceDBStorage.search (cyclomatic 16) lib/crewai/src/crewai/memory/storage/lancedb_storage.py:395— LanceDBStorage.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.
registry.download_skill (cyclomatic 16) lib/crewai/src/crewai/skills/registry.py:275— registry.download_skill 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.
ToolUsage._validate_tool_input (cyclomatic 16) lib/crewai/src/crewai/tools/tool_usage.py:939— ToolUsage._validate_tool_input 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.
platform_apps._load_platform_catalog (cyclomatic 16) lib/crewai-core/src/crewai_core/platform_apps.py:37— platform_apps._load_platform_catalog 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.
docs_versioning._prune_missing_pages (cyclomatic 16) lib/devtools/src/crewai_devtools/docs_versioning.py:256— docs_versioning._prune_missing_pages 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.
prefix_version_paths._prune_missing_pages (cyclomatic 16) scripts/docs/prefix_version_paths.py:212— prefix_version_paths._prune_missing_pages 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.
DrawerManager.getPathSignature (cyclomatic 16) lib/crewai/src/crewai/flow/visualization/assets/interactive.js:1528— DrawerManager.getPathSignature has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 3 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.
HackComment lib/crewai-tools/src/crewai_tools/tools/llamaindex_tool/llamaindex_tool.py:82— # HACK: we are replacing the schema with our custom schema — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
DatabricksQueryTool._run (cognitive 470) lib/crewai-tools/src/crewai_tools/tools/databricks_query_tool/databricks_query_tool.py:209— DatabricksQueryTool._run has cognitive complexity 470 (threshold 15). Drivers by points: if/else 80 (287 pts), loops 26 (124 pts), boolean chains 37, ternaries 3 (12 pts), error handling 5 (10 pts) (nesting depth added 319). 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.
LLM._handle_streaming_response (cognitive 138) lib/crewai/src/crewai/llm.py:815— LLM._handle_streaming_response has cognitive complexity 138 (threshold 15). Drivers by points: if/else 40 (106 pts), boolean chains 23, error handling 5 (8 pts), loops 1 (nesting depth added 69). 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.
AnthropicCompletion._format_messages_for_anthropic (cognitive 120) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:868— AnthropicCompletion._format_messages_for_anthropic has cognitive complexity 120 (threshold 15). Drivers by points: if/else 29 (77 pts), ternaries 6 (24 pts), loops 5 (10 pts), boolean chains 9 (nesting depth added 71). 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.
Flow.kickoff_async (cognitive 97) lib/crewai/src/crewai/flow/runtime/__init__.py:2181— Flow.kickoff_async has cognitive complexity 97 (threshold 15). Drivers by points: if/else 41 (64 pts), boolean chains 15, ternaries 6 (10 pts), error handling 4 (6 pts), loops 1 (2 pts) (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.
LLM._ahandle_streaming_response (cognitive 97) lib/crewai/src/crewai/llm.py:1553— LLM._ahandle_streaming_response has cognitive complexity 97 (threshold 15). Drivers by points: if/else 29 (80 pts), loops 3 (8 pts), boolean chains 5, error handling 3 (4 pts) (nesting depth added 57). 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.
CrewAIRagAdapter.add (cognitive 96) lib/crewai-tools/src/crewai_tools/adapters/crewai_rag_adapter.py:115— CrewAIRagAdapter.add has cognitive complexity 96 (threshold 15). Drivers by points: if/else 27 (68 pts), loops 5 (16 pts), error handling 2 (9 pts), boolean chains 3 (nesting depth added 59). 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.
GeminiCompletion._format_messages_for_gemini (cognitive 95) lib/crewai/src/crewai/llms/providers/gemini/completion.py:615— GeminiCompletion._format_messages_for_gemini has cognitive complexity 95 (threshold 15). Drivers by points: if/else 23 (54 pts), ternaries 4 (15 pts), boolean chains 9, error handling 2 (9 pts), loops 3 (8 pts) (nesting depth added 54). 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.
BedrockCompletion._handle_streaming_converse (cognitive 94) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:993— BedrockCompletion._handle_streaming_converse has cognitive complexity 94 (threshold 15). Drivers by points: if/else 19 (64 pts), error handling 4 (13 pts), boolean chains 7, loops 2 (5 pts), ternaries 1 (5 pts) (nesting depth added 61). 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.
BedrockCompletion._ahandle_streaming_converse (cognitive 93) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1602— BedrockCompletion._ahandle_streaming_converse has cognitive complexity 93 (threshold 15). Drivers by points: if/else 19 (63 pts), error handling 4 (13 pts), boolean chains 7, loops 2 (5 pts), ternaries 1 (5 pts) (nesting depth added 60). 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.
ToolUsage._ause (cognitive 89) lib/crewai/src/crewai/tools/tool_usage.py:238— ToolUsage._ause has cognitive complexity 89 (threshold 15). Drivers by points: if/else 32 (68 pts), boolean chains 11, error handling 3 (7 pts), ternaries 1 (3 pts) (nesting depth added 42). 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 (ToolUsage._use) 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.
ToolUsage._use (cognitive 89) lib/crewai/src/crewai/tools/tool_usage.py:503— ToolUsage._use has cognitive complexity 89 (threshold 15). Drivers by points: if/else 32 (68 pts), boolean chains 11, error handling 3 (7 pts), ternaries 1 (3 pts) (nesting depth added 42). 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 (ToolUsage._ause) 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.
BedrockCompletion._handle_converse (cognitive 80) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:705— BedrockCompletion._handle_converse has cognitive complexity 80 (threshold 15). Drivers by points: if/else 32 (60 pts), error handling 4 (7 pts), loops 4 (7 pts), boolean chains 6 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (BedrockCompletion._ahandle_converse) 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.
BedrockCompletion._ahandle_converse (cognitive 80) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1320— BedrockCompletion._ahandle_converse has cognitive complexity 80 (threshold 15). Drivers by points: if/else 32 (60 pts), error handling 4 (7 pts), loops 4 (7 pts), boolean chains 6 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (BedrockCompletion._handle_converse) 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.
create_crew.create_crew (cognitive 79) lib/cli/src/crewai_cli/create_crew.py:203— create_crew.create_crew has cognitive complexity 79 (threshold 15). Drivers by points: if/else 21 (55 pts), loops 8 (19 pts), ternaries 3, boolean chains 2 (nesting depth added 45). 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.
create_json_crew._select_tools (cognitive 79) lib/cli/src/crewai_cli/create_json_crew.py:374— create_json_crew._select_tools has cognitive complexity 79 (threshold 15). Drivers by points: if/else 21 (51 pts), loops 7 (17 pts), ternaries 4 (11 pts) (nesting depth added 47). 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.
CrewRunApp._render_main_content (cognitive 77) lib/cli/src/crewai_cli/crew_run_tui.py:2032— CrewRunApp._render_main_content has cognitive complexity 77 (threshold 15). Drivers by points: if/else 23 (43 pts), loops 6 (17 pts), boolean chains 8, error handling 2 (5 pts), ternaries 1 (4 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatsonXEmbeddingFunction.__call__ (cognitive 75) lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:33— WatsonXEmbeddingFunction.__call__ has cognitive complexity 75 (threshold 15). Drivers by points: if/else 32 (49 pts), boolean chains 24, error handling 2 (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.
TriggeredByHighlighter.highlightTriggeredByGroup (cognitive 72) lib/crewai/src/crewai/flow/visualization/assets/interactive.js:662— TriggeredByHighlighter.highlightTriggeredByGroup has cognitive complexity 72 (threshold 15). Drivers by points: if/else 14 (55 pts), loops 3 (11 pts), boolean chains 6 (nesting depth added 49). Most of this is not in the body itself: 3 of the 72 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 674, 676, 691, …). 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.
StreamingHandler.execute (cognitive 71) lib/crewai/src/crewai/a2a/updates/streaming/handler.py:236— StreamingHandler.execute has cognitive complexity 71 (threshold 15). Drivers by points: if/else 16 (43 pts), ternaries 4 (13 pts), boolean chains 6, error handling 4 (5 pts), loops 2 (4 pts) (nesting depth added 39). 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.
AgentExecutor._execute_single_native_tool_call (cognitive 70) lib/crewai/src/crewai/agents/agent_executor.py:2118— AgentExecutor._execute_single_native_tool_call has cognitive complexity 70 (threshold 15). Drivers by points: if/else 25 (46 pts), boolean chains 11, loops 3 (6 pts), ternaries 3 (4 pts), error handling 1 (3 pts) (nesting depth added 27). 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.
OpenAICompletion._ahandle_streaming_completion (cognitive 69) lib/crewai/src/crewai/llms/providers/openai/completion.py:2834— OpenAICompletion._ahandle_streaming_completion has cognitive complexity 69 (threshold 15). Drivers by points: if/else 16 (42 pts), ternaries 4 (13 pts), boolean chains 6, loops 3 (6 pts), error handling 1 (2 pts) (nesting depth added 39). 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.
OpenAICompletion._handle_streaming_completion (cognitive 68) lib/crewai/src/crewai/llms/providers/openai/completion.py:2499— OpenAICompletion._handle_streaming_completion has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (44 pts), ternaries 4 (13 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 39). 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.
EvaluationDisplayFormatter.display_summary_results (cognitive 67) lib/crewai/src/crewai/experimental/evaluation/evaluation_display.py:103— EvaluationDisplayFormatter.display_summary_results has cognitive complexity 67 (threshold 15). Drivers by points: if/else 21 (51 pts), loops 8 (14 pts), boolean chains 2 (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.
GeminiCompletion._process_response_with_tools (cognitive 67) lib/crewai/src/crewai/llms/providers/gemini/completion.py:923— GeminiCompletion._process_response_with_tools has cognitive complexity 67 (threshold 15). Drivers by points: if/else 12 (40 pts), ternaries 3 (12 pts), boolean chains 8, loops 2 (7 pts) (nesting depth added 42). 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.
TriggeredByHighlighter.highlightTriggeredBy (cognitive 67) lib/crewai/src/crewai/flow/visualization/assets/interactive.js:860— TriggeredByHighlighter.highlightTriggeredBy has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (45 pts), boolean chains 11, loops 3 (11 pts) (nesting depth added 36). Of this number, 62 points are the body's own statements and 5 belong to 5 function literals inside it that branch. 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.
checkpoint_cli._parse_checkpoint_json (cognitive 64) lib/cli/src/crewai_cli/checkpoint_cli.py:107— checkpoint_cli._parse_checkpoint_json has cognitive complexity 64 (threshold 15). Drivers by points: if/else 11 (33 pts), loops 11 (26 pts), boolean chains 5 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
interactive.calculate_node_positions (cognitive 63) lib/crewai/src/crewai/flow/visualization/renderers/interactive.py:94— interactive.calculate_node_positions has cognitive complexity 63 (threshold 15). Drivers by points: if/else 16 (41 pts), loops 11 (18 pts), boolean chains 4 (nesting depth added 32). 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.
CrewRunApp._render_log_panel (cognitive 61) lib/cli/src/crewai_cli/crew_run_tui.py:2161— CrewRunApp._render_log_panel has cognitive complexity 61 (threshold 15). Drivers by points: if/else 18 (36 pts), ternaries 4 (11 pts), loops 3 (6 pts), error handling 2 (5 pts), boolean chains 3 (nesting depth added 31). 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.
CrewRunApp._render_task_header (cognitive 59) lib/cli/src/crewai_cli/crew_run_tui.py:1913— CrewRunApp._render_task_header has cognitive complexity 59 (threshold 15). Drivers by points: if/else 26 (53 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 29). 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.
CheckpointTUI._refresh_tree (cognitive 58) lib/cli/src/crewai_cli/checkpoint_tui.py:335— CheckpointTUI._refresh_tree has cognitive complexity 58 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 10 (22 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 32). 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.
TurnRunner.stream_turn (cognitive 57) lib/crewai/src/crewai/experimental/flow_turns.py:259— TurnRunner.stream_turn has cognitive complexity 57 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 7, ternaries 3 (6 pts), error handling 2, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Flow._execute_listeners (cognitive 57) lib/crewai/src/crewai/flow/runtime/__init__.py:3168— Flow._execute_listeners has cognitive complexity 57 (threshold 15). Drivers by points: if/else 13 (41 pts), loops 4 (8 pts), ternaries 2 (6 pts), boolean chains 2 (nesting depth added 36). 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.
builder.build_flow_structure (cognitive 56) lib/crewai/src/crewai/flow/visualization/builder.py:169— builder.build_flow_structure has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (41 pts), loops 8 (12 pts), boolean chains 3 (nesting depth added 29). 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.
Flow._resume_async_body (cognitive 54) lib/crewai/src/crewai/flow/runtime/__init__.py:1468— Flow._resume_async_body has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (30 pts), error handling 5 (10 pts), ternaries 5 (8 pts), boolean chains 6 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
checkpoint_tui._apply_task_overrides (cognitive 53) lib/cli/src/crewai_cli/checkpoint_tui.py:726— checkpoint_tui._apply_task_overrides has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (36 pts), loops 3 (7 pts), boolean chains 5, ternaries 1 (5 pts) (nesting depth added 33). 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.
AnthropicCompletion._handle_completion (cognitive 52) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1086— AnthropicCompletion._handle_completion has cognitive complexity 52 (threshold 15). Drivers by points: if/else 22 (41 pts), loops 3 (8 pts), boolean chains 2, error handling 1 (nesting depth added 24). 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.
AnthropicCompletion._handle_streaming_completion (cognitive 52) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1240— AnthropicCompletion._handle_streaming_completion has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (42 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pydantic_schema_utils._json_schema_to_pydantic_field (cognitive 51) lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:968— pydantic_schema_utils._json_schema_to_pydantic_field has cognitive complexity 51 (threshold 15). Drivers by points: if/else 23 (42 pts), ternaries 3 (5 pts), boolean chains 4 (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.
Agent._prepare_kickoff (cognitive 50) lib/crewai/src/crewai/agent/core.py:1594— Agent._prepare_kickoff has cognitive complexity 50 (threshold 15). Drivers by points: if/else 26 (42 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Flow._create_initial_state (cognitive 50) lib/crewai/src/crewai/flow/runtime/__init__.py:1706— Flow._create_initial_state has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (48 pts), boolean chains 2 (nesting depth added 26). 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.
EncodingFlow.execute_plans (cognitive 50) lib/crewai/src/crewai/memory/encoding_flow.py:372— EncodingFlow.execute_plans has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 8 (11 pts), ternaries 4 (10 pts), boolean chains 6 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
project_utils.get_crews (cognitive 49) lib/crewai/src/crewai/utilities/project_utils.py:56— project_utils.get_crews has cognitive complexity 49 (threshold 15). Drivers by points: if/else 9 (23 pts), error handling 4 (14 pts), loops 3 (7 pts), boolean chains 4, ternaries 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.
project_utils.get_flows (cognitive 49) lib/crewai/src/crewai/utilities/project_utils.py:195— project_utils.get_flows has cognitive complexity 49 (threshold 15). Drivers by points: if/else 8 (23 pts), error handling 4 (14 pts), loops 3 (7 pts), boolean chains 4, ternaries 1 (nesting depth added 29). 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.
MergeAgentHandlerTool.from_tool_name (cognitive 48) lib/crewai-tools/src/crewai_tools/tools/merge_agent_handler_tool/merge_agent_handler_tool.py:145— MergeAgentHandlerTool.from_tool_name has cognitive complexity 48 (threshold 15). Drivers by points: if/else 10 (36 pts), error handling 2 (5 pts), loops 1 (5 pts), boolean chains 2 (nesting depth added 33). 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.
docs_check.docs_check (cognitive 48) lib/devtools/src/crewai_devtools/docs_check.py:352— docs_check.docs_check has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (42 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 24). 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.
checkpoint_cli.diff_checkpoints (cognitive 47) lib/cli/src/crewai_cli/checkpoint_cli.py:542— checkpoint_cli.diff_checkpoints has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 9 (23 pts), if/else 11 (18 pts), loops 3 (4 pts), boolean chains 2 (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.
A2UIClientExtension.extract_state_from_history (cognitive 47) lib/crewai/src/crewai/a2a/extensions/a2ui/client_extension.py:215— A2UIClientExtension.extract_state_from_history has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (38 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 27). 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.
Task.prompt (cognitive 47) lib/crewai/src/crewai/task.py:971— Task.prompt has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 2 (8 pts), boolean chains 7, ternaries 1 (4 pts) (nesting depth added 25). 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_search._generate_condition (cognitive 47) lib/crewai-tools/src/crewai_tools/tools/oracle_vector_search_tool/vector_search.py:257— vector_search._generate_condition has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 3 (8 pts), boolean chains 4 (nesting depth added 26). 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.
AnthropicCompletion._ahandle_completion (cognitive 46) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1644— AnthropicCompletion._ahandle_completion has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (35 pts), loops 3 (8 pts), boolean chains 2, error handling 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.
DaytonaFileTool._run (cognitive 46) lib/crewai-tools/src/crewai_tools/tools/daytona_sandbox_tool/daytona_file_tool.py:238— DaytonaFileTool._run has cognitive complexity 46 (threshold 15). Drivers by points: if/else 26 (39 pts), boolean chains 7 (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.
checkpoint_tui._run_checkpoint_tui_async (cognitive 45) lib/cli/src/crewai_cli/checkpoint_tui.py:774— checkpoint_tui._run_checkpoint_tui_async has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (35 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 24). 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.
Crew._restore_runtime (cognitive 45) lib/crewai/src/crewai/crew.py:483— Crew._restore_runtime has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 6 (9 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnthropicCompletion._ahandle_streaming_completion (cognitive 45) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1786— AnthropicCompletion._ahandle_streaming_completion has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (37 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BedrockCompletion._format_messages_for_converse (cognitive 45) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1919— BedrockCompletion._format_messages_for_converse has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (25 pts), ternaries 3 (12 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 24). 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.
OpenAICompletion._handle_streaming_responses (cognitive 45) lib/crewai/src/crewai/llms/providers/openai/completion.py:1462— OpenAICompletion._handle_streaming_responses has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 6, error handling 2 (6 pts), loops 2 (3 pts), 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. This shape REPEATS in the file: one other method here (OpenAICompletion._ahandle_streaming_responses) 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.
OpenAICompletion._ahandle_streaming_responses (cognitive 45) lib/crewai/src/crewai/llms/providers/openai/completion.py:1599— OpenAICompletion._ahandle_streaming_responses has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 6, error handling 2 (6 pts), loops 2 (3 pts), 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. This shape REPEATS in the file: one other method here (OpenAICompletion._handle_streaming_responses) 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.
agent_utils.execute_single_native_tool_call (cognitive 45) lib/crewai/src/crewai/utilities/agent_utils.py:1440— agent_utils.execute_single_native_tool_call has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 6, error handling 1 (3 pts), ternaries 3, loops 2 (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.
StagehandTool._run (cognitive 45) lib/crewai-tools/src/crewai_tools/tools/stagehand_tool/stagehand_tool.py:577— StagehandTool._run has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 2 (7 pts), boolean chains 3, error handling 1 (nesting depth added 23). 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.
LLM._handle_non_streaming_response (cognitive 44) lib/crewai/src/crewai/llm.py:1238— LLM._handle_non_streaming_response has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 10, ternaries 2 (5 pts), error handling 2, loops 1 (2 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. This shape REPEATS in the file: one other method here (LLM._ahandle_non_streaming_response) 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.
LLM._ahandle_non_streaming_response (cognitive 44) lib/crewai/src/crewai/llm.py:1397— LLM._ahandle_non_streaming_response has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 10, ternaries 2 (5 pts), error handling 2, loops 1 (2 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. This shape REPEATS in the file: one other method here (LLM._handle_non_streaming_response) 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.
llm_utils._llm_via_environment_or_fallback (cognitive 44) lib/crewai/src/crewai/utilities/llm_utils.py:494— llm_utils._llm_via_environment_or_fallback has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 2 (9 pts), boolean chains 6, error handling 1, ternaries 1 (nesting depth added 25). 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.
LiteAgent._execute_core (cognitive 43) lib/crewai/src/crewai/lite_agent.py:671— LiteAgent._execute_core has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (30 pts), ternaries 4 (6 pts), error handling 2 (5 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_utils._iter_flow_methods (cognitive 42) lib/crewai/src/crewai/flow/dsl/_utils.py:438— _utils._iter_flow_methods has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 4 (7 pts), boolean chains 6, error handling 2 (6 pts) (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.
MCPToolResolver._resolve_native (cognitive 42) lib/crewai/src/crewai/mcp/tool_resolver.py:335— MCPToolResolver._resolve_native has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (23 pts), error handling 8 (16 pts), loops 2 (3 pts) (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.
YoutubeChannelLoader.load (cognitive 42) lib/crewai-tools/src/crewai_tools/rag/loaders/youtube_channel_loader.py:13— YoutubeChannelLoader.load has cognitive complexity 42 (threshold 15). Drivers by points: if/else 6 (17 pts), error handling 7 (12 pts), loops 3 (6 pts), ternaries 2 (6 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAICompletion._prepare_responses_params (cognitive 41) lib/crewai/src/crewai/llms/providers/openai/completion.py:1014— OpenAICompletion._prepare_responses_params has cognitive complexity 41 (threshold 15). Drivers by points: if/else 23 (28 pts), boolean chains 5, ternaries 3 (5 pts), loops 2 (3 pts) (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.
StagehandTool._async_run (cognitive 41) lib/crewai-tools/src/crewai_tools/tools/stagehand_tool/stagehand_tool.py:392— StagehandTool._async_run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (27 pts), error handling 3 (8 pts), loops 2 (4 pts), boolean chains 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.
AgentExecutor.execute_native_tool (cognitive 40) lib/crewai/src/crewai/agents/agent_executor.py:1917— AgentExecutor.execute_native_tool has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 3 (10 pts), error handling 2 (6 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Flow._execute_method (cognitive 40) lib/crewai/src/crewai/flow/runtime/__init__.py:2924— Flow._execute_method has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (36 pts), boolean chains 3, error handling 1 (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.
GithubLoader.load (cognitive 40) lib/crewai-tools/src/crewai_tools/rag/loaders/github_loader.py:14— GithubLoader.load has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 3 (9 pts), error handling 3 (5 pts), boolean chains 2, ternaries 1 (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.
CheckpointTUI._render_overview (cognitive 39) lib/cli/src/crewai_cli/checkpoint_tui.py:489— CheckpointTUI._render_overview has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 3 (8 pts), boolean chains 3 (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.
pydantic_schema_utils.strip_null_from_types (cognitive 39) lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:464— pydantic_schema_utils.strip_null_from_types has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 24). 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.
RagTool.add (cognitive 39) lib/crewai-tools/src/crewai_tools/tools/rag/rag_tool.py:248— RagTool.add has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 9, error handling 3 (8 pts), ternaries 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.
StreamingHandler._try_recover_from_interruption (cognitive 38) lib/crewai/src/crewai/a2a/updates/streaming/handler.py:57— StreamingHandler._try_recover_from_interruption has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (27 pts), ternaries 1 (4 pts), error handling 2 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EvaluationDisplayFormatter.display_evaluation_with_feedback (cognitive 38) lib/crewai/src/crewai/experimental/evaluation/evaluation_display.py:24— EvaluationDisplayFormatter.display_evaluation_with_feedback has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 4 (8 pts), boolean chains 2 (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.
MCPClient._clean_tool_arguments (cognitive 38) lib/crewai/src/crewai/mcp/client.py:564— MCPClient._clean_tool_arguments has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crew_base._register_crew_hooks (cognitive 38) lib/crewai/src/crewai/project/crew_base.py:434— crew_base._register_crew_hooks has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pydantic_schema_utils._json_schema_to_pydantic_type (cognitive 38) lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:1138— pydantic_schema_utils._json_schema_to_pydantic_type has cognitive complexity 38 (threshold 15). Drivers by points: if/else 24 (34 pts), boolean chains 4 (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.
reset_memories.reset_memories_command (cognitive 38) lib/crewai/src/crewai/utilities/reset_memories.py:63— reset_memories.reset_memories_command has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 5 (15 pts), boolean chains 2, error handling 2, loops 2 (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.
eval_crew._wait (cognitive 37) lib/cli/src/crewai_cli/experimental/eval_crew.py:1320— eval_crew._wait has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 4, error handling 1 (2 pts), loops 1, ternaries 1 (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.
LanceDBStorage.get_scope_info (cognitive 37) lib/crewai/src/crewai/memory/storage/lancedb_storage.py:545— LanceDBStorage.get_scope_info has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 9, ternaries 3 (5 pts), error handling 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent_utils.load_agent_from_repository (cognitive 37) lib/crewai/src/crewai/utilities/agent_utils.py:1070— agent_utils.load_agent_from_repository has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 2 (6 pts), error handling 1 (5 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JobRunner._process_events (cognitive 36) lib/crewai/src/crewai/experimental/flow_jobs.py:306— JobRunner._process_events has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (22 pts), ternaries 2 (7 pts), boolean chains 3, error handling 1 (3 pts), loops 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.
AzureCompletion._process_streaming_update (cognitive 36) lib/crewai/src/crewai/llms/providers/azure/completion.py:975— AzureCompletion._process_streaming_update has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (21 pts), boolean chains 6, ternaries 2 (6 pts), loops 1 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Task.ensure_guardrails_is_list_of_callables (cognitive 36) lib/crewai/src/crewai/task.py:412— Task.ensure_guardrails_is_list_of_callables has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 1 (4 pts) (nesting depth added 24). 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.
gen_ai_shapes.to_tool_definitions (cognitive 36) lib/crewai/src/crewai/telemetry/tracing/gen_ai_shapes.py:225— gen_ai_shapes.to_tool_definitions has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 8, error handling 1 (4 pts), loops 1, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.release (cognitive 36) REDACTED:2316— cli.release has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (23 pts), error handling 6 (8 pts), boolean chains 2, ternaries 2, loops 1 (nesting depth added 6). 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.
eval_crew._print_comparison (cognitive 35) lib/cli/src/crewai_cli/experimental/eval_crew.py:1918— eval_crew._print_comparison has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 4 (9 pts), loops 4 (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.
delegation._aexecute_a2a_delegation_impl (cognitive 35) lib/crewai/src/crewai/a2a/utils/delegation.py:375— delegation._aexecute_a2a_delegation_impl has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 10, ternaries 8 (9 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
utils.prepare_kickoff (cognitive 35) lib/crewai/src/crewai/crews/utils.py:243— utils.prepare_kickoff has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 6, error handling 1 (3 pts), ternaries 3, loops 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.
FlowMeta.__new__ (cognitive 35) lib/crewai/src/crewai/flow/runtime/__init__.py:392— FlowMeta.__new__ has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 6 (9 pts), boolean chains 4 (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.
QdrantEdgeStorage._cleanup_orphaned_shards (cognitive 35) lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:807— QdrantEdgeStorage._cleanup_orphaned_shards has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (20 pts), error handling 4 (8 pts), loops 2 (4 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.
json_loader._strip_jsonc_comments (cognitive 35) lib/crewai/src/crewai/project/json_loader.py:508— json_loader._strip_jsonc_comments has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (7 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DrawerManager.getPathSignature (cognitive 35) lib/crewai/src/crewai/flow/visualization/assets/interactive.js:1528— DrawerManager.getPathSignature has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 2 (6 pts), boolean chains 5 (nesting depth added 21). Of this number, 32 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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.
crew_run_tui._format_json_in_text (cognitive 34) lib/cli/src/crewai_cli/crew_run_tui.py:96— crew_run_tui._format_json_in_text has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 2 (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.
LLM._handle_streaming_callbacks (cognitive 34) lib/crewai/src/crewai/llm.py:1196— LLM._handle_streaming_callbacks has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (23 pts), error handling 1 (5 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EncodingFlow.parallel_analyze (cognitive 34) lib/crewai/src/crewai/memory/encoding_flow.py:224— EncodingFlow.parallel_analyze has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 10, ternaries 4 (8 pts), loops 3 (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.
Task._invoke_guardrail_function (cognitive 34) lib/crewai/src/crewai/task.py:1327— Task._invoke_guardrail_function has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Task._ainvoke_guardrail_function) 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.
Task._ainvoke_guardrail_function (cognitive 34) lib/crewai/src/crewai/task.py:1447— Task._ainvoke_guardrail_function has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Task._invoke_guardrail_function) 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.
agent_utils._setup_after_llm_call_hooks (cognitive 34) lib/crewai/src/crewai/utilities/agent_utils.py:1830— agent_utils._setup_after_llm_call_hooks has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (30 pts), error handling 1 (4 pts) (nesting depth added 19). 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.
DocsSiteLoader.load (cognitive 34) lib/crewai-tools/src/crewai_tools/rag/loaders/docs_site_loader.py:17— DocsSiteLoader.load has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 5 (8 pts), boolean chains 1, error handling 1, ternaries 1 (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.
CrewRunApp._render_sidebar (cognitive 33) lib/cli/src/crewai_cli/crew_run_tui.py:1756— CrewRunApp._render_sidebar has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 3 (4 pts), ternaries 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.
tool_utils.aexecute_tool_and_check_finality (cognitive 33) lib/crewai/src/crewai/utilities/tool_utils.py:35— tool_utils.aexecute_tool_and_check_finality has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 3 (7 pts), boolean chains 5, error handling 1 (5 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (tool_utils.execute_tool_and_check_finality) 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.
tool_utils.execute_tool_and_check_finality (cognitive 33) lib/crewai/src/crewai/utilities/tool_utils.py:200— tool_utils.execute_tool_and_check_finality has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 3 (7 pts), boolean chains 5, error handling 1 (5 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (tool_utils.aexecute_tool_and_check_finality) 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.
cli._release_enterprise (cognitive 33) REDACTED:1768— cli._release_enterprise has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 6 (8 pts), error handling 1 (2 pts), boolean chains 1, ternaries 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.
ToolCommand._print_tools_preview (cognitive 32) lib/cli/src/crewai_cli/tools/main.py:310— ToolCommand._print_tools_preview has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 5 (18 pts), if/else 4 (7 pts), loops 3 (7 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wrapper._augment_prompt_with_a2a (cognitive 32) lib/crewai/src/crewai/a2a/wrapper.py:639— wrapper._augment_prompt_with_a2a has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 4 (7 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.
Crew._prepare_tools (cognitive 32) lib/crewai/src/crewai/crew.py:1664— Crew._prepare_tools has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 11 (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.
QdrantEdgeStorage._delete_from_shard (cognitive 32) lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:437— QdrantEdgeStorage._delete_from_shard has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 8, loops 1 (2 pts), ternaries 1 (2 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.
json_loader._load_json_crew_project_definition (cognitive 32) lib/crewai/src/crewai/project/json_loader.py:329— json_loader._load_json_crew_project_definition has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 5, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.get_github_contributors (cognitive 32) REDACTED:777— cli.get_github_contributors has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (21 pts), error handling 3 (4 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 18). 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.
cli.create (cognitive 31) lib/cli/src/crewai_cli/cli.py:209— cli.create has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 6 (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.
AgentExecutor.execute_todos_parallel (cognitive 31) lib/crewai/src/crewai/agents/agent_executor.py:1430— AgentExecutor.execute_todos_parallel has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 3 (11 pts), loops 3, boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAICompletion._handle_responses (cognitive 31) lib/crewai/src/crewai/llms/providers/openai/completion.py:1174— OpenAICompletion._handle_responses has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 5 (9 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (OpenAICompletion._ahandle_responses) 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.
OpenAICompletion._ahandle_responses (cognitive 31) lib/crewai/src/crewai/llms/providers/openai/completion.py:1319— OpenAICompletion._ahandle_responses has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 5 (9 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (OpenAICompletion._handle_responses) 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.
OpenAICompletion._handle_completion (cognitive 31) lib/crewai/src/crewai/llms/providers/openai/completion.py:2211— OpenAICompletion._handle_completion has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (19 pts), error handling 5 (7 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (OpenAICompletion._ahandle_completion) 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.
OpenAICompletion._ahandle_completion (cognitive 31) lib/crewai/src/crewai/llms/providers/openai/completion.py:2653— OpenAICompletion._ahandle_completion has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (19 pts), error handling 5 (7 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (OpenAICompletion._handle_completion) 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.
QdrantEdgeStorage.__init__ (cognitive 31) lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:89— QdrantEdgeStorage.__init__ has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 1 (5 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 16). 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.
QdrantEdgeStorage.get_scope_info (cognitive 31) lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:566— QdrantEdgeStorage.get_scope_info has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (5 pts), boolean chains 4, error handling 1 (2 pts), ternaries 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.
Task._aexecute_core (cognitive 31) lib/crewai/src/crewai/task.py:650— Task._aexecute_core has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 8, ternaries 2 (4 pts), loops 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Task._execute_core) 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.
Task._execute_core (cognitive 31) lib/crewai/src/crewai/task.py:809— Task._execute_core has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 8, ternaries 2 (4 pts), loops 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Task._aexecute_core) 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.
BaseTool._default_args_schema (cognitive 31) lib/crewai/src/crewai/tools/base_tool.py:209— BaseTool._default_args_schema has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (22 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 1 (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.
BraveSearchTool._run (cognitive 31) lib/crewai-tools/src/crewai_tools/tools/brave_search_tool/brave_search_tool.py:60— BraveSearchTool._run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 3, error handling 2, 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.
agent_card._afetch_agent_card_impl (cognitive 30) lib/crewai/src/crewai/a2a/utils/agent_card.py:237— agent_card._afetch_agent_card_impl has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 6 (11 pts), error handling 4, 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.
wrapper._delegate_to_a2a (cognitive 30) lib/crewai/src/crewai/a2a/wrapper.py:1231— wrapper._delegate_to_a2a has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 2, ternaries 1 (2 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. This shape REPEATS in the file: one other method here (wrapper._adelegate_to_a2a) 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.
wrapper._adelegate_to_a2a (cognitive 30) lib/crewai/src/crewai/a2a/wrapper.py:1603— wrapper._adelegate_to_a2a has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 2, ternaries 1 (2 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. This shape REPEATS in the file: one other method here (wrapper._delegate_to_a2a) 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.
StepExecutor._execute_native_tool_calls (cognitive 30) lib/crewai/src/crewai/agents/step_executor.py:624— StepExecutor._execute_native_tool_calls has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (25 pts), ternaries 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 16). 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.
MCPClient._retry_operation (cognitive 30) lib/crewai/src/crewai/mcp/client.py:702— MCPClient._retry_operation has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (22 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecursiveCharacterTextSplitter._merge_splits (cognitive 30) lib/crewai-tools/src/crewai_tools/rag/chunkers/base_chunker.py:108— RecursiveCharacterTextSplitter._merge_splits has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 5, loops 2 (4 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.
OracleVectorSearchTool._run (cognitive 30) lib/crewai-tools/src/crewai_tools/tools/oracle_vector_search_tool/vector_search.py:864— OracleVectorSearchTool._run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 8, ternaries 6 (7 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.
task.list_tasks (cognitive 29) lib/crewai/src/crewai/a2a/utils/task.py:506— task.list_tasks has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, loops 3 (4 pts), error handling 1 (2 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.
Flow._execute_single_listener (cognitive 29) lib/crewai/src/crewai/flow/runtime/__init__.py:3348— Flow._execute_single_listener has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 1 (4 pts), boolean chains 1, error handling 1 (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.
LiteAgent._invoke_loop (cognitive 29) lib/crewai/src/crewai/lite_agent.py:915— LiteAgent._invoke_loop has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 5 (11 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
utils._prepare_documents_for_chromadb (cognitive 29) lib/crewai/src/crewai/rag/chromadb/utils.py:56— utils._prepare_documents_for_chromadb has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 1 (4 pts), boolean chains 2, error handling 1, 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.
docs_versioning._prune_missing_pages (cognitive 29) lib/devtools/src/crewai_devtools/docs_versioning.py:256— docs_versioning._prune_missing_pages has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (4 pts), boolean chains 3 (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.
prefix_version_paths._prune_missing_pages (cognitive 29) scripts/docs/prefix_version_paths.py:212— prefix_version_paths._prune_missing_pages has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (4 pts), boolean chains 3 (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.
renderConditionTree (cognitive 29) lib/crewai/src/crewai/flow/visualization/assets/interactive.js:1572— renderConditionTree has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 6 (10 pts), boolean chains 1 (nesting depth added 16). Most of this is not in the body itself: 13 of the 29 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1597, 1586, 1587, …). 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.
crew_run_tui._colorize_json_line (cognitive 28) lib/cli/src/crewai_cli/crew_run_tui.py:140— crew_run_tui._colorize_json_line has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Crew.validate_async_task_cannot_include_sequential_async_tasks_in_context (cognitive 28) lib/crewai/src/crewai/crew.py:846— Crew.validate_async_task_cannot_include_sequential_async_tasks_in_context has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (18 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ToolInvocationEvaluator.evaluate (cognitive 28) lib/crewai/src/crewai/experimental/evaluation/metrics/tools_metrics.py:310— ToolInvocationEvaluator.evaluate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 4 (7 pts), loops 4 (5 pts), boolean chains 2, error handling 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.
interactive.render_interactive (cognitive 28) lib/crewai/src/crewai/flow/visualization/renderers/interactive.py:204— interactive.render_interactive has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LanceDBStorage.delete (cognitive 28) lib/crewai/src/crewai/memory/storage/lancedb_storage.py:433— LanceDBStorage.delete has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 7, 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.
QdrantEdgeStorage.search (cognitive 28) lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:314— QdrantEdgeStorage.search has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, loops 3, error handling 1 (2 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.
Memory.recall (cognitive 28) lib/crewai/src/crewai/memory/unified_memory.py:686— Memory.recall has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 6, error handling 2 (3 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.
pydantic_schema_utils.ensure_all_properties_required (cognitive 28) lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:423— pydantic_schema_utils.ensure_all_properties_required has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (6 pts), boolean chains 1 (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.
cli._generate_release_notes (cognitive 28) REDACTED:938— cli._generate_release_notes has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (21 pts), error handling 2 (3 pts), boolean chains 2, loops 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.
eval_crew._project_files (cognitive 27) lib/cli/src/crewai_cli/experimental/eval_crew.py:833— eval_crew._project_files has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (16 pts), error handling 2 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillCommand.list_cached (cognitive 27) lib/cli/src/crewai_cli/skills/main.py:294— SkillCommand.list_cached has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (7 pts), error handling 1 (5 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update_crew.migrate_pyproject (cognitive 27) lib/cli/src/crewai_cli/update_crew.py:15— update_crew.migrate_pyproject has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 6, 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.
utils.ahandle_knowledge_retrieval (cognitive 27) lib/crewai/src/crewai/agent/utils.py:329— utils.ahandle_knowledge_retrieval has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 3, error handling 1, ternaries 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.
utils._get_machine_id (cognitive 27) lib/crewai/src/crewai/events/listeners/tracing/utils.py:235— utils._get_machine_id has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 8 (13 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.
platform_apps._load_platform_catalog (cognitive 27) lib/crewai-core/src/crewai_core/platform_apps.py:37— platform_apps._load_platform_catalog has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, loops 2 (3 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.
BedrockInvokeAgentTool._run (cognitive 27) lib/crewai-tools/src/crewai_tools/aws/bedrock/agents/invoke_agent_tool.py:92— BedrockInvokeAgentTool._run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 4, 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.
NL2SQLTool._validate_statement (cognitive 27) lib/crewai-tools/src/crewai_tools/tools/nl2sql/nl2sql_tool.py:316— NL2SQLTool._validate_statement has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (27 pts) (nesting depth added 15). 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.
task_helpers.process_task_state (cognitive 26) lib/crewai/src/crewai/a2a/task_helpers.py:138— task_helpers.process_task_state has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3, ternaries 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.
AgentExecutor._should_parallelize_native_tool_calls (cognitive 26) lib/crewai/src/crewai/agents/agent_executor.py:2085— AgentExecutor._should_parallelize_native_tool_calls has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (4 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.
pydantic_schema_utils.ensure_type_in_schemas (cognitive 26) lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:268— pydantic_schema_utils.ensure_type_in_schemas has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (10 pts), boolean chains 1 (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.
serialization.to_serializable (cognitive 26) lib/crewai/src/crewai/utilities/serialization.py:18— serialization.to_serializable has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (18 pts), error handling 2 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ContextualAIQueryTool._run (cognitive 26) lib/crewai-tools/src/crewai_tools/tools/contextualai_query_tool/contextual_query_tool.py:69— ContextualAIQueryTool._run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 3 (8 pts), ternaries 2 (4 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.
cli._update_all_versions (cognitive 26) REDACTED:869— cli._update_all_versions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (9 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.
cli.tag (cognitive 26) REDACTED:2196— cli.tag has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (8 pts), error handling 4 (6 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.
tui_picker._draw_multi (cognitive 25) lib/cli/src/crewai_cli/tui_picker.py:93— tui_picker._draw_multi has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 4 (8 pts), boolean chains 4, error handling 1, 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.
agent_card._agent_to_agent_card (cognitive 25) lib/crewai/src/crewai/a2a/utils/agent_card.py:485— agent_card._agent_to_agent_card has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, loops 2 (5 pts), ternaries 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transport.negotiate_transport (cognitive 25) lib/crewai/src/crewai/a2a/utils/transport.py:109— transport.negotiate_transport has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6, loops 2 (4 pts), 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.
AgentExecutor.finalize (cognitive 25) lib/crewai/src/crewai/agents/agent_executor.py:2557— AgentExecutor.finalize has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (23 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.
StepExecutor._execute_native (cognitive 25) lib/crewai/src/crewai/agents/step_executor.py:562— StepExecutor._execute_native has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (6 pts), boolean chains 3, 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.
TraceBatchManager._initialize_backend_batch (cognitive 25) lib/crewai/src/crewai/events/listeners/tracing/trace_batch_manager.py:129— TraceBatchManager._initialize_backend_batch has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 3 (7 pts), boolean chains 4, error handling 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.
flow_jobs.commit_job_update (cognitive 25) lib/crewai/src/crewai/experimental/flow_jobs.py:111— flow_jobs.commit_job_update has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 11, error handling 1, 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.
GeminiCompletion._finalize_streaming_response (cognitive 25) lib/crewai/src/crewai/llms/providers/gemini/completion.py:1140— GeminiCompletion._finalize_streaming_response has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (4 pts), boolean chains 3, ternaries 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.
cli._update_docs_and_create_pr (cognitive 25) REDACTED:1091— cli._update_docs_and_create_pr has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 3 (6 pts), loops 3 (4 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.
CrewAIEventsBus._emit_with_dependencies (cognitive 24) lib/crewai/src/crewai/events/event_bus.py:458— CrewAIEventsBus._emit_with_dependencies has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (23 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.
TraceCollectionListener._build_event_data (cognitive 24) lib/crewai/src/crewai/events/listeners/tracing/trace_listener.py:1010— TraceCollectionListener._build_event_data has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 7, boolean chains 3 (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.
LLM.call (cognitive 24) lib/crewai/src/crewai/llm.py:1846— LLM.call has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, error handling 3, loops 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.
LLM._format_messages_for_provider (cognitive 24) lib/crewai/src/crewai/llm.py:2348— LLM._format_messages_for_provider has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6, loops 2 (3 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.
AnthropicCompletion._extract_thinking_block (cognitive 24) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:775— AnthropicCompletion._extract_thinking_block has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 3 (5 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.
pydantic_schema_utils.convert_oneof_to_anyof (cognitive 24) lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:385— pydantic_schema_utils.convert_oneof_to_anyof has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileProcessor._chunk_process (cognitive 24) lib/crewai-files/src/crewai_files/processing/processor.py:305— FileProcessor._chunk_process has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 2 (8 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.
SingleStoreSearchTool.__init__ (cognitive 24) lib/crewai-tools/src/crewai_tools/tools/singlestore_search_tool/singlestore_search_tool.py:123— SingleStoreSearchTool.__init__ has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 14, if/else 6 (7 pts), error handling 1 (3 pts) (nesting depth added 3). 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.
eval_crew.eval_crew (cognitive 23) lib/cli/src/crewai_cli/experimental/eval_crew.py:299— eval_crew.eval_crew has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, error handling 4, ternaries 3 (4 pts) (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.
eval_crew._run_the_crew_to_evaluate (cognitive 23) lib/cli/src/crewai_cli/experimental/eval_crew.py:945— eval_crew._run_the_crew_to_evaluate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 6, ternaries 3 (4 pts) (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.
model_catalog._fetch_gemini (cognitive 23) lib/cli/src/crewai_cli/model_catalog.py:257— model_catalog._fetch_gemini has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 7, loops 2 (3 pts), error handling 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.
tui_picker._arrow_select_multi (cognitive 23) lib/cli/src/crewai_cli/tui_picker.py:273— tui_picker._arrow_select_multi has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 8, 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.
task_helpers.send_message_and_get_task_id (cognitive 23) lib/crewai/src/crewai/a2a/task_helpers.py:288— task_helpers.send_message_and_get_task_id has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 1 (3 pts), boolean chains 2, error handling 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.
utils.handle_knowledge_retrieval (cognitive 23) lib/crewai/src/crewai/agent/utils.py:125— utils.handle_knowledge_retrieval has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, error handling 1, ternaries 1 (nesting depth added 10). 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.
ReasoningEfficiencyEvaluator._analyze_reasoning_patterns (cognitive 23) lib/crewai/src/crewai/experimental/evaluation/metrics/reasoning_metrics.py:273— ReasoningEfficiencyEvaluator._analyze_reasoning_patterns has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, loops 2 (4 pts), error handling 1 (3 pts), ternaries 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.
ParameterExtractionEvaluator.evaluate (cognitive 23) lib/crewai/src/crewai/experimental/evaluation/metrics/tools_metrics.py:154— ParameterExtractionEvaluator.evaluate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 3 (5 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ToolUsage.use (cognitive 23) lib/crewai/src/crewai/tools/tool_usage.py:148— ToolUsage.use has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, error handling 2 (3 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 (ToolUsage.ause) 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.
ToolUsage.ause (cognitive 23) lib/crewai/src/crewai/tools/tool_usage.py:187— ToolUsage.ause has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, error handling 2 (3 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 (ToolUsage.use) 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.
YoutubeVideoLoader.load (cognitive 23) lib/crewai-tools/src/crewai_tools/rag/loaders/youtube_video_loader.py:14— YoutubeVideoLoader.load has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 5 (7 pts), ternaries 2 (5 pts), loops 1 (2 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.
BrightDataSearchTool._run (cognitive 23) lib/crewai-tools/src/crewai_tools/tools/brightdata_tool/brightdata_serp.py:139— BrightDataSearchTool._run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 6, error handling 2, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
cli.create_or_reset_branch (cognitive 23) REDACTED:212— cli.create_or_reset_branch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 1, 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.
cli.bump (cognitive 23) REDACTED:2080— cli.bump has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), error handling 2, boolean chains 1, 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.
SkillCommand.install (cognitive 22) lib/cli/src/crewai_cli/skills/main.py:74— SkillCommand.install has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 2 (4 pts), boolean chains 2, error handling 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.
SkillCommand.publish (cognitive 22) lib/cli/src/crewai_cli/skills/main.py:181— SkillCommand.publish has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 3 (6 pts), boolean chains 3, 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.
EvaluationDisplayFormatter._aggregate_agent_results (cognitive 22) lib/crewai/src/crewai/experimental/evaluation/evaluation_display.py:250— EvaluationDisplayFormatter._aggregate_agent_results has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (4 pts), ternaries 1 (2 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.
ReasoningEfficiencyEvaluator.evaluate (cognitive 22) lib/crewai/src/crewai/experimental/evaluation/metrics/reasoning_metrics.py:48— ReasoningEfficiencyEvaluator.evaluate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 5 (7 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CrewDoclingSource.validate_content (cognitive 22) lib/crewai/src/crewai/knowledge/source/crew_docling_source.py:159— CrewDoclingSource.validate_content has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 1 (4 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LLM.acall (cognitive 22) lib/crewai/src/crewai/llm.py:1988— LLM.acall has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, error handling 3, loops 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.
AzureCompletion._prepare_completion_params (cognitive 22) lib/crewai/src/crewai/llms/providers/azure/completion.py:650— AzureCompletion._prepare_completion_params has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
completion._preprocess_structured_data (cognitive 22) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:76— completion._preprocess_structured_data has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (4 pts), boolean chains 3 (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.
GeminiCompletion._add_property_ordering (cognitive 22) lib/crewai/src/crewai/llms/providers/gemini/completion.py:1531— GeminiCompletion._add_property_ordering has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (6 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.
BaseTool.from_langchain (cognitive 22) lib/crewai/src/crewai/tools/base_tool.py:424— BaseTool.from_langchain has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 1 (3 pts), loops 1 (2 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. This shape REPEATS in the file: one other method here (Tool.from_langchain) 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.
Tool.from_langchain (cognitive 22) lib/crewai/src/crewai/tools/base_tool.py:609— Tool.from_langchain has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 1 (3 pts), loops 1 (2 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. This shape REPEATS in the file: one other method here (BaseTool.from_langchain) 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.
TokenCalcHandler.log_success_event (cognitive 22) lib/crewai/src/crewai/utilities/token_counter_callback.py:38— TokenCalcHandler.log_success_event has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 2 (nesting depth added 12). 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.
DataTypes.from_content (cognitive 22) lib/crewai-tools/src/crewai_tools/rag/data_types.py:100— DataTypes.from_content has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, error handling 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.
DirectoryLoader._find_files (cognitive 22) lib/crewai-tools/src/crewai_tools/rag/loaders/directory_loader.py:89— DirectoryLoader._find_files has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (7 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
URLReadTool._extract_xlsx (cognitive 22) lib/crewai-tools/src/crewai_tools/tools/url_read_tool/url_read_tool.py:385— URLReadTool._extract_xlsx has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), ternaries 1 (3 pts), error handling 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.
TriggeredByHighlighter.animateEdgeStyles (cognitive 22) lib/crewai/src/crewai/flow/visualization/assets/interactive.js:1037— TriggeredByHighlighter.animateEdgeStyles has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 4 (8 pts), boolean chains 4 (nesting depth added 6). None of this is in the body itself: all 22 points belong to 2 function items inside it that branch (a function literal at line 1047, animate). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CheckpointTUI._render_tasks (cognitive 21) lib/cli/src/crewai_cli/checkpoint_tui.py:575— CheckpointTUI._render_tasks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (3 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.
create_crew.create_folder_structure (cognitive 21) lib/cli/src/crewai_cli/create_crew.py:48— create_crew.create_folder_structure has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
create_json_crew._setup_env (cognitive 21) lib/cli/src/crewai_cli/create_json_crew.py:1004— create_json_crew._setup_env has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (6 pts), ternaries 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.
CrewRunApp._try_parse_plan (cognitive 21) lib/cli/src/crewai_cli/crew_run_tui.py:2370— CrewRunApp._try_parse_plan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), error handling 1 (4 pts), boolean chains 1, 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.
DeployValidator._check_env_vars_json (cognitive 21) lib/cli/src/crewai_cli/deploy/validate.py:415— DeployValidator._check_env_vars_json has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (5 pts), loops 3 (4 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.
utils.validate_auth_against_agent_card (cognitive 21) lib/crewai/src/crewai/a2a/auth/utils.py:149— utils.validate_auth_against_agent_card has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 1, loops 1, ternaries 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.
task_helpers.extract_error_message (cognitive 21) lib/crewai/src/crewai/a2a/task_helpers.py:111— task_helpers.extract_error_message has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Agent._build_output_from_result (cognitive 21) lib/crewai/src/crewai/agent/core.py:1986— Agent._build_output_from_result has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 5 (7 pts), error handling 2 (5 pts), boolean chains 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.
AnthropicCompletion._handle_tool_use_conversation (cognitive 21) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1531— AnthropicCompletion._handle_tool_use_conversation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (3 pts), error handling 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.
json_loader._input_files_definition_errors (cognitive 21) lib/crewai/src/crewai/project/json_loader.py:1714— json_loader._input_files_definition_errors has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (7 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
utils._convert_chromadb_results_to_search_results (cognitive 21) lib/crewai/src/crewai/rag/chromadb/utils.py:192— utils._convert_chromadb_results_to_search_results has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 7, if/else 2 (4 pts), 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.
Task.interpolate_inputs_and_add_conversation_history (cognitive 21) lib/crewai/src/crewai/task.py:1063— Task.interpolate_inputs_and_add_conversation_history has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 5 (7 pts), boolean chains 3 (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.
pydantic_schema_utils._strip_keys_recursive (cognitive 21) lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:551— pydantic_schema_utils._strip_keys_recursive has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (10 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.
create_json_crew._wizard_agents_and_tasks (cognitive 20) lib/cli/src/crewai_cli/create_json_crew.py:708— create_json_crew._wizard_agents_and_tasks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (4 pts), boolean chains 2, loops 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.
CrewRunApp._append_evaluation (cognitive 20) lib/cli/src/crewai_cli/crew_run_tui.py:1873— CrewRunApp._append_evaluation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, ternaries 1 (4 pts), loops 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
eval_crew._progress_line (cognitive 20) lib/cli/src/crewai_cli/experimental/eval_crew.py:1729— eval_crew._progress_line has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, boolean chains 7, ternaries 3 (4 pts) (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.
eval_crew._export_refusal (cognitive 20) lib/cli/src/crewai_cli/experimental/eval_crew.py:2428— eval_crew._export_refusal has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (10 pts) (nesting depth added 2). 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.
run_declarative_flow._resolve_flow_inputs (cognitive 20) lib/cli/src/crewai_cli/run_declarative_flow.py:353— run_declarative_flow._resolve_flow_inputs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (5 pts), boolean chains 3, loops 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.
task._execute_impl (cognitive 20) lib/crewai/src/crewai/a2a/utils/task.py:306— task._execute_impl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, error handling 3 (5 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
StepExecutor._execute_text_parsed (cognitive 20) lib/crewai/src/crewai/agents/step_executor.py:335— StepExecutor._execute_text_parsed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (4 pts), boolean chains 3, loops 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.
TraceBatchManager._finalize_backend_batch (cognitive 20) lib/crewai/src/crewai/events/listeners/tracing/trace_batch_manager.py:386— TraceBatchManager._finalize_backend_batch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (5 pts), boolean chains 4, 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.
ConsoleFormatter.handle_agent_logs_execution (cognitive 20) lib/crewai/src/crewai/events/utils/console_formatter.py:1161— ConsoleFormatter.handle_agent_logs_execution has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 10). 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.
Flow._initialize_state (cognitive 20) lib/crewai/src/crewai/flow/runtime/__init__.py:1889— Flow._initialize_state has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 1 (2 pts), 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.
LLM._resolve_route (cognitive 20) lib/crewai/src/crewai/llm.py:461— LLM._resolve_route has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, ternaries 2 (3 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.
GeminiCompletion._process_stream_chunk (cognitive 20) lib/crewai/src/crewai/llms/providers/gemini/completion.py:1043— GeminiCompletion._process_stream_chunk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (6 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 10). 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.
OpenAICompletion._finalize_streaming_response (cognitive 20) lib/crewai/src/crewai/llms/providers/openai/completion.py:2394— OpenAICompletion._finalize_streaming_response has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, error handling 1 (3 pts), 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.
SnowflakeCompletion._normalize_stringified_tool_calls (cognitive 20) lib/crewai/src/crewai/llms/providers/snowflake/completion.py:167— SnowflakeCompletion._normalize_stringified_tool_calls has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 1 (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.
LanceDBStorage.search (cognitive 20) lib/crewai/src/crewai/memory/storage/lancedb_storage.py:395— LanceDBStorage.search has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, ternaries 2 (3 pts), 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.
json_loader._resolve_tools (cognitive 20) lib/crewai/src/crewai/project/json_loader.py:1803— json_loader._resolve_tools has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 2 (4 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.
json_loader._tool_definition_errors (cognitive 20) lib/crewai/src/crewai/project/json_loader.py:1995— json_loader._tool_definition_errors has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 1 (3 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.
handlers.handle_llm_call_completed (cognitive 20) lib/crewai/src/crewai/telemetry/tracing/handlers.py:2142— handlers.handle_llm_call_completed has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), loops 1 (3 pts), ternaries 1 (nesting depth added 3). 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.
OpenAIResponsesFormatter.format_block (cognitive 20) lib/crewai-files/src/crewai_files/formatting/openai.py:39— OpenAIResponsesFormatter.format_block has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (20 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.
validators.validate_image (cognitive 20) lib/crewai-files/src/crewai_files/processing/validators.py:224— validators.validate_image has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 3 (nesting depth added 11). 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.
code_interpreter_toolkit.extract_output_from_stream (cognitive 20) lib/crewai-tools/src/crewai_tools/aws/bedrock/code_interpreter/code_interpreter_toolkit.py:19— code_interpreter_toolkit.extract_output_from_stream has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (4 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.
DaytonaFileToolSchema._validate_action_args (cognitive 20) lib/crewai-tools/src/crewai_tools/tools/daytona_sandbox_tool/daytona_file_tool.py:186— DaytonaFileToolSchema._validate_action_args has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7 (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.
StagehandTool.close (cognitive 20) lib/crewai-tools/src/crewai_tools/tools/stagehand_tool/stagehand_tool.py:681— StagehandTool.close has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 2 (6 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.
cli.update_pyproject_dependencies (cognitive 20) REDACTED:344— cli.update_pyproject_dependencies has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (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.
cli._pin_crewai_deps (cognitive 20) REDACTED:624— cli._pin_crewai_deps has cognitive complexity 20 (threshold 15). Drivers by points: if/else 2 (6 pts), loops 3 (6 pts), ternaries 2 (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.
jev_evaluation_runner.evaluate (cognitive 20) scripts/jev_evaluation_runner.py:269— jev_evaluation_runner.evaluate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, loops 1, 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.
desaturateColor (cognitive 20) lib/crewai/src/crewai/flow/visualization/assets/interactive.js:307— desaturateColor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 3 (7 pts) (nesting depth added 5). Of this number, 15 points are the body's own statements and 5 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.
checkpoint_cli.info_checkpoint (cognitive 19) lib/cli/src/crewai_cli/checkpoint_cli.py:373— checkpoint_cli.info_checkpoint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, error handling 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.
checkpoint_cli._print_info (cognitive 19) lib/cli/src/crewai_cli/checkpoint_cli.py:413— checkpoint_cli._print_info has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), ternaries 1 (4 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.
checkpoint_cli._prune_json (cognitive 19) lib/cli/src/crewai_cli/checkpoint_cli.py:649— checkpoint_cli._prune_json has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 2 (5 pts), loops 3 (4 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.
create_json_crew.create_json_crew (cognitive 19) lib/cli/src/crewai_cli/create_json_crew.py:1312— create_json_crew.create_json_crew has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 2 (3 pts), boolean chains 2, ternaries 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.
CrewRunApp._try_parse_step_observation (cognitive 19) lib/cli/src/crewai_cli/crew_run_tui.py:2484— CrewRunApp._try_parse_step_observation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (4 pts), error handling 1 (2 pts), 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.
DeployValidator._check_module_imports (cognitive 19) lib/cli/src/crewai_cli/deploy/validate.py:788— DeployValidator._check_module_imports has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (4 pts), boolean chains 2, loops 1, ternaries 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.
AgentExecutor._build_replan_context (cognitive 19) lib/crewai/src/crewai/agents/agent_executor.py:2900— AgentExecutor._build_replan_context has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (4 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.
Crew._aexecute_tasks (cognitive 19) lib/crewai/src/crewai/crew.py:1356— Crew._aexecute_tasks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 1 (3 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. This shape REPEATS in the file: one other method here (Crew._execute_tasks) 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.
Crew._execute_tasks (cognitive 19) lib/crewai/src/crewai/crew.py:1577— Crew._execute_tasks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 1 (3 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. This shape REPEATS in the file: one other method here (Crew._aexecute_tasks) 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.
HandlerGraph._resolve (cognitive 19) lib/crewai/src/crewai/events/handler_graph.py:60— HandlerGraph._resolve has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 5 (9 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Expression._validate_template_value (cognitive 19) lib/crewai/src/crewai/flow/expressions.py:306— Expression._validate_template_value has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (6 pts), ternaries 2 (6 pts), if/else 4 (5 pts), error handling 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.
FlowSkillReferenceExtractor.render_schema_type (cognitive 19) REDACTED:456— FlowSkillReferenceExtractor.render_schema_type has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 3 (5 pts), boolean chains 2, 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.
RecallFlow.analyze_query_step (cognitive 19) lib/crewai/src/crewai/memory/recall_flow.py:185— RecallFlow.analyze_query_step has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, error handling 1 (3 pts), ternaries 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.
QdrantEdgeStorage.list_scopes (cognitive 19) lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.py:632— QdrantEdgeStorage.list_scopes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 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.
GrantSpanExporter._export (cognitive 19) lib/crewai/src/crewai/telemetry/tracing/grants.py:327— GrantSpanExporter._export has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cleanup.acleanup_provider_files (cognitive 19) lib/crewai-files/src/crewai_files/cache/cleanup.py:331— cleanup.acleanup_provider_files has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts), error handling 1 (2 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.
FileProcessor._auto_process_image (cognitive 19) lib/crewai-files/src/crewai_files/processing/processor.py:265— FileProcessor._auto_process_image has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 2 (6 pts), boolean chains 5 (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.
EnterpriseActionKitToolAdapter._generate_detailed_description (cognitive 19) lib/crewai-tools/src/crewai_tools/adapters/enterprise_adapter.py:332— EnterpriseActionKitToolAdapter._generate_detailed_description has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), ternaries 1 (4 pts), loops 1 (3 pts) (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.
vector_search._get_comparison_string (cognitive 19) lib/crewai-tools/src/crewai_tools/tools/oracle_vector_search_tool/vector_search.py:195— vector_search._get_comparison_string has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 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.
agents_md_eval.agents_md_eval (cognitive 19) lib/devtools/src/crewai_devtools/agents_md_eval.py:350— agents_md_eval.agents_md_eval has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (6 pts), ternaries 2 (4 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.
cli._workflow_crewai_requirements (cognitive 19) REDACTED:1512— cli._workflow_crewai_requirements has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (6 pts), error handling 1 (2 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.
cli._update_deployment_test_repo (cognitive 19) REDACTED:1597— cli._update_deployment_test_repo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (5 pts), error handling 1 (3 pts), boolean chains 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.
cli._trigger_pypi_publish (cognitive 19) REDACTED:1985— cli._trigger_pypi_publish has cognitive complexity 19 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 4 (7 pts), boolean chains 2, loops 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.
main._safe_extractall (cognitive 18) lib/cli/src/crewai_cli/skills/main.py:423— main._safe_extractall has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (3 pts), boolean chains 2, 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.
tui_picker._numbered_select_multi (cognitive 18) lib/cli/src/crewai_cli/tui_picker.py:418— tui_picker._numbered_select_multi has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, 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.
task_helpers.extract_task_result_parts (cognitive 18) lib/crewai/src/crewai/a2a/task_helpers.py:73— task_helpers.extract_task_result_parts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 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.
utils.save_last_messages (cognitive 18) lib/crewai/src/crewai/agent/utils.py:256— utils.save_last_messages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 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.
CrewAIEventsBus.scoped_handlers (cognitive 18) lib/crewai/src/crewai/events/event_bus.py:832— CrewAIEventsBus.scoped_handlers has cognitive complexity 18 (threshold 15). Drivers by points: loops 12 (18 pts) (nesting depth added 6). 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.
ReasoningEfficiencyEvaluator._calculate_loop_likelihood (cognitive 18) lib/crewai/src/crewai/experimental/evaluation/metrics/reasoning_metrics.py:351— ReasoningEfficiencyEvaluator._calculate_loop_likelihood has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1 (2 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.
PersistenceDecorator.persist_state (cognitive 18) lib/crewai/src/crewai/flow/persistence/decorators.py:71— PersistenceDecorator.persist_state has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 3, boolean chains 1, ternaries 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.
Flow._collapse_to_outcome (cognitive 18) lib/crewai/src/crewai/flow/runtime/__init__.py:3886— Flow._collapse_to_outcome has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 5 (8 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.
runtime._build_definition_state_model (cognitive 18) lib/crewai/src/crewai/flow/runtime/__init__.py:192— runtime._build_definition_state_model has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 3 (5 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
context_window._chunk_messages (cognitive 18) lib/crewai/src/crewai/llms/context_window.py:324— context_window._chunk_messages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 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.
AnthropicCompletion._prepare_completion_params (cognitive 18) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:614— AnthropicCompletion._prepare_completion_params has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3 (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.
AzureCompletion._init_responses_delegate (cognitive 18) lib/crewai/src/crewai/llms/providers/azure/completion.py:192— AzureCompletion._init_responses_delegate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. 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.
GeminiCompletion._prepare_generation_config (cognitive 18) lib/crewai/src/crewai/llms/providers/gemini/completion.py:505— GeminiCompletion._prepare_generation_config has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
OpenAICompletion._extract_builtin_tool_outputs (cognitive 18) lib/crewai/src/crewai/llms/providers/openai/completion.py:1769— OpenAICompletion._extract_builtin_tool_outputs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 2 (6 pts), ternaries 2 (6 pts), loops 2 (4 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.
RecallFlow._do_search (cognitive 18) lib/crewai/src/crewai/memory/recall_flow.py:89— RecallFlow._do_search has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 2 (6 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecallFlow.synthesize_results (cognitive 18) lib/crewai/src/crewai/memory/recall_flow.py:354— RecallFlow.synthesize_results has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
json_loader._strip_trailing_commas (cognitive 18) lib/crewai/src/crewai/project/json_loader.py:562— json_loader._strip_trailing_commas has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 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.
json_loader._agent_kwargs_from_definition (cognitive 18) lib/crewai/src/crewai/project/json_loader.py:955— json_loader._agent_kwargs_from_definition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
cache._safe_extractall (cognitive 18) lib/crewai/src/crewai/skills/cache.py:168— cache._safe_extractall has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (3 pts), boolean chains 2, 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.
registry.download_skill (cognitive 18) lib/crewai/src/crewai/skills/registry.py:275— registry.download_skill has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, error handling 2, ternaries 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, 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.
pydantic_schema_utils.force_additional_properties_false (cognitive 18) lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:183— pydantic_schema_utils.force_additional_properties_false has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 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.
BedrockKBRetrieverTool._validate_parameters (cognitive 18) lib/crewai-tools/src/crewai_tools/aws/bedrock/knowledge_base/retriever_tool.py:89— BedrockKBRetrieverTool._validate_parameters has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1, 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.
ssrf_adapter.create_validated_connection (cognitive 18) lib/crewai-tools/src/crewai_tools/security/ssrf_adapter.py:70— ssrf_adapter.create_validated_connection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 3 (4 pts), loops 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.
nl2sql_tool._resolve_explain_command (cognitive 18) lib/crewai-tools/src/crewai_tools/tools/nl2sql/nl2sql_tool.py:169— nl2sql_tool._resolve_explain_command has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (3 pts), loops 1 (2 pts), boolean chains 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.
docs_versioning._migrate_docs_json (cognitive 18) lib/devtools/src/crewai_devtools/docs_versioning.py:381— docs_versioning._migrate_docs_json has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 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.
prefix_version_paths._migrate_language_block (cognitive 18) scripts/docs/prefix_version_paths.py:145— prefix_version_paths._migrate_language_block has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, loops 2, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
highlightAllRouterEvents (cognitive 18) lib/crewai/src/crewai/flow/visualization/assets/interactive.js:771— highlightAllRouterEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 796, 800, 783, …). 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.
DeployCommand._prepare_git_repository (cognitive 17) lib/cli/src/crewai_cli/deploy/main.py:611— DeployCommand._prepare_git_repository has cognitive complexity 17 (threshold 15). Drivers by points: error handling 6 (11 pts), if/else 4 (6 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.
DeployValidator._check_env_vars (cognitive 17) lib/cli/src/crewai_cli/deploy/validate.py:1044— DeployValidator._check_env_vars has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 2 (4 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate._validate_json_project_in_project_env (cognitive 17) lib/cli/src/crewai_cli/deploy/validate.py:154— validate._validate_json_project_in_project_env has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, error handling 3 (4 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
eval_crew._refusal_message (cognitive 17) lib/cli/src/crewai_cli/experimental/eval_crew.py:2145— eval_crew._refusal_message has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), ternaries 2 (3 pts) (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.
eval_crew._write_export (cognitive 17) lib/cli/src/crewai_cli/experimental/eval_crew.py:2528— eval_crew._write_export has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (7 pts), if/else 5 (7 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.
tui_picker._read_key (cognitive 17) lib/cli/src/crewai_cli/tui_picker.py:31— tui_picker._read_key has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 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.
wrapper._kickoff_with_a2a (cognitive 17) lib/crewai/src/crewai/a2a/wrapper.py:393— wrapper._kickoff_with_a2a has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (wrapper._akickoff_with_a2a) 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.
wrapper._akickoff_with_a2a (cognitive 17) lib/crewai/src/crewai/a2a/wrapper.py:514— wrapper._akickoff_with_a2a has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (wrapper._kickoff_with_a2a) 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.
BaseAgentExecutor._save_to_memory (cognitive 17) lib/crewai/src/crewai/agents/agent_builder/base_agent_executor.py:31— BaseAgentExecutor._save_to_memory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, error handling 2, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentEvaluator._handle_lite_agent_completed (cognitive 17) lib/crewai/src/crewai/experimental/evaluation/agent_evaluator.py:132— AgentEvaluator._handle_lite_agent_completed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts), boolean chains 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.
conversation.append_message (cognitive 17) lib/crewai/src/crewai/flow/conversation.py:117— conversation.append_message has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, loops 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.
flow_definition._validate_action_cel (cognitive 17) lib/crewai/src/crewai/flow/flow_definition.py:938— flow_definition._validate_action_cel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 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.
Flow._run_human_feedback_step (cognitive 17) lib/crewai/src/crewai/flow/runtime/__init__.py:3649— Flow._run_human_feedback_step has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), ternaries 3 (5 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LLM._matches_provider_pattern (cognitive 17) lib/crewai/src/crewai/llm.py:384— LLM._matches_provider_pattern has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 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.
AnthropicCompletion._convert_tools_for_interference (cognitive 17) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:681— AnthropicCompletion._convert_tools_for_interference has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts), 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.
BedrockCompletion._extract_tools_from_message_history (cognitive 17) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:2078— BedrockCompletion._extract_tools_from_message_history has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 2 (4 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.
OpenAICompletion._prepare_completion_params (cognitive 17) lib/crewai/src/crewai/llms/providers/openai/completion.py:2114— OpenAICompletion._prepare_completion_params has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (15 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.
SnowflakeCompletion._extract_claude_tool_use_ids (cognitive 17) lib/crewai/src/crewai/llms/providers/snowflake/completion.py:291— SnowflakeCompletion._extract_claude_tool_use_ids has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 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.
EncodingFlow.parallel_find_similar (cognitive 17) lib/crewai/src/crewai/memory/encoding_flow.py:155— EncodingFlow.parallel_find_similar has cognitive complexity 17 (threshold 15). Drivers by points: error handling 2 (5 pts), ternaries 2 (5 pts), if/else 4, loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LanceDBStorage.save (cognitive 17) lib/crewai/src/crewai/memory/storage/lancedb_storage.py:314— LanceDBStorage.save has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, 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.
OracleEmbeddingFunction.__call__ (cognitive 17) lib/crewai/src/crewai/rag/embeddings/providers/oracle/embedding_callable.py:44— OracleEmbeddingFunction.__call__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, 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.
grants._fit_span (cognitive 17) lib/crewai/src/crewai/telemetry/tracing/grants.py:44— grants._fit_span has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ToolUsage._build_fingerprint_config (cognitive 17) lib/crewai/src/crewai/tools/tool_usage.py:1089— ToolUsage._build_fingerprint_config has cognitive complexity 17 (threshold 15). Drivers by points: error handling 2 (6 pts), if/else 4 (6 pts), boolean chains 4, ternaries 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.
agent_utils._setup_before_llm_call_hooks (cognitive 17) lib/crewai/src/crewai/utilities/agent_utils.py:1753— agent_utils._setup_before_llm_call_hooks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 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.
pydantic_schema_utils._merge_all_of_schemas (cognitive 17) lib/crewai/src/crewai/utilities/pydantic_schema_utils.py:1103— pydantic_schema_utils._merge_all_of_schemas has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
project._set_project_id (cognitive 17) lib/crewai-core/src/crewai_core/project.py:457— project._set_project_id has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), boolean chains 2, 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.
cleanup.cleanup_uploaded_files (cognitive 17) lib/crewai-files/src/crewai_files/cache/cleanup.py:59— cleanup.cleanup_uploaded_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 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.
FileReadTool._run (cognitive 17) lib/crewai-tools/src/crewai_tools/tools/file_read_tool/file_read_tool.py:174— FileReadTool._run has cognitive complexity 17 (threshold 15). Drivers by points: error handling 5 (6 pts), if/else 5 (6 pts), boolean chains 4, ternaries 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpiderTool._run (cognitive 17) lib/crewai-tools/src/crewai_tools/tools/spider_tool/spider_tool.py:139— SpiderTool._run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 4, boolean chains 1, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
eval_crew._stopped_setups (cognitive 16) lib/cli/src/crewai_cli/experimental/eval_crew.py:1837— eval_crew._stopped_setups has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 3 (5 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.
eval_crew.save_evaluation (cognitive 16) lib/cli/src/crewai_cli/experimental/eval_crew.py:2266— eval_crew.save_evaluation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5, boolean chains 4, ternaries 2 (4 pts), error handling 3 (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.
content_type._find_compatible_modes (cognitive 16) lib/crewai/src/crewai/a2a/utils/content_type.py:135— content_type._find_compatible_modes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentExecutor._prepare_tool_result_for_context (cognitive 16) lib/crewai/src/crewai/agents/agent_executor.py:296— AgentExecutor._prepare_tool_result_for_context has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, ternaries 3, boolean chains 1, error handling 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.
AgentExecutor.decide_next_action (cognitive 16) lib/crewai/src/crewai/agents/agent_executor.py:1058— AgentExecutor.decide_next_action has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 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.
AgentExecutor._synthesize_final_answer_from_todos (cognitive 16) lib/crewai/src/crewai/agents/agent_executor.py:2662— AgentExecutor._synthesize_final_answer_from_todos has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 2, error handling 2, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PlannerObserver._parse_observation_response (cognitive 16) lib/crewai/src/crewai/agents/planner_observer.py:325— PlannerObserver._parse_observation_response has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (7 pts), if/else 4 (5 pts), ternaries 2 (4 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.
ExperimentResults._compare_with_run (cognitive 16) lib/crewai/src/crewai/experimental/evaluation/experiment/result.py:99— ExperimentResults._compare_with_run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 3 (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.
expressions._find_cel_eval_error (cognitive 16) lib/crewai/src/crewai/flow/expressions.py:66— expressions._find_cel_eval_error has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 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.
LLM.__new__ (cognitive 16) lib/crewai/src/crewai/llm.py:285— LLM.__new__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnthropicCompletion.get_input_tokens_count (cognitive 16) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:337— AnthropicCompletion.get_input_tokens_count has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, 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.
completion._contains_file_id_reference (cognitive 16) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:143— completion._contains_file_id_reference has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (11 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.
AzureCompletion._process_completion_response (cognitive 16) lib/crewai/src/crewai/llms/providers/azure/completion.py:853— AzureCompletion._process_completion_response has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, error handling 1 (3 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.
BedrockCompletion._messages_contain_tool_content (cognitive 16) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:2063— BedrockCompletion._messages_contain_tool_content has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (11 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.
CrewDefinition._validate_inline_agents (cognitive 16) lib/crewai/src/crewai/project/crew_definition.py:354— CrewDefinition._validate_inline_agents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, 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.
gen_ai_shapes.to_output_messages (cognitive 16) lib/crewai/src/crewai/telemetry/tracing/gen_ai_shapes.py:173— gen_ai_shapes.to_output_messages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 1 (3 pts), boolean chains 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.
BaseTool._set_args_schema (cognitive 16) lib/crewai/src/crewai/tools/base_tool.py:471— BaseTool._set_args_schema has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 1 (3 pts), 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.
ToolUsage._validate_tool_input (cognitive 16) lib/crewai/src/crewai/tools/tool_usage.py:939— ToolUsage._validate_tool_input has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), error handling 4, boolean chains 3 (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.
crew_chat.generate_input_description_with_ai (cognitive 16) lib/crewai/src/crewai/utilities/crew_chat.py:406— crew_chat.generate_input_description_with_ai has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (5 pts), error handling 2, loops 2 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
message_utils.messages_content_text (cognitive 16) lib/crewai/src/crewai/utilities/message_utils.py:36— message_utils.messages_content_text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 1 (3 pts), boolean chains 2, 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.
cleanup.cleanup_expired_files (cognitive 16) lib/crewai-files/src/crewai_files/cache/cleanup.py:103— cleanup.cleanup_expired_files has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 1 (4 pts), loops 2 (4 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.
cleanup.cleanup_provider_files (cognitive 16) lib/crewai-files/src/crewai_files/cache/cleanup.py:142— cleanup.cleanup_provider_files has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), boolean chains 2, error handling 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.
MySQLLoader.load (cognitive 16) lib/crewai-tools/src/crewai_tools/rag/loaders/mysql_loader.py:16— MySQLLoader.load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 2 (3 pts), boolean chains 2, error handling 2, ternaries 1 (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.
PostgresLoader.load (cognitive 16) lib/crewai-tools/src/crewai_tools/rag/loaders/postgres_loader.py:16— PostgresLoader.load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 2 (3 pts), boolean chains 2, error handling 2, ternaries 1 (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.
ApplicationSelector.from_string (cognitive 16) lib/crewai-tools/src/crewai_tools/tools/crewai_platform_tools/integrations_client.py:29— ApplicationSelector.from_string has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, error handling 1 (2 pts), ternaries 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LegacyClient.get_actions (cognitive 16) lib/crewai-tools/src/crewai_tools/tools/crewai_platform_tools/integrations_client.py:239— LegacyClient.get_actions 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.
vector_search._generate_where_clause (cognitive 16) lib/crewai-tools/src/crewai_tools/tools/oracle_vector_search_tool/vector_search.py:378— vector_search._generate_where_clause has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), 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.
SnowflakeSearchTool._execute_query (cognitive 16) lib/crewai-tools/src/crewai_tools/tools/snowflake_search_tool/snowflake_search_tool.py:200— SnowflakeSearchTool._execute_query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (2 pts), boolean chains 1, 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.
NodeRenderer.drawNodeText (cognitive 16) lib/crewai/src/crewai/flow/visualization/assets/interactive.js:489— NodeRenderer.drawNodeText has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D22 · Internal API Consistency· Duplicate intent with divergent signatures. `cli.train_crew` takes no arguments (likely relying on defaults or context), while `train_crew.train_crew` requires explicit `n_iterations` and `filename`. This creates confusion about whether the user should call the CLI wrapper or the underlying function directly. · ×1
Duplicate intent with divergent signatures. `cli.train_crew` takes no arguments (likely relying on defaults or context), while `train_crew.train_crew` requires explicit `n_iterations` and `filename`. This creates confusion about whether the user should call the CLI wrapper or the underlying function directly. — Unify to a single entry point. If `cli.train_crew` is the public CLI command, it should delegate to `train_crew.train_crew` with explicit arguments parsed from CLI flags, rather than existing as a separate no-arg method. (signatures: cli.train_crew(): Any | train_crew.train_crew(n_iterations: int, filename: str): None)
D22 · Internal API Consistency· Severe naming and functional inconsistency. `cli.evaluate_crew` and `cli.eval_crew` appear to be duplicate CLI commands for the same operation. Furthermore, the underlying implementations (`evaluate_crew` vs `eval_crew`) have completely different signatures and responsibilities (one takes iterations/model, the other takes run_id/args). This suggests a copy-paste error or legacy code remnants where two different evaluation flows were not merged. · ×1
Severe naming and functional inconsistency. `cli.evaluate_crew` and `cli.eval_crew` appear to be duplicate CLI commands for the same operation. Furthermore, the underlying implementations (`evaluate_crew` vs `eval_crew`) have completely different signatures and responsibilities (one takes iterations/model, the other takes run_id/args). This suggests a copy-paste error or legacy code remnants where two different evaluation flows were not merged. — Remove `cli.eval_crew` if it is redundant, or clearly distinguish the two flows (e.g., 'evaluate new run' vs 're-evaluate existing run'). Ensure the underlying module names match the CLI command names (e.g., `evaluate_crew` module for `evaluate_crew` command). (signatures: cli.evaluate_crew(): Any | cli.eval_crew(): Any | evaluate_crew.evaluate_crew(n_iterations: int, model: str, trained_agents_file: str | None): None | eval_crew.eval_crew(run_id: str | None, run_again: bool, run_args: dict[str, Any] | None, trusted_amp_origins: set[str] | None): None)
D22 · Internal API Consistency· Typo in CLI command name. `cli.deply_status` is a typo for `deploy_status`. This breaks the consistency of the `deploy_*` namespace (e.g., `deploy_create`, `deploy_list`, `deploy_push`). · ×1
Typo in CLI command name. `cli.deply_status` is a typo for `deploy_status`. This breaks the consistency of the `deploy_*` namespace (e.g., `deploy_create`, `deploy_list`, `deploy_push`). — Rename `cli.deply_status` to `cli.deploy_status`. (signatures: cli.deply_status(uuid: str | None): None | DeployCommand.get_crew_status(self, uuid: str | None): None)
D22 · Internal API Consistency· Inconsistent parameter naming and structure. The CLI command `cli.checkpoint` takes a `location` argument, but the underlying `checkpoint_cli` functions use `location` for some (`list`, `resume`) and `path` for others (`info`). Additionally, `cli.checkpoint` is a generic entry point that likely dispatches, but the underlying functions are not consistently named as sub-commands (e.g., `list_checkpoints` vs `info_checkpoint`). · ×1
Inconsistent parameter naming and structure. The CLI command `cli.checkpoint` takes a `location` argument, but the underlying `checkpoint_cli` functions use `location` for some (`list`, `resume`) and `path` for others (`info`). Additionally, `cli.checkpoint` is a generic entry point that likely dispatches, but the underlying functions are not consistently named as sub-commands (e.g., `list_checkpoints` vs `info_checkpoint`). — Standardize the underlying function signatures to use consistent parameter names (e.g., always `location` or always `path`). Ensure the CLI dispatch logic maps clearly to these functions. (signatures: cli.checkpoint(ctx: Context, location: str): None | checkpoint_cli.list_checkpoints(location: str): None | checkpoint_cli.info_checkpoint(path: str): None | checkpoint_cli.resume_checkpoint(location: str, checkpoint_id: str | None): None)
D22 · Internal API Consistency· Minor inconsistency in naming convention. The CLI command uses snake_case (`tool_create`), while the underlying command class uses camelCase (`create`). While this is a common pattern in CLI frameworks (kebab-case to snake_case to camelCase), the presence of `cli.tool_install` vs `ToolCommand.install` shows a mix. It is better to be consistent across the board. · ×1
Minor inconsistency in naming convention. The CLI command uses snake_case (`tool_create`), while the underlying command class uses camelCase (`create`). While this is a common pattern in CLI frameworks (kebab-case to snake_case to camelCase), the presence of `cli.tool_install` vs `ToolCommand.install` shows a mix. It is better to be consistent across the board. — Adopt a consistent naming convention for CLI commands vs internal methods. If `tool_create` is the CLI command, the internal method should ideally be `create_tool` or the CLI command should be `tool-create` mapping to `create`. (signatures: cli.tool_create(handle: str): None | ToolCommand.create(self, handle: str): None)
Change coupling clique: __init__.py, __init__.py, __init__.py, __init__.py lib/crewai-files/src/crewai_files/__init__.py— 4 files — `lib/crewai-files/src/crewai_files/__init__.py`, `lib/crewai-tools/src/crewai_tools/__init__.py`, `lib/crewai/src/crewai/__init__.py`, `lib/devtools/src/crewai_devtools/__init__.py` — all change together with no explicit dependency: a fully-connected co-change clique, not 6 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D4 · Code Duplication· Near-duplicate member family (4 members, 51 shared lines) · ×1
Near-duplicate member family (4 members, 51 shared lines) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1094— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1094-1238 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1248-1451 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1652-1784 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1794-1983 — These 4 members are variants of one another: a block of 51 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 44 shared lines) · ×1
Near-duplicate member family (4 members, 44 shared lines) lib/crewai/src/crewai/llms/providers/openai/completion.py:1182— lib/crewai/src/crewai/llms/providers/openai/completion.py:1182-1317 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1327-1460 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1470-1597 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1607-1732 — These 4 members are variants of one another: a block of 44 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them 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.
Near-duplicate member pair (271 shared lines) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1002— lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1002-1297 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1611-1917 — These two members are variants of one another: 271 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 (251 shared lines) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:714— lib/crewai/src/crewai/llms/providers/bedrock/completion.py:714-991 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1329-1600 — These two members are variants of one another: 251 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 (158 shared lines) lib/crewai/src/crewai/llms/providers/openai/completion.py:2219— lib/crewai/src/crewai/llms/providers/openai/completion.py:2219-2392 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2661-2832 — These two members are variants of one another: 158 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 (151 shared lines) lib/crewai/src/crewai/a2a/wrapper.py:1242— lib/crewai/src/crewai/a2a/wrapper.py:1242-1418 | lib/crewai/src/crewai/a2a/wrapper.py:1614-1772 — These two members are variants of one another: 151 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 (126 shared lines) lib/crewai/src/crewai/task.py:656— lib/crewai/src/crewai/task.py:656-807 | lib/crewai/src/crewai/task.py:815-966 — These two members are variants of one another: 126 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 (107 shared lines) lib/crewai/src/crewai/task.py:1335— lib/crewai/src/crewai/task.py:1335-1445 | lib/crewai/src/crewai/task.py:1455-1566 — These two members are variants of one another: 107 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 (101 shared lines) lib/crewai/src/crewai/llm.py:1856— lib/crewai/src/crewai/llm.py:1856-1986 | lib/crewai/src/crewai/llm.py:1998-2124 — These two members are variants of one another: 101 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 (58 shared lines) lib/crewai/src/crewai/a2a/task_helpers.py:301— lib/crewai/src/crewai/a2a/task_helpers.py:301-480 | lib/crewai/src/crewai/a2a/updates/polling/handler.py:134-359 — These two members are variants of one another: 58 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 (42 shared lines) lib/crewai/src/crewai/a2a/wrapper.py:312— lib/crewai/src/crewai/a2a/wrapper.py:312-390 | lib/crewai/src/crewai/a2a/wrapper.py:1473-1537 — These two members are variants of one another: 42 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 (39 shared lines) lib/crewai/src/crewai/agents/agent_executor.py:923— lib/crewai/src/crewai/agents/agent_executor.py:923-989 | lib/crewai/src/crewai/agents/agent_executor.py:995-1055 — These two members are variants of one another: 39 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 (85 corresponding lines) · ×1
Edited copy of a member (85 corresponding lines) lib/crewai-tools/src/crewai_tools/rag/loaders/mysql_loader.py:17— lib/crewai-tools/src/crewai_tools/rag/loaders/mysql_loader.py:17-102 | lib/crewai-tools/src/crewai_tools/rag/loaders/postgres_loader.py:17-101 — These two members are one piece of code written twice and then edited apart: 85 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· Edited copy of a member (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) lib/crewai-tools/src/crewai_tools/tools/tavily_search_tool/tavily_search_tool.py:158— lib/crewai-tools/src/crewai_tools/tools/tavily_search_tool/tavily_search_tool.py:158-204 | lib/crewai-tools/src/crewai_tools/tools/tavily_search_tool/tavily_search_tool.py:210-256 — These two members are one piece of code written twice and then edited apart: 33 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 (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) lib/crewai/src/crewai/telemetry/tracing/handlers.py:2485— lib/crewai/src/crewai/telemetry/tracing/handlers.py:2485-2507 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:2556-2579 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:2666-2684 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:2763-2785 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:2869-2890 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:2956-2974 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:3717-3737 — 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) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) lib/crewai/src/crewai/tools/base_tool.py:212— lib/crewai/src/crewai/tools/base_tool.py:212-254 | lib/crewai/src/crewai/tools/base_tool.py:425-469 | lib/crewai/src/crewai/tools/base_tool.py:472-493 | lib/crewai/src/crewai/tools/base_tool.py:610-663 | lib/crewai/src/crewai/tools/base_tool.py:707-786 — 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 (128–129 lines × 2) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:782— lib/crewai/src/crewai/llms/providers/bedrock/completion.py:782-910 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1398-1525 — 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 `lib/crewai/src/crewai/llms/providers/bedrock/completion.py:782` 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 (122–125 lines × 2) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1113— lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1113-1234 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1723-1847 — 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 `lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1113` 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 (123 lines × 2) lib/crewai/src/crewai/tools/tool_usage.py:376— lib/crewai/src/crewai/tools/tool_usage.py:376-498 | lib/crewai/src/crewai/tools/tool_usage.py:633-755 — 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 (111–112 lines × 2) lib/crewai/src/crewai/tools/tool_usage.py:254— lib/crewai/src/crewai/tools/tool_usage.py:254-364 | lib/crewai/src/crewai/tools/tool_usage.py:510-621 — 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 (95–97 lines × 2) lib/crewai/src/crewai/utilities/tool_utils.py:47— lib/crewai/src/crewai/utilities/tool_utils.py:47-143 | lib/crewai/src/crewai/utilities/tool_utils.py:212-306 — 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 (95–96 lines × 2) lib/crewai/src/crewai/llm.py:1301— lib/crewai/src/crewai/llm.py:1301-1395 | lib/crewai/src/crewai/llm.py:1456-1551 — 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 (76–78 lines × 2) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1372— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1372-1447 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1906-1983 — 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. 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 (73–75 lines × 2) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1132— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1132-1206 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1690-1762 — 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 (66–67 lines × 2) lib/crewai-tools/src/crewai_tools/rag/loaders/mysql_loader.py:36— lib/crewai-tools/src/crewai_tools/rag/loaders/mysql_loader.py:36-102 | lib/crewai-tools/src/crewai_tools/rag/loaders/postgres_loader.py:36-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 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 (66 lines × 2) lib/crewai/src/crewai/a2a/auth/server_schemes.py:293— lib/crewai/src/crewai/a2a/auth/server_schemes.py:293-358 | lib/crewai/src/crewai/a2a/auth/server_schemes.py:511-576 — 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 `lib/crewai/src/crewai/a2a/auth/server_schemes.py:293` 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 (64 lines × 2) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:465— lib/crewai/src/crewai/llms/providers/bedrock/completion.py:465-528 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:608-671 — 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 (62 lines × 2) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1236— lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1236-1297 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1850-1911 — 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 `lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1236` 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 (52–54 lines × 4) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:714— lib/crewai/src/crewai/llms/providers/bedrock/completion.py:714-765 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1002-1055 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1329-1382 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1611-1664 — all 4 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. 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 (45–54 lines × 2) lib/crewai/src/crewai/tools/base_tool.py:425— lib/crewai/src/crewai/tools/base_tool.py:425-469 | lib/crewai/src/crewai/tools/base_tool.py:610-663 — 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 (49–52 lines × 2) lib/crewai/src/crewai/llms/providers/openai/completion.py:1186— lib/crewai/src/crewai/llms/providers/openai/completion.py:1186-1234 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1330-1381 — 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 `lib/crewai/src/crewai/llms/providers/openai/completion.py:1330` 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 (49 lines × 2) lib/crewai/src/crewai/llms/providers/openai/completion.py:1237— lib/crewai/src/crewai/llms/providers/openai/completion.py:1237-1285 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1384-1432 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/crewai/src/crewai/llms/providers/openai/completion.py:1287` calls `_invoke_after_llm_call_hooks`, `get` and `lib/crewai/src/crewai/llms/providers/openai/completion.py:1434` 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 (47–49 lines × 2) lib/crewai/src/crewai/llms/providers/openai/completion.py:1547— lib/crewai/src/crewai/llms/providers/openai/completion.py:1547-1593 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1684-1732 — 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. 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 (46 lines × 2) lib/crewai/src/crewai/a2a/wrapper.py:1373— lib/crewai/src/crewai/a2a/wrapper.py:1373-1418 | lib/crewai/src/crewai/a2a/wrapper.py:1727-1772 — 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 `lib/crewai/src/crewai/a2a/wrapper.py:1373` 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 (44–46 lines × 2) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:946— lib/crewai/src/crewai/llms/providers/bedrock/completion.py:946-991 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1557-1600 — 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 (32–44 lines × 2) lib/crewai-files/src/crewai_files/formatting/api.py:89— lib/crewai-files/src/crewai_files/formatting/api.py:89-132 | lib/crewai-files/src/crewai_files/formatting/api.py:167-198 — 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 (43 lines × 2) lib/crewai/src/crewai/core/providers/human_input.py:320— lib/crewai/src/crewai/core/providers/human_input.py:320-362 | lib/crewai/src/crewai/core/providers/human_input.py:373-415 — 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–42 lines × 2) lib/crewai/src/crewai/a2a/wrapper.py:1167— lib/crewai/src/crewai/a2a/wrapper.py:1167-1208 | lib/crewai/src/crewai/a2a/wrapper.py:1561-1580 — 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 (42 lines × 2) lib/crewai/src/crewai/task.py:1368— lib/crewai/src/crewai/task.py:1368-1409 | lib/crewai/src/crewai/task.py:1489-1530 — 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 (41 lines × 2) lib/crewai-tools/src/crewai_tools/tools/tavily_get_research_tool/tavily_get_research_tool.py:54— lib/crewai-tools/src/crewai_tools/tools/tavily_get_research_tool/tavily_get_research_tool.py:54-94 | lib/crewai-tools/src/crewai_tools/tools/tavily_research_tool/tavily_research_tool.py:90-130 — 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–41 lines × 2) lib/crewai/src/crewai/a2a/wrapper.py:1242— lib/crewai/src/crewai/a2a/wrapper.py:1242-1282 | lib/crewai/src/crewai/a2a/wrapper.py:1614-1636 — 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–37 lines × 2) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1248— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1248-1284 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1794-1828 — 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 `lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1248` 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 (36 lines × 2) lib/crewai/src/crewai/crew.py:1061— lib/crewai/src/crewai/crew.py:1061-1096 | lib/crewai/src/crewai/crew.py:1283-1318 — 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 `lib/crewai/src/crewai/crew.py:1061` 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 (19–36 lines × 2) lib/crewai/src/crewai/utilities/converter.py:358— lib/crewai/src/crewai/utilities/converter.py:358-393 | lib/crewai/src/crewai/utilities/converter.py:511-529 — 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 `lib/crewai/src/crewai/utilities/converter.py:358` 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 (34–35 lines × 2) lib/crewai/src/crewai/llms/providers/openai/completion.py:2358— lib/crewai/src/crewai/llms/providers/openai/completion.py:2358-2392 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2799-2832 — 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 `lib/crewai/src/crewai/llms/providers/openai/completion.py:2358` 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 (34 lines × 2) lib/crewai/src/crewai/a2a/wrapper.py:1302— lib/crewai/src/crewai/a2a/wrapper.py:1302-1335 | lib/crewai/src/crewai/a2a/wrapper.py:1656-1689 — 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 `lib/crewai/src/crewai/a2a/wrapper.py:1302` 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 (33 lines × 2) lib/crewai/src/crewai/llms/providers/openai/completion.py:2226— lib/crewai/src/crewai/llms/providers/openai/completion.py:2226-2258 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2668-2700 — 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 `lib/crewai/src/crewai/llms/providers/openai/completion.py:2226` 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.
Duplicated block (22–33 lines × 2) lib/crewai/src/crewai/telemetry/telemetry.py:1138— lib/crewai/src/crewai/telemetry/telemetry.py:1138-1170 | lib/crewai/src/crewai/telemetry/telemetry.py:1211-1232 — 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 (28–32 lines × 2) lib/crewai/src/crewai/agent/utils.py:133— lib/crewai/src/crewai/agent/utils.py:133-164 | lib/crewai/src/crewai/agent/utils.py:335-362 — 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 (29–32 lines × 2) lib/crewai/src/crewai/telemetry/tracing/handlers.py:906— lib/crewai/src/crewai/telemetry/tracing/handlers.py:906-934 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:947-978 — 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 (27–31 lines × 2) lib/crewai/src/crewai/telemetry/tracing/handlers.py:1136— lib/crewai/src/crewai/telemetry/tracing/handlers.py:1136-1166 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:1255-1281 — 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–30 lines × 4) lib/crewai/src/crewai/llms/providers/openai/completion.py:1223— lib/crewai/src/crewai/llms/providers/openai/completion.py:1223-1251 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1370-1398 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1532-1561 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1669-1698 — all 4 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 `lib/crewai/src/crewai/llms/providers/openai/completion.py:1223` 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 (27–30 lines × 2) lib/crewai/src/crewai/telemetry/tracing/handlers.py:3447— lib/crewai/src/crewai/telemetry/tracing/handlers.py:3447-3476 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:3524-3550 — 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 (22–29 lines × 2) lib/crewai-core/src/crewai_core/telemetry.py:428— lib/crewai-core/src/crewai_core/telemetry.py:428-449 | lib/crewai-core/src/crewai_core/telemetry.py:477-505 — 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 (27–29 lines × 2) lib/crewai/src/crewai/llms/providers/azure/completion.py:1126— lib/crewai/src/crewai/llms/providers/azure/completion.py:1126-1152 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2469-2497 — 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 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 (28 lines × 4) lib/crewai/src/crewai/a2a/updates/push_notifications/handler.py:86— lib/crewai/src/crewai/a2a/updates/push_notifications/handler.py:86-113 | lib/crewai/src/crewai/a2a/updates/streaming/handler.py:440-467 | lib/crewai/src/crewai/a2a/updates/streaming/handler.py:526-553 | lib/crewai/src/crewai/a2a/updates/streaming/handler.py:585-612 — 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 `lib/crewai/src/crewai/a2a/updates/push_notifications/handler.py:86` 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 (26–28 lines × 2) lib/crewai-tools/src/crewai_tools/rag/embedding_service.py:149— lib/crewai-tools/src/crewai_tools/rag/embedding_service.py:149-174 | lib/crewai-tools/src/crewai_tools/rag/embedding_service.py:181-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. 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–28 lines × 2) lib/crewai/src/crewai/llm.py:1938— lib/crewai/src/crewai/llm.py:1938-1965 | lib/crewai/src/crewai/llm.py:2079-2103 — 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 (26–27 lines × 2) lib/crewai/src/crewai/agents/agent_executor.py:1347— lib/crewai/src/crewai/agents/agent_executor.py:1347-1373 | lib/crewai/src/crewai/agents/agent_executor.py:1488-1513 — 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 `lib/crewai/src/crewai/agents/agent_executor.py:1347` 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–26 lines × 3) lib/crewai/src/crewai/telemetry/tracing/handlers.py:1141— lib/crewai/src/crewai/telemetry/tracing/handlers.py:1141-1166 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:1193-1218 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:1260-1281 — 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 (24–26 lines × 2) lib/crewai/src/crewai/llms/providers/bedrock/completion.py:913— lib/crewai/src/crewai/llms/providers/bedrock/completion.py:913-936 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1528-1553 — 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 `lib/crewai/src/crewai/llms/providers/bedrock/completion.py:913` 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 (19–24 lines × 7) lib/crewai/src/crewai/telemetry/tracing/handlers.py:2485— lib/crewai/src/crewai/telemetry/tracing/handlers.py:2485-2507 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:2556-2579 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:2666-2684 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:2763-2785 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:2869-2890 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:2956-2974 | lib/crewai/src/crewai/telemetry/tracing/handlers.py:3717-3737 — all 7 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 (24 lines × 3) lib/crewai/src/crewai/llms/providers/openai/completion.py:2572— lib/crewai/src/crewai/llms/providers/openai/completion.py:2572-2595 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2857-2880 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2924-2947 — 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. 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–22 lines × 2) lib/crewai/src/crewai/agent/core.py:1851— lib/crewai/src/crewai/agent/core.py:1851-1870 | lib/crewai/src/crewai/agent/core.py:2227-2248 — 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 `lib/crewai/src/crewai/agent/core.py:2227` 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, `lib/crewai/src/crewai/agent/core.py:1848` calls `is_inside_event_loop`, `kickoff_async`, `begin_execution` and `lib/crewai/src/crewai/agent/core.py:2227` 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 (19–22 lines × 2) lib/crewai/src/crewai/agents/agent_executor.py:3103— lib/crewai/src/crewai/agents/agent_executor.py:3103-3121 | lib/crewai/src/crewai/agents/agent_executor.py:3193-3214 — 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 `lib/crewai/src/crewai/agents/agent_executor.py:3193` 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 (19–21 lines × 2) lib/crewai/src/crewai/agents/agent_adapters/langgraph/langgraph_adapter.py:235— lib/crewai/src/crewai/agents/agent_adapters/langgraph/langgraph_adapter.py:235-255 | lib/crewai/src/crewai/agents/agent_adapters/openai_agents/openai_adapter.py:157-175 — 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 `lib/crewai/src/crewai/agents/agent_adapters/langgraph/langgraph_adapter.py:235` 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 (20 lines × 4) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1102— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1102-1121 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1252-1271 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1660-1679 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1798-1817 — all 4 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 (20 lines × 3) lib/crewai/src/crewai/llms/providers/azure/completion.py:903— lib/crewai/src/crewai/llms/providers/azure/completion.py:903-922 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2300-2319 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2744-2763 — 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 (19–20 lines × 2) lib/crewai/src/crewai/utilities/streaming.py:312— lib/crewai/src/crewai/utilities/streaming.py:312-330 | lib/crewai/src/crewai/utilities/streaming.py:547-566 — 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 (19 lines × 5) lib/crewai/src/crewai/a2a/task_helpers.py:411— lib/crewai/src/crewai/a2a/task_helpers.py:411-429 | lib/crewai/src/crewai/a2a/task_helpers.py:457-475 | lib/crewai/src/crewai/a2a/updates/polling/handler.py:244-262 | lib/crewai/src/crewai/a2a/updates/polling/handler.py:293-311 | lib/crewai/src/crewai/a2a/updates/polling/handler.py:341-359 — before extracting anything, compare `lib/crewai/src/crewai/a2a/task_helpers.py` and `lib/crewai/src/crewai/a2a/updates/polling/handler.py` as WHOLE FILES: this scan already matched 3 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 `lib/crewai/src/crewai/a2a/task_helpers.py:411` 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 (16–19 lines × 4) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1170— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1170-1188 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1403-1418 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1728-1744 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1937-1952 — all 4 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 `lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1170` 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–19 lines × 3) lib/crewai-core/src/crewai_core/telemetry.py:453— lib/crewai-core/src/crewai_core/telemetry.py:453-471 | lib/crewai-core/src/crewai_core/telemetry.py:648-658 | lib/crewai-core/src/crewai_core/telemetry.py:661-671 — 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 (18–19 lines × 3) lib/crewai/src/crewai/llms/providers/azure/completion.py:516— lib/crewai/src/crewai/llms/providers/azure/completion.py:516-533 | lib/crewai/src/crewai/llms/providers/azure/completion.py:598-615 | lib/crewai/src/crewai/llms/providers/bedrock/completion.py:599-617 — 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 `lib/crewai/src/crewai/llms/providers/azure/completion.py:516` 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–19 lines × 2) lib/cli/src/crewai_cli/skills/main.py:440— lib/cli/src/crewai_cli/skills/main.py:440-458 | lib/crewai/src/crewai/skills/cache.py:184-199 — 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 (18–19 lines × 2) lib/crewai/src/crewai/agents/agent_executor.py:2034— lib/crewai/src/crewai/agents/agent_executor.py:2034-2051 | lib/crewai/src/crewai/agents/agent_executor.py:2065-2083 — 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 (14–18 lines × 3) lib/crewai/src/crewai/llms/providers/azure/completion.py:887— lib/crewai/src/crewai/llms/providers/azure/completion.py:887-900 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2279-2296 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2719-2736 — 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 `lib/crewai/src/crewai/llms/providers/openai/completion.py:2279` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/crewai/src/crewai/llms/providers/openai/completion.py:2737` calls `import` and `lib/crewai/src/crewai/llms/providers/openai/completion.py:2297` 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–18 lines × 3) lib/crewai/src/crewai/llms/providers/azure/completion.py:1014— lib/crewai/src/crewai/llms/providers/azure/completion.py:1014-1030 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2600-2617 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2952-2969 — 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 `lib/crewai/src/crewai/llms/providers/azure/completion.py:1014` 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–18 lines × 2) lib/crewai-tools/src/crewai_tools/tools/patronus_eval_tool/patronus_eval_tool.py:139— lib/crewai-tools/src/crewai_tools/tools/patronus_eval_tool/patronus_eval_tool.py:139-156 | lib/crewai-tools/src/crewai_tools/tools/patronus_eval_tool/patronus_predefined_criteria_eval_tool.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 `lib/crewai-tools/src/crewai_tools/tools/patronus_eval_tool/patronus_predefined_criteria_eval_tool.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. 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–18 lines × 2) lib/crewai/src/crewai/agents/agent_executor.py:2183— lib/crewai/src/crewai/agents/agent_executor.py:2183-2200 | lib/crewai/src/crewai/utilities/agent_utils.py:1532-1548 — 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 `lib/crewai/src/crewai/agents/agent_executor.py:2183` 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 (12–18 lines × 2) lib/devtools/src/crewai_devtools/docs_versioning.py:257— lib/devtools/src/crewai_devtools/docs_versioning.py:257-268 | scripts/docs/prefix_version_paths.py:213-230 — 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 (15–17 lines × 2) lib/crewai-tools/src/crewai_tools/adapters/crewai_rag_adapter.py:283— lib/crewai-tools/src/crewai_tools/adapters/crewai_rag_adapter.py:283-299 | lib/crewai-tools/src/crewai_tools/adapters/crewai_rag_adapter.py:334-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 4) lib/crewai/src/crewai/llms/providers/openai/completion.py:1293— lib/crewai/src/crewai/llms/providers/openai/completion.py:1293-1308 | lib/crewai/src/crewai/llms/providers/openai/completion.py:1436-1451 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2361-2376 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2801-2816 — all 4 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 (4–16 lines × 3) lib/cli/src/crewai_cli/crew_run_tui.py:1919— lib/cli/src/crewai_cli/crew_run_tui.py:1919-1922 | lib/cli/src/crewai_cli/crew_run_tui.py:1938-1951 | lib/cli/src/crewai_cli/crew_run_tui.py:1988-2003 — 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.
Duplicated block (14–15 lines × 4) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1221— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1221-1234 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:1768-1782 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2340-2354 | lib/crewai/src/crewai/llms/providers/openai/completion.py:2784-2798 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/crewai/src/crewai/llms/providers/openai/completion.py:2356` calls `_invoke_after_llm_call_hooks` and `lib/crewai/src/crewai/llms/providers/openai/completion.py:2799` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–15 lines × 3) lib/crewai/src/crewai/tools/base_tool.py:441— lib/crewai/src/crewai/tools/base_tool.py:441-452 | lib/crewai/src/crewai/tools/base_tool.py:635-646 | lib/crewai/src/crewai/tools/base_tool.py:740-754 — 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. 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–15 lines × 2) lib/crewai-files/src/crewai_files/resolution/resolver.py:297— lib/crewai-files/src/crewai_files/resolution/resolver.py:297-309 | lib/crewai-files/src/crewai_files/resolution/resolver.py:516-530 — 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 `lib/crewai-files/src/crewai_files/resolution/resolver.py:516` 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–14 lines × 3) lib/crewai/src/crewai/events/utils/console_formatter.py:475— lib/crewai/src/crewai/events/utils/console_formatter.py:475-485 | lib/crewai/src/crewai/events/utils/console_formatter.py:519-532 | lib/crewai/src/crewai/events/utils/console_formatter.py:551-561 — 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. 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–14 lines × 3) lib/crewai/src/crewai/events/utils/console_formatter.py:1689— lib/crewai/src/crewai/events/utils/console_formatter.py:1689-1700 | lib/crewai/src/crewai/events/utils/console_formatter.py:1717-1728 | lib/crewai/src/crewai/events/utils/console_formatter.py:1770-1783 — 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 `lib/crewai/src/crewai/events/utils/console_formatter.py:1770` 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–14 lines × 2) lib/crewai/src/crewai/knowledge/source/excel_knowledge_source.py:146— lib/crewai/src/crewai/knowledge/source/excel_knowledge_source.py:146-159 | lib/crewai/src/crewai/knowledge/source/excel_knowledge_source.py:163-173 — 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–14 lines × 2) lib/crewai/src/crewai/llms/providers/snowflake/completion.py:297— lib/crewai/src/crewai/llms/providers/snowflake/completion.py:297-308 | lib/crewai/src/crewai/llms/providers/snowflake/completion.py:313-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. 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–13 lines × 4) lib/crewai/src/crewai/llms/providers/anthropic/completion.py:525— lib/crewai/src/crewai/llms/providers/anthropic/completion.py:525-537 | lib/crewai/src/crewai/llms/providers/anthropic/completion.py:600-612 | lib/crewai/src/crewai/llms/providers/openai/completion.py:679-690 | lib/crewai/src/crewai/llms/providers/openai/completion.py:824-835 — 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 `lib/crewai/src/crewai/llms/providers/anthropic/completion.py:525` 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–12 lines × 5) lib/crewai/src/crewai/tools/base_tool.py:241— lib/crewai/src/crewai/tools/base_tool.py:241-252 | lib/crewai/src/crewai/tools/base_tool.py:444-453 | lib/crewai/src/crewai/tools/base_tool.py:478-489 | lib/crewai/src/crewai/tools/base_tool.py:638-647 | lib/crewai/src/crewai/tools/base_tool.py:744-755 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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–12 lines × 2) REDACTED:2179— REDACTED:2179-2188 | REDACTED:2286-2297 — 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, `REDACTED:2301` calls `argument` and `REDACTED:2192` 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 lines × 5) lib/crewai/src/crewai/a2a/updates/streaming/handler.py:97— lib/crewai/src/crewai/a2a/updates/streaming/handler.py:97-107 | lib/crewai/src/crewai/a2a/updates/streaming/handler.py:116-126 | lib/crewai/src/crewai/a2a/updates/streaming/handler.py:167-177 | lib/crewai/src/crewai/a2a/updates/streaming/handler.py:191-201 | lib/crewai/src/crewai/a2a/updates/streaming/handler.py:366-376 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–11 lines × 4) lib/cli/src/crewai_cli/evaluate_crew.py:31— lib/cli/src/crewai_cli/evaluate_crew.py:31-41 | lib/cli/src/crewai_cli/kickoff_flow.py:110-118 | lib/cli/src/crewai_cli/replay_from_task.py:25-34 | lib/cli/src/crewai_cli/train_crew.py:26-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 all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/crewai_cli/evaluate_crew.py:31` 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 × 3) lib/crewai/src/crewai/events/utils/console_formatter.py:1268— lib/crewai/src/crewai/events/utils/console_formatter.py:1268-1278 | lib/crewai/src/crewai/events/utils/console_formatter.py:1300-1310 | lib/crewai/src/crewai/events/utils/console_formatter.py:1320-1330 — 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. 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) lib/crewai/src/crewai/task.py:720— lib/crewai/src/crewai/task.py:720-729 | lib/crewai/src/crewai/task.py:879-888 | lib/crewai/src/crewai/task.py:1431-1440 | lib/crewai/src/crewai/task.py:1552-1561 — all 4 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 `lib/crewai/src/crewai/task.py:720` 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–10 lines × 3) lib/crewai/src/crewai/events/utils/console_formatter.py:1607— lib/crewai/src/crewai/events/utils/console_formatter.py:1607-1616 | lib/crewai/src/crewai/events/utils/console_formatter.py:1641-1649 | lib/crewai/src/crewai/events/utils/console_formatter.py:1675-1683 — 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.
Duplicated block (9 lines × 10) lib/crewai/src/crewai/events/utils/console_formatter.py:659— lib/crewai/src/crewai/events/utils/console_formatter.py:659-667 | lib/crewai/src/crewai/events/utils/console_formatter.py:677-685 | lib/crewai/src/crewai/events/utils/console_formatter.py:691-699 | lib/crewai/src/crewai/events/utils/console_formatter.py:706-714 | lib/crewai/src/crewai/events/utils/console_formatter.py:747-755 | lib/crewai/src/crewai/events/utils/console_formatter.py:932-940 | lib/crewai/src/crewai/events/utils/console_formatter.py:994-1002 | lib/crewai/src/crewai/events/utils/console_formatter.py:1077-1085 | lib/crewai/src/crewai/events/utils/console_formatter.py:1099-1107 | lib/crewai/src/crewai/events/utils/console_formatter.py:1119-1127 — all 10 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. 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 × 5) lib/crewai/src/crewai/events/utils/console_formatter.py:1608— lib/crewai/src/crewai/events/utils/console_formatter.py:1608-1616 | lib/crewai/src/crewai/events/utils/console_formatter.py:1640-1648 | lib/crewai/src/crewai/events/utils/console_formatter.py:1674-1682 | lib/crewai/src/crewai/events/utils/console_formatter.py:1686-1694 | lib/crewai/src/crewai/events/utils/console_formatter.py:1714-1722 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–9 lines × 4) lib/crewai/src/crewai/events/utils/console_formatter.py:482— lib/crewai/src/crewai/events/utils/console_formatter.py:482-490 | lib/crewai/src/crewai/events/utils/console_formatter.py:1576-1582 | lib/crewai/src/crewai/events/utils/console_formatter.py:1672-1679 | lib/crewai/src/crewai/events/utils/console_formatter.py:1712-1719 — all 4 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, `lib/crewai/src/crewai/events/utils/console_formatter.py:480` calls `get` and `lib/crewai/src/crewai/events/utils/console_formatter.py:1670` 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–9 lines × 4) lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:84— lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:84-92 | lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:105-112 | lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:121-128 | lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:133-140 — all 4 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 (9 lines × 3) lib/crewai/src/crewai/agents/agent_executor.py:3065— lib/crewai/src/crewai/agents/agent_executor.py:3065-3073 | lib/crewai/src/crewai/agents/agent_executor.py:3156-3164 | lib/crewai/src/crewai/agents/agent_executor.py:3500-3508 — 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 (7–9 lines × 2) lib/crewai/src/crewai/tools/tool_usage.py:177— lib/crewai/src/crewai/tools/tool_usage.py:177-183 | lib/crewai/src/crewai/tools/tool_usage.py:224-232 — 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 `lib/crewai/src/crewai/tools/tool_usage.py:224` 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 (7–8 lines × 4) lib/crewai/src/crewai/tools/tool_usage.py:161— lib/crewai/src/crewai/tools/tool_usage.py:161-167 | lib/crewai/src/crewai/tools/tool_usage.py:177-183 | lib/crewai/src/crewai/tools/tool_usage.py:209-215 | lib/crewai/src/crewai/tools/tool_usage.py:225-232 — all 4 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 `lib/crewai/src/crewai/tools/tool_usage.py:225` 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 (8 lines × 3) lib/crewai/src/crewai/llms/providers/azure/completion.py:371— lib/crewai/src/crewai/llms/providers/azure/completion.py:371-378 | lib/crewai/src/crewai/llms/providers/azure/completion.py:693-700 | lib/crewai/src/crewai/llms/providers/openai/completion.py:526-533 — 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 (4–8 lines × 4) lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:64— lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:64-67 | lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:81-88 | lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:97-104 | lib/crewai/src/crewai/rag/embeddings/providers/ibm/embedding_callable.py:118-125 — all 4 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.
Duplicated block (7–8 lines × 2) lib/crewai-files/src/crewai_files/uploaders/bedrock.py:320— lib/crewai-files/src/crewai_files/uploaders/bedrock.py:320-327 | lib/crewai-files/src/crewai_files/uploaders/bedrock.py:471-477 — 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 (6 lines × 6) lib/crewai/src/crewai/events/utils/console_formatter.py:299— lib/crewai/src/crewai/events/utils/console_formatter.py:299-304 | lib/crewai/src/crewai/events/utils/console_formatter.py:1107-1112 | lib/crewai/src/crewai/events/utils/console_formatter.py:1125-1130 | lib/crewai/src/crewai/events/utils/console_formatter.py:1276-1281 | lib/crewai/src/crewai/events/utils/console_formatter.py:1328-1333 | lib/crewai/src/crewai/events/utils/console_formatter.py:1478-1483 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/crewai/src/crewai/events/utils/console_formatter.py:1272` calls `replace`, `title` and `lib/crewai/src/crewai/events/utils/console_formatter.py:1121` 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 (6 lines × 3) lib/crewai/src/crewai/events/utils/console_formatter.py:669— lib/crewai/src/crewai/events/utils/console_formatter.py:669-674 | lib/crewai/src/crewai/events/utils/console_formatter.py:683-688 | lib/crewai/src/crewai/events/utils/console_formatter.py:753-758 — 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 × 12) lib/crewai/src/crewai/events/utils/console_formatter.py:298— lib/crewai/src/crewai/events/utils/console_formatter.py:298-302 | lib/crewai/src/crewai/events/utils/console_formatter.py:342-346 | lib/crewai/src/crewai/events/utils/console_formatter.py:559-563 | lib/crewai/src/crewai/events/utils/console_formatter.py:664-668 | lib/crewai/src/crewai/events/utils/console_formatter.py:999-1003 | lib/crewai/src/crewai/events/utils/console_formatter.py:1082-1086 | lib/crewai/src/crewai/events/utils/console_formatter.py:1104-1108 | lib/crewai/src/crewai/events/utils/console_formatter.py:1124-1128 | lib/crewai/src/crewai/events/utils/console_formatter.py:1275-1279 | lib/crewai/src/crewai/events/utils/console_formatter.py:1327-1331 | lib/crewai/src/crewai/events/utils/console_formatter.py:1406-1410 | lib/crewai/src/crewai/events/utils/console_formatter.py:1477-1481 — all 12 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, `lib/crewai/src/crewai/events/utils/console_formatter.py:556` calls `get` and `lib/crewai/src/crewai/events/utils/console_formatter.py:996` 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 × 11) lib/crewai-tools/src/crewai_tools/tools/code_docs_search_tool/code_docs_search_tool.py:49— lib/crewai-tools/src/crewai_tools/tools/code_docs_search_tool/code_docs_search_tool.py:49-53 | lib/crewai-tools/src/crewai_tools/tools/csv_search_tool/csv_search_tool.py:49-53 | lib/crewai-tools/src/crewai_tools/tools/directory_search_tool/directory_search_tool.py:51-55 | lib/crewai-tools/src/crewai_tools/tools/docx_search_tool/docx_search_tool.py:49-53 | lib/crewai-tools/src/crewai_tools/tools/json_search_tool/json_search_tool.py:47-51 | lib/crewai-tools/src/crewai_tools/tools/mdx_search_tool/mdx_search_tool.py:49-53 | lib/crewai-tools/src/crewai_tools/tools/txt_search_tool/txt_search_tool.py:47-51 | lib/crewai-tools/src/crewai_tools/tools/website_search/website_search_tool.py:51-55 | lib/crewai-tools/src/crewai_tools/tools/xml_search_tool/xml_search_tool.py:45-49 | lib/crewai-tools/src/crewai_tools/tools/youtube_channel_search_tool/youtube_channel_search_tool.py:56-60 | lib/crewai-tools/src/crewai_tools/tools/youtube_video_search_tool/youtube_video_search_tool.py:49-53 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 11 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 11 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 (5 lines × 7) lib/crewai/src/crewai/knowledge/source/base_knowledge_source.py:44— lib/crewai/src/crewai/knowledge/source/base_knowledge_source.py:44-48 | lib/crewai/src/crewai/knowledge/source/csv_knowledge_source.py:47-51 | lib/crewai/src/crewai/knowledge/source/excel_knowledge_source.py:177-181 | lib/crewai/src/crewai/knowledge/source/json_knowledge_source.py:59-63 | lib/crewai/src/crewai/knowledge/source/pdf_knowledge_source.py:59-63 | lib/crewai/src/crewai/knowledge/source/string_knowledge_source.py:37-41 | lib/crewai/src/crewai/knowledge/source/text_file_knowledge_source.py:39-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 7 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 (14 lines × 3) lib/crewai-tools/src/crewai_tools/rag/loaders/csv_loader.py:12— lib/crewai-tools/src/crewai_tools/rag/loaders/csv_loader.py:12-25 | lib/crewai-tools/src/crewai_tools/rag/loaders/json_loader.py:11-24 | lib/crewai-tools/src/crewai_tools/rag/loaders/mdx_loader.py:19-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 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.
Duplicated block (6 lines × 10) lib/crewai-tools/src/crewai_tools/tools/code_docs_search_tool/code_docs_search_tool.py:32— lib/crewai-tools/src/crewai_tools/tools/code_docs_search_tool/code_docs_search_tool.py:32-37 | lib/crewai-tools/src/crewai_tools/tools/csv_search_tool/csv_search_tool.py:32-37 | lib/crewai-tools/src/crewai_tools/tools/directory_search_tool/directory_search_tool.py:33-38 | lib/crewai-tools/src/crewai_tools/tools/docx_search_tool/docx_search_tool.py:32-37 | lib/crewai-tools/src/crewai_tools/tools/json_search_tool/json_search_tool.py:33-38 | lib/crewai-tools/src/crewai_tools/tools/mdx_search_tool/mdx_search_tool.py:32-37 | lib/crewai-tools/src/crewai_tools/tools/website_search/website_search_tool.py:33-38 | lib/crewai-tools/src/crewai_tools/tools/xml_search_tool/xml_search_tool.py:31-36 | lib/crewai-tools/src/crewai_tools/tools/youtube_channel_search_tool/youtube_channel_search_tool.py:34-39 | lib/crewai-tools/src/crewai_tools/tools/youtube_video_search_tool/youtube_video_search_tool.py:32-37 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 10 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 10 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/crewai-tools/src/crewai_tools/tools/directory_search_tool/directory_search_tool.py:41` calls `validate_directory_path` and `lib/crewai-tools/src/crewai_tools/tools/code_docs_search_tool/code_docs_search_tool.py:40` 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.
Off the main sequence: crewai-core — crewai-core: abstractness 0.03, instability 0.00, distance 0.97 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
P4 · Deployment & Rollback· No deployment automation · ×1
No deployment automation — No release automation was found in CI — neither a deploy stage (Helm/Kubernetes/compose manifests, an orchestrated rollout) nor a publish job that ships the built artifact. Releases appear to be run by hand, which is slower, less repeatable and harder to reverse.
Third-party script without Subresource Integrity lib/crewai/src/crewai/flow/visualization/assets/interactive_flow.html.j2:9— `https://unpkg.com/lucide@latest` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 3 such include(s) across the repository's markup.
X1 · Async correctness· Task from `asyncio.create_task` is not kept · ×1
Task from `asyncio.create_task` is not kept lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py:572— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
Orphaned file lib/crewai/src/crewai/a2a/auth/client_schemes.py: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 lib/crewai-files/src/crewai_files/core/sources.py: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 lib/crewai-files/src/crewai_files/cache/upload_cache.py: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 lib/crewai-tools/src/crewai_tools/tools/brave_search_tool/schemas.py: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 lib/crewai-files/src/crewai_files/processing/validators.py: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 lib/crewai-files/src/crewai_files/uploaders/bedrock.py: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 lib/crewai/src/crewai/a2a/extensions/a2ui/client_extension.py: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 lib/crewai-files/src/crewai_files/uploaders/gemini.py: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 lib/crewai/src/crewai/a2a/extensions/a2ui/catalog.py: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 lib/crewai-tools/src/crewai_tools/tools/merge_agent_handler_tool/merge_agent_handler_tool.py: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 lib/crewai/src/crewai/a2a/utils/content_type.py: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 lib/crewai/src/crewai/a2a/updates/polling/handler.py: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 lib/crewai-tools/src/crewai_tools/tools/brave_search_tool/base.py: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 lib/crewai/src/crewai/a2a/updates/push_notifications/handler.py: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 lib/crewai-files/src/crewai_files/processing/processor.py: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 lib/crewai/src/crewai/a2a/extensions/server.py: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 lib/crewai-files/src/crewai_files/processing/transformers.py: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 lib/crewai/src/crewai/a2a/extensions/a2ui/models.py: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 lib/crewai/src/crewai/a2a/auth/utils.py: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 lib/crewai-files/src/crewai_files/uploaders/anthropic.py: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 lib/crewai/src/crewai/a2a/extensions/a2ui/validator.py: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 lib/crewai/src/crewai/a2a/utils/transport.py: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 lib/crewai-files/src/crewai_files/core/types.py: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 lib/crewai/src/crewai/rag/qdrant/utils.py: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 lib/crewai/src/crewai/a2a/utils/agent_card_signing.py: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.
README/code drift README.md:219— README.md runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift lib/crewai-tools/README.md:3— lib/crewai-tools/README.md links to `./assets/crewai_logo.png`, but `lib/crewai-tools/assets/crewai_logo.png` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift lib/crewai/README.md:189— lib/crewai/README.md runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ar/installation.mdx:75— docs/edge/ar/installation.mdx runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ar/introduction.mdx:14— docs/edge/ar/introduction.mdx links to `/ar/guides/flows/first-flow`, but `ar/guides/flows/first-flow` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ar/introduction.mdx:15— docs/edge/ar/introduction.mdx links to `/ar/guides/crews/first-crew`, but `ar/guides/crews/first-crew` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ar/quickstart.mdx:18— docs/edge/ar/quickstart.mdx links to `/ar/installation`, but `ar/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ar/quickstart.mdx:201— docs/edge/ar/quickstart.mdx links to `/ar/guides/flows/first-flow`, but `ar/guides/flows/first-flow` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ar/quickstart.mdx:201— docs/edge/ar/quickstart.mdx links to `/ar/concepts/flows`, but `ar/concepts/flows` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ar/quickstart.mdx:201— docs/edge/ar/quickstart.mdx links to `/ar/concepts/crews`, but `ar/concepts/crews` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ar/quickstart.mdx:201— docs/edge/ar/quickstart.mdx links to `/ar/concepts/agents#direct-agent-interaction-with-kickoff`, but `ar/concepts/agents` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ar/telemetry.mdx:27— docs/edge/ar/telemetry.mdx links to `/ar/observability/tracing`, but `ar/observability/tracing` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/en/installation.mdx:190— docs/edge/en/installation.mdx runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/en/installation.mdx:225— docs/edge/en/installation.mdx links to `/en/guides/migration/upgrading-crewai`, but `en/guides/migration/upgrading-crewai` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/en/introduction.mdx:14— docs/edge/en/introduction.mdx links to `/en/guides/flows/first-flow`, but `en/guides/flows/first-flow` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/en/introduction.mdx:15— docs/edge/en/introduction.mdx links to `/en/guides/crews/first-crew`, but `en/guides/crews/first-crew` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/en/quickstart.mdx:18— docs/edge/en/quickstart.mdx links to `/en/installation`, but `en/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ko/installation.mdx:68— docs/edge/ko/installation.mdx runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ko/introduction.mdx:14— docs/edge/ko/introduction.mdx links to `/ko/guides/flows/first-flow`, but `ko/guides/flows/first-flow` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ko/introduction.mdx:15— docs/edge/ko/introduction.mdx links to `/ko/guides/crews/first-crew`, but `ko/guides/crews/first-crew` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ko/quickstart.mdx:18— docs/edge/ko/quickstart.mdx links to `/ko/installation`, but `ko/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ko/quickstart.mdx:201— docs/edge/ko/quickstart.mdx links to `/ko/guides/flows/first-flow`, but `ko/guides/flows/first-flow` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ko/quickstart.mdx:201— docs/edge/ko/quickstart.mdx links to `/ko/concepts/flows`, but `ko/concepts/flows` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ko/quickstart.mdx:201— docs/edge/ko/quickstart.mdx links to `/ko/concepts/crews`, but `ko/concepts/crews` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/edge/ko/quickstart.mdx:201— docs/edge/ko/quickstart.mdx links to `/ko/concepts/agents#direct-agent-interaction-with-kickoff`, but `ko/concepts/agents` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Interpolated log message defeats structured logging lib/crewai-core/src/crewai_core/settings.py:106— `info` at line 106 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/upload_cache.py:188— `debug` at line 188 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/upload_cache.py:304— `debug` at line 304 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/upload_cache.py:366— `debug` at line 366 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/upload_cache.py:380— `debug` at line 380 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/upload_cache.py:550— `debug` at line 550 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:50— `debug` at line 50 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:52— `warning` at line 52 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:55— `warning` at line 55 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:88— `warning` at line 88 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:99— `info` at line 99 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:137— `debug` at line 137 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:163— `warning` at line 163 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:174— `warning` at line 174 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:182— `info` at line 182 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:215— `debug` at line 215 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:217— `warning` at line 217 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:220— `warning` at line 220 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:265— `warning` at line 265 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:279— `info` at line 279 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:319— `debug` at line 319 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:353— `warning` at line 353 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:374— `warning` at line 374 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/cache/cleanup.py:386— `info` at line 386 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging lib/crewai-files/src/crewai_files/processing/validators.py:101— `debug` at line 101 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Duplicated predicate lib/crewai-files/src/crewai_files/formatting/api.py:329— `"anthropic" in provider_lower or "claude" in provider_lower` appears character-identically in 2 files — lib/crewai-files/src/crewai_files/formatting/api.py, lib/crewai-files/src/crewai_files/uploaders/factory.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 lib/crewai/src/crewai/mcp/client.py:745— `"authentication" in error_str or "unauthorized" in error_str` appears character-identically in 3 files — lib/crewai/src/crewai/mcp/client.py, lib/crewai/src/crewai/mcp/exceptions.py, lib/crewai/src/crewai/tools/mcp_tool_wrapper.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 lib/crewai-files/src/crewai_files/formatting/api.py:332— `"bedrock" in provider_lower or "aws" in provider_lower` appears character-identically in 2 files — lib/crewai-files/src/crewai_files/formatting/api.py, lib/crewai-files/src/crewai_files/uploaders/factory.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 lib/crewai/src/crewai/mcp/tool_resolver.py:645— `"connection" in error_str or "network" in error_str` appears character-identically in 2 files — lib/crewai/src/crewai/mcp/tool_resolver.py, lib/crewai/src/crewai/tools/mcp_tool_wrapper.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 lib/crewai-files/src/crewai_files/formatting/api.py:336— `"gemini" in provider_lower or "google" in provider_lower` appears character-identically in 2 files — lib/crewai-files/src/crewai_files/formatting/api.py, lib/crewai-files/src/crewai_files/uploaders/factory.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 lib/devtools/src/crewai_devtools/docs_versioning.py:279— `"groups" in node and not out.get("groups")` appears character-identically in 2 files — lib/devtools/src/crewai_devtools/docs_versioning.py, scripts/docs/prefix_version_paths.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 lib/crewai/src/crewai/mcp/tool_resolver.py:647— `"json" in error_str or "parsing" in error_str` appears character-identically in 2 files — lib/crewai/src/crewai/mcp/tool_resolver.py, lib/crewai/src/crewai/tools/mcp_tool_wrapper.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 lib/devtools/src/crewai_devtools/docs_versioning.py:277— `"pages" in node and not out.get("pages")` appears character-identically in 2 files — lib/devtools/src/crewai_devtools/docs_versioning.py, scripts/docs/prefix_version_paths.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 lib/devtools/src/crewai_devtools/docs_versioning.py:372— `VERSION_SLUG_RE.match(head) and len(parts) >= 2 and parts[1] in KNOWN_LOCALES` appears character-identically in 2 files — lib/devtools/src/crewai_devtools/docs_versioning.py, scripts/docs/prefix_version_paths.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 lib/crewai/src/crewai/a2a/utils/agent_card.py:262— `auth and isinstance(auth, (HTTPDigestAuth, APIKeyAuth))` appears character-identically in 2 files — lib/crewai/src/crewai/a2a/utils/agent_card.py, lib/crewai/src/crewai/a2a/utils/delegation.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 lib/cli/src/crewai_cli/experimental/eval_crew.py:1303— `c.isspace() or ord(c) < 32 or ord(c) == 127` appears character-identically in 2 files — lib/cli/src/crewai_cli/experimental/eval_crew.py, lib/crewai/src/crewai/telemetry/tracing/grants.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 lib/crewai/src/crewai/memory/storage/lancedb_storage.py:570— `child_prefix and sc.startswith(child_prefix)` appears character-identically in 2 files — lib/crewai/src/crewai/memory/storage/lancedb_storage.py, lib/crewai/src/crewai/memory/storage/qdrant_edge_storage.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 lib/crewai/src/crewai/crew.py:1077— `execution_token is None and isinstance(e, TraceGrantError)` appears character-identically in 2 files — lib/crewai/src/crewai/crew.py, lib/crewai/src/crewai/flow/runtime/__init__.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 lib/crewai-files/src/crewai_files/uploaders/anthropic.py:99— `file.filename or generate_filename(file.content_type)` appears character-identically in 2 files — lib/crewai-files/src/crewai_files/uploaders/anthropic.py, lib/crewai-files/src/crewai_files/uploaders/openai.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 lib/cli/src/crewai_cli/crew_run_tui.py:852— `getattr(agent, "role", "") or getattr(agent, "name", "") or "Agent"` appears character-identically in 2 files — lib/cli/src/crewai_cli/crew_run_tui.py, lib/cli/src/crewai_cli/run_crew.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 lib/crewai/src/crewai/llms/providers/azure/completion.py:1358— `getattr(completion_details, "reasoning_tokens", 0) or 0` appears character-identically in 2 files — lib/crewai/src/crewai/llms/providers/azure/completion.py, lib/crewai/src/crewai/llms/providers/openai/completion.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 lib/crewai/src/crewai/llms/providers/azure/completion.py:1353— `getattr(prompt_details, "cached_tokens", 0) or 0` appears character-identically in 2 files — lib/crewai/src/crewai/llms/providers/azure/completion.py, lib/crewai/src/crewai/llms/providers/openai/completion.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 lib/crewai/src/crewai/agent/core.py:2157— `guardrail_result.error or "Guardrail validation failed"` appears character-identically in 2 files — lib/crewai/src/crewai/agent/core.py, lib/crewai/src/crewai/lite_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 lib/cli/src/crewai_cli/crew_run_tui.py:838— `hasattr(agent, "llm") and hasattr(agent.llm, "stream")` appears character-identically in 2 files — lib/cli/src/crewai_cli/crew_run_tui.py, lib/cli/src/crewai_cli/run_crew.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 lib/crewai-tools/src/crewai_tools/aws/bedrock/agents/invoke_agent_tool.py:168— `hasattr(e, "response") and "Error" in e.response` appears character-identically in 2 files — lib/crewai-tools/src/crewai_tools/aws/bedrock/agents/invoke_agent_tool.py, lib/crewai-tools/src/crewai_tools/aws/bedrock/knowledge_base/retriever_tool.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 lib/crewai/src/crewai/llms/providers/anthropic/completion.py:2107— `hasattr(response, "usage") and response.usage` appears character-identically in 3 files — lib/crewai/src/crewai/llms/providers/anthropic/completion.py, lib/crewai/src/crewai/llms/providers/azure/completion.py, lib/crewai/src/crewai/llms/providers/openai/completion.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 lib/crewai/src/crewai/mcp/client.py:624— `hasattr(result, "content") and result.content` appears character-identically in 2 files — lib/crewai/src/crewai/mcp/client.py, lib/crewai/src/crewai/tools/mcp_native_tool.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 lib/crewai-core/src/crewai_core/telemetry.py:287— `hasattr(self, "_initialized") and self._initialized` appears character-identically in 2 files — lib/crewai-core/src/crewai_core/telemetry.py, lib/crewai/src/crewai/telemetry/telemetry.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 lib/crewai/src/crewai/knowledge/source/base_file_knowledge_source.py:92— `hasattr(self, "file_path") and self.file_path is not None` appears character-identically in 2 files — lib/crewai/src/crewai/knowledge/source/base_file_knowledge_source.py, lib/crewai/src/crewai/knowledge/source/excel_knowledge_source.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 lib/crewai/src/crewai/agents/agent_executor.py:2382— `hasattr(tool_call, "function_call") and tool_call.function_call` appears character-identically in 2 files — lib/crewai/src/crewai/agents/agent_executor.py, lib/crewai/src/crewai/utilities/agent_utils.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.
Silent fallback default on parse failure lib/cli/src/crewai_cli/deploy/main.py:182— `_response_failure_reason` returns `'invalid_json'` when `(json.JSONDecodeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure lib/cli/src/crewai_cli/model_catalog.py:572— `_parse_iso` returns `0.0` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure lib/cli/src/crewai_cli/model_catalog.py:579— `_as_float` returns `0.0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure lib/crewai/src/crewai/types/usage_metrics.py:18— `_coerce_int` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure lib/crewai/src/crewai/utilities/reasoning_handler.py:555— `_format_available_tools` returns `'No tools available'` when `(AttributeError, TypeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure lib/crewai/src/crewai/utilities/training_converter.py:132— `_parse_float` returns `0.0` when `(ValueError, AttributeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py:286— `_run` returns `"The 'beautifulsoup4' package is required to use this tool. Please install it with 'pip install beautifulsoup4'."` when `ImportError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py:305— `_arun` returns `"The 'beautifulsoup4' package is required to use this tool. Please install it with 'pip install beautifulsoup4'."` when `ImportError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py:332— `_run` returns `"The 'beautifulsoup4' package is required to use this tool. Please install it with 'pip install beautifulsoup4'."` when `ImportError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py:363— `_arun` returns `"The 'beautifulsoup4' package is required to use this tool. Please install it with 'pip install beautifulsoup4'."` when `ImportError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 31 significant file(s) lose their only recent owner: lib/crewai/src/crewai/events/types/a2a_events.py, lib/crewai/src/crewai/rag/chromadb/client.py, lib/crewai/src/crewai/a2a/utils/agent_card.py, lib/crewai/src/crewai/a2a/utils/task.py, lib/crewai/src/crewai/state/runtime.py, lib/crewai/src/crewai/rag/core/base_client.py, lib/crewai/src/crewai/a2a/errors.py, lib/crewai/src/crewai/a2a/task_helpers.py (+23 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 6 significant file(s) lose their only recent owner: lib/cli/src/crewai_cli/experimental/eval_crew.py, lib/cli/src/crewai_cli/model_catalog.py, lib/crewai/src/crewai/llm_overlay.py, lib/crewai-core/src/crewai_core/runtime_env.py, lib/crewai/src/crewai/telemetry/tracing/last_run.py, lib/cli/src/crewai_cli/deploy/archive.py. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 4 significant file(s) lose their only recent owner: lib/crewai/src/crewai/flow/conversational_mixin.py, lib/crewai/src/crewai/flow/conversation.py, lib/crewai/src/crewai/flow/conversational.py, lib/crewai/src/crewai/telemetry/tracing/context.py. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 3 significant file(s) lose their only recent owner: lib/cli/src/crewai_cli/tui_picker.py, lib/crewai-core/src/crewai_core/platform_apps.py, lib/cli/src/crewai_cli/authentication/main.py. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 3 significant file(s) lose their only recent owner: lib/devtools/src/crewai_devtools/docs_versioning.py, lib/crewai/src/crewai/hooks/dispatch.py, lib/crewai/src/crewai/hooks/contexts.py. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 3 significant file(s) lose their only recent owner: lib/crewai-files/src/crewai_files/cache/cleanup.py, lib/crewai-files/src/crewai_files/uploaders/factory.py, lib/crewai-files/src/crewai_files/processing/exceptions.py. Pair on, review, or document these before any departure.
Silent fallback default in catch lib/cli/src/crewai_cli/cli.py:121— `_get_cli_version` swallows every exception into `return 'unknown'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch lib/crewai/src/crewai/experimental/evaluation/metrics/reasoning_metrics.py:348— `_calculate_trend` swallows every exception into `return 0.0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch lib/crewai/src/crewai/utilities/project_utils.py:556— `_extract_run_params_schema` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch lib/crewai/src/crewai/utilities/project_utils.py:595— `_extract_init_params_schema` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch lib/crewai-tools/src/crewai_tools/generate_tool_specs.py:108— `_extract_params` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Documentation: no project overview README.md— The root README begins with a branding banner and links to every major asset but does not state what the repository is for or what it does beyond being an orchestration framework. Add one sentence explaining the repository's purpose (multi-agent orchestration, AI agent automation) so readers can find the right document.
Documentation: no project overview lib/crewai-tools/src/crewai_tools/tools/contextualai_create_agent_tool/README.md— The README begins with a 'Description' heading and ends with an example, but it does not state what the directory is for or why Contextual AI integration matters. Add one sentence explaining the purpose of this tool (integrating Contextual RAG agents into CrewAI) so readers can locate it among the three tools.
X23 · Unguarded diagnostic materialisation· Diagnostic log message is built whether or not it is wanted · ×2
Diagnostic log message is built whether or not it is wanted lib/crewai-tools/src/crewai_tools/tools/merge_agent_handler_tool/merge_agent_handler_tool.py:94— `debug` at line 94 is called with an argument built by `json.dumps(payload, indent = 2)` (line 94), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted lib/crewai/src/crewai/llms/providers/bedrock/completion.py:1111— `debug` at line 1111 is called with an argument built by `json.dumps(current_tool_use)` (line 1112), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 6 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 (58 single-owned of 458 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; 458 of the 956 production source files in this repository met that bar). They are anonymized user #7 (2 file(s)), anonymized user #8 (2 file(s)), anonymized user #9 (1 file(s)), anonymized user #10 (1 file(s)), anonymized user #11 (1 file(s)), anonymized user #12 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: lib/crewai-tools/src/crewai_tools/tools/tavily_research_tool/tavily_research_tool.py, lib/crewai-tools/src/crewai_tools/tools/tavily_get_research_tool/tavily_get_research_tool.py, lib/crewai/src/crewai/flow/dsl/_router.py, lib/crewai/src/crewai/utilities/declarative_refs.py, lib/crewai-tools/src/crewai_tools/tools/databricks_query_tool/databricks_query_tool.py, lib/crewai-tools/src/crewai_tools/tools/db2_search_tool/db2_search_tool.py, lib/crewai-tools/src/crewai_tools/rag/loaders/github_loader.py, lib/crewai-core/src/crewai_core/lock_store.py.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 3 of 10 project(s) overshoot their size bounds, lowering Project Cohesion to 4.0/10. The most over is `lib/crewai` (110492 LoC, 1150 module-visible types across 102 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 51 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: lib/crewai/src/crewai/a2a/auth/client_schemes.py, lib/crewai-files/src/crewai_files/core/sources.py, lib/crewai-files/src/crewai_files/cache/upload_cache.py, lib/crewai-tools/src/crewai_tools/tools/brave_search_tool/schemas.py, lib/crewai-files/src/crewai_files/processing/validators.py, lib/crewai-files/src/crewai_files/uploaders/bedrock.py, lib/crewai/src/crewai/a2a/extensions/a2ui/client_extension.py, lib/crewai-files/src/crewai_files/uploaders/gemini.py (and 43 more) (56 orphaned of 458 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; 458 of the 956 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 5/8 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `lib/cli/src/crewai_cli/templates/crew`, `lib/cli/src/crewai_cli/templates/flow`, `lib/devtools`.
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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
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 5 file(s) — `lib/cli/src/crewai_cli/templates/crew/crew.py`, `lib/cli/src/crewai_cli/templates/crew/main.py`, `lib/cli/src/crewai_cli/templates/flow/main.py`, `lib/cli/src/crewai_cli/templates/tool/src/{{folder_name}}/__init__.py`, `lib/cli/src/crewai_cli/templates/tool/src/{{folder_name}}/tool.py` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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 01a1718c-26e0-7fcb-99d3-9169e69ecb27 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 32 · Warnings: 1079 · Recommendations: 192 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 25-10-2026 @ 05:32 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.