Skip to content

Commit ed292f2

Browse files
author
jovanSAPFIONEER
committed
fix: resolve 4 CodeQL alerts (#95-#98)
- #98: Remove useless initial assignment to phaseStatus in phase-pipeline.ts - #97: Remove unused 'adapter' destructuring in test-phase8.ts - #96: Remove unused ValueAdapter class in test-phase8.ts - #95: Remove unused DelayAdapter class in test-phase8.ts
1 parent 3eaaef3 commit ed292f2

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

lib/phase-pipeline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export class PhasePipeline {
191191

192192
const phaseStart = Date.now();
193193
const agentResults = new Map<string, AgentResult>();
194-
let phaseStatus: PhaseStatus = 'running';
194+
let phaseStatus: PhaseStatus;
195195

196196
// --- Execute agents -------------------------------------------------
197197
try {

test-phase8.ts

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -93,31 +93,6 @@ class FailingAdapter extends BaseAdapter {
9393
}
9494
}
9595

96-
class DelayAdapter extends BaseAdapter {
97-
readonly name: string;
98-
readonly version = '1.0.0';
99-
private delayMs: number;
100-
101-
constructor(name: string, delayMs: number) { super(); this.name = name; this.delayMs = delayMs; }
102-
103-
async executeAgent(agentId: string, payload: AgentPayload): Promise<AgentResult> {
104-
await new Promise(r => setTimeout(r, this.delayMs));
105-
return { success: true, data: { agentId, delayed: this.delayMs } };
106-
}
107-
}
108-
109-
class ValueAdapter extends BaseAdapter {
110-
readonly name: string;
111-
readonly version = '1.0.0';
112-
private value: unknown;
113-
114-
constructor(name: string, value: unknown) { super(); this.name = name; this.value = value; }
115-
116-
async executeAgent(agentId: string): Promise<AgentResult> {
117-
return { success: true, data: this.value };
118-
}
119-
}
120-
12196
/** Helper: create a registry with a mock adapter registered for all agents */
12297
async function makeRegistry(adapterName = 'mock'): Promise<{ registry: AdapterRegistry; adapter: MockAdapter }> {
12398
const registry = new AdapterRegistry();
@@ -182,7 +157,7 @@ async function testPhasePipeline() {
182157

183158
// 5. Parallel agents in a phase
184159
{
185-
const { registry, adapter } = await makeRegistry();
160+
const { registry } = await makeRegistry();
186161
const pipeline = new PhasePipeline(registry, baseCtx, {
187162
phases: [{ name: 'scan', agents: ['a', 'b', 'c'], parallel: true }],
188163
});

0 commit comments

Comments
 (0)