Skip to content

Commit 1834468

Browse files
committed
clean
1 parent 0fd2629 commit 1834468

6 files changed

Lines changed: 94 additions & 135 deletions

File tree

rule/apply/apply.mbt

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -117,29 +117,6 @@ fn scan_plan_literal_matches(
117117
}
118118
}
119119

120-
///|
121-
/// Applies only structural rules to the supplied untyped AST root.
122-
///
123-
/// Supported expression subtrees are visited in source-tree order. For a
124-
/// single expression and rule, the first matching pattern wins and determines
125-
/// `pattern_index`.
126-
pub fn apply_structural_rules(
127-
file : String,
128-
root_node : @untyped_ast.Node,
129-
rules : Array[CompiledRule],
130-
) -> Array[RuleFinding] {
131-
apply_structural_rules_to_node(file, root_node, rules)
132-
}
133-
134-
///|
135-
pub fn apply_structural_rules_to_node(
136-
file : String,
137-
node : @untyped_ast.Node,
138-
rules : Array[CompiledRule],
139-
) -> Array[RuleFinding] {
140-
apply_structural_scan_plan_to_node(file, node, ScanPlan::from_rules(rules))
141-
}
142-
143120
///|
144121
pub fn apply_structural_scan_plan_to_node(
145122
file : String,
@@ -245,44 +222,6 @@ fn apply_ast_structural_rule_entry_to_scoped_expr(
245222
}
246223
}
247224

248-
///|
249-
/// Applies only taint rules to function-like untyped AST nodes.
250-
///
251-
/// Unsupported top-level nodes are ignored. Other taint-analysis errors are
252-
/// propagated to the caller.
253-
pub fn apply_taint_rules(
254-
file : String,
255-
root_node : @untyped_ast.Node,
256-
rules : Array[CompiledRule],
257-
) -> Array[RuleFinding] raise {
258-
let hits : Array[RuleFinding] = []
259-
let plan = ScanPlan::from_rules(rules)
260-
if root_node.kind == ImplList {
261-
for entry in root_node.children {
262-
let (_, node) = entry
263-
let node_hits = apply_taint_scan_plan_to_node(file, node, plan)
264-
for hit in node_hits {
265-
hits.push(hit)
266-
}
267-
}
268-
} else {
269-
let node_hits = apply_taint_scan_plan_to_node(file, root_node, plan)
270-
for hit in node_hits {
271-
hits.push(hit)
272-
}
273-
}
274-
hits
275-
}
276-
277-
///|
278-
pub fn apply_taint_rules_to_node(
279-
file : String,
280-
node : @untyped_ast.Node,
281-
rules : Array[CompiledRule],
282-
) -> Array[RuleFinding] raise {
283-
apply_taint_scan_plan_to_node(file, node, ScanPlan::from_rules(rules))
284-
}
285-
286225
///|
287226
pub fn apply_taint_scan_plan_to_node(
288227
file : String,

0 commit comments

Comments
 (0)