MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / from_template

Method from_template

aura/analyzers/python/jinja.py:117–135  ·  view source on GitHub ↗
(cls, context, template_name, taints)

Source from the content-addressed store, hash-verified

115class JinjaTemplateVisitor(Visitor):
116 @classmethod
117 def from_template(cls, context, template_name, taints) -> JinjaTemplateVisitor:
118 tpl_path = Path(context.visitor.normalized_path).parent / "templates" / template_name
119 if not tpl_path.exists():
120 logger.info(f"Could not find jinja template: '{template_name}'")
121 return
122
123 new_location = context.visitor.location.create_child(
124 new_location=tpl_path
125 )
126
127 new_location.metadata.update({
128 "template_path": tpl_path,
129 "template_context": context.node.args[1:],
130 "taints": taints,
131 })
132
133 v = cls(location=new_location)
134 v.load_tree()
135 return v
136
137 def load_tree(self):
138 if self.path:

Callers 1

Calls 3

create_childMethod · 0.80
existsMethod · 0.45
load_treeMethod · 0.45

Tested by

no test coverage detected