MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / ImproveRunner

Class ImproveRunner

vulnerabilities/improve_runner.py:35–59  ·  view source on GitHub ↗

ImproveRunner is responsible for populating the database with any consumable data. It does so in its ``run`` method by invoking the given improver and parsing the returned Inferences into proper database fields

Source from the content-addressed store, hash-verified

33
34
35class ImproveRunner:
36 """
37 ImproveRunner is responsible for populating the database with any
38 consumable data. It does so in its ``run`` method by invoking the given
39 improver and parsing the returned Inferences into proper database fields
40 """
41
42 def __init__(self, improver_class):
43 self.improver_class = improver_class
44
45 def run(self) -> None:
46 improver = self.improver_class()
47 logger.info(f"Running improver: {improver.qualified_name}")
48 for advisory in improver.interesting_advisories:
49 logger.info(f"Processing advisory: {advisory!r}")
50 try:
51 inferences = improver.get_inferences(advisory_data=advisory.to_advisory_data())
52 process_inferences(
53 inferences=inferences,
54 advisory=advisory,
55 improver_name=improver.qualified_name,
56 )
57 except Exception as e:
58 logger.info(f"Failed to process advisory: {advisory!r} with error {e!r}")
59 logger.info("Finished improving using %s.", self.improver_class.qualified_name)
60
61
62@transaction.atomic

Callers 3

legacy_runnerFunction · 0.90
improve_dataMethod · 0.90

Calls

no outgoing calls