mirror of
https://github.com/mandiant/capa.git
synced 2026-07-09 05:39:14 -07:00
Apply suggestions from code review: rename Flavor to Scopes
Co-authored-by: Willi Ballenthin (Google) <118457858+wballenthin@users.noreply.github.com>
This commit is contained in:
@@ -858,8 +858,8 @@ class Rule:
|
||||
# this is probably the mode that rule authors will start with.
|
||||
# each rule has two scopes, a static-flavor scope, and a
|
||||
# dynamic-flavor one. which one is used depends on the analysis type.
|
||||
scope = meta.get("scope", FUNCTION_SCOPE)
|
||||
scope = parse_flavor(scope)
|
||||
scopes = meta.get("scopes", FUNCTION_SCOPE)
|
||||
scopes = parse_scopes(scopes)
|
||||
statements = d["rule"]["features"]
|
||||
|
||||
# the rule must start with a single logic node.
|
||||
@@ -978,7 +978,10 @@ class Rule:
|
||||
|
||||
# the name and scope of the rule instance overrides anything in meta.
|
||||
meta["name"] = self.name
|
||||
meta["scope"] = self.scope.definition if isinstance(self.scope, Flavor) else self.scope
|
||||
meta["scopes"] = {
|
||||
"static": self.scopes.static,
|
||||
"dynamic": self.scopes.dynamic,
|
||||
}
|
||||
|
||||
def move_to_end(m, k):
|
||||
# ruamel.yaml uses an ordereddict-like structure to track maps (CommentedMap).
|
||||
|
||||
Reference in New Issue
Block a user