Skip to content

Commit

Permalink
capa.rules: remove redundant is_internal_rule() and `has_file_limit…
Browse files Browse the repository at this point in the history
…ations()` from capa source code
  • Loading branch information
yelhamer committed Oct 26, 2023
1 parent 8029fed commit a0cec3f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions capa/rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,9 +940,6 @@ def _extract_subscope_rules_rec(self, statement):
for child in statement.get_children():
yield from self._extract_subscope_rules_rec(child)

def is_internal_rule(self) -> bool:
return self.meta.get("namespace", "").startswith("internal/")

def is_file_limitation_rule(self) -> bool:
return self.meta.get("namespace", "") == "internal/limitation/file"

Expand Down Expand Up @@ -1622,11 +1619,6 @@ def filter_rules_by_meta(self, tag: str) -> "RuleSet":
break
return RuleSet(list(rules_filtered))

def has_rule_with_namespace(self, capabilities: MatchResults, namespace: str) -> bool:
return any(
self.rules[rule_name].meta.get("namespace", "").startswith(namespace) for rule_name in capabilities.keys()
)

def match(self, scope: Scope, features: FeatureSet, addr: Address) -> Tuple[FeatureSet, ceng.MatchResults]:
"""
match rules from this ruleset at the given scope against the given features.
Expand Down

0 comments on commit a0cec3f

Please sign in to comment.