Skip to content

Commit 0d4460b

Browse files
Add Robert's fix
1 parent ace42f3 commit 0d4460b

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

packages/code-analyzer-flow-engine/FlowScanner/flow_scanner/executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def run(self) -> QueryManager:
185185
tainted = self.current_frame.parser.get_tainted_inputs()
186186
else:
187187
tainted.update(self.current_frame.parser.get_tainted_inputs())
188-
next_frame.state.tainted_inputs = tainted
188+
next_frame.state.parser.tainted_inputs = tainted
189189

190190
# now switch execution to new frame
191191
self.current_frame = next_frame

packages/code-analyzer-flow-engine/src/engine.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class FlowScannerEngine extends Engine {
9090
queryIds,
9191
percentageUpdateHandler
9292
);
93-
const convertedResults: EngineRunResults = toEngineRunResults(executionResults, ruleNames);
93+
const convertedResults: EngineRunResults = toEngineRunResults(executionResults);
9494
this.emitRunRulesProgressEvent(100);
9595
return convertedResults;
9696
}
@@ -134,8 +134,7 @@ function normalizeRelativeCompletionPercentage(flowPercentage: number): number {
134134
return PRE_INVOCATION_RUN_PERCENT + ((flowPercentage * percentageSpread) / 100);
135135
}
136136

137-
function toEngineRunResults(flowScannerExecutionResult: FlowScannerExecutionResult, requestedRules: string[]): EngineRunResults {
138-
const requestedRulesSet: Set<string> = new Set(requestedRules);
137+
function toEngineRunResults(flowScannerExecutionResult: FlowScannerExecutionResult): EngineRunResults {
139138
const results: EngineRunResults = {
140139
violations: []
141140
};

packages/code-analyzer-flow-engine/test/engine.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe('Tests for the FlowScannerEngine', () => {
8686
}, {});
8787
expect(countsPerRule).toEqual({
8888
MissingDescription: 56,
89-
MissingFaultHandler: 9, // TODO: Follow up with robert to ensure that this should be 9 (not 15 as it was before)
89+
MissingFaultHandler: 9,
9090
PreventPassingUserDataIntoElementWithoutSharing: 5,
9191
PreventPassingUserDataIntoElementWithSharing: 2
9292
});
@@ -628,7 +628,7 @@ describe('Tests for the FlowScannerEngine', () => {
628628

629629
const results: EngineRunResults = await engine.runRules(PreventPassingUserDataRules, createRunOptions(workspace));
630630

631-
expect(results.violations).toHaveLength(1); // TODO: This test is broken - need to check with Robert about this first!
631+
expect(results.violations).toHaveLength(1);
632632
expect(results.violations[0]).toEqual(expectedViolation);
633633
});
634634

@@ -653,7 +653,7 @@ describe('Tests for the FlowScannerEngine', () => {
653653

654654
const results: EngineRunResults = await engine.runRules(PreventPassingUserDataRules, createRunOptions(workspace));
655655

656-
expect(results.violations).toHaveLength(1); // TODO: This test is broken - need to check with Robert about this first!
656+
expect(results.violations).toHaveLength(1);
657657
expect(results.violations[0]).toEqual(expectedViolation);
658658
});
659659

0 commit comments

Comments
 (0)