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

Method to_dict

vulnerabilities/models.py:3448–3461  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3446 )
3447
3448 def to_dict(self):
3449 from vulnerabilities.utils import purl_to_dict
3450
3451 return {
3452 "package": purl_to_dict(self.base_purl),
3453 "affected_version_range": self.affecting_vers,
3454 "fixed_version_range": self.fixed_vers,
3455 "introduced_by_commit_patches": [
3456 commit.to_dict() for commit in self.introduced_by_package_commit_patches.all()
3457 ],
3458 "fixed_by_commit_patches": [
3459 commit.to_dict() for commit in self.fixed_by_package_commit_patches.all()
3460 ],
3461 }
3462
3463 def to_affected_package_data(self):
3464 """Return `AffectedPackageV2` data from the impact."""

Callers 1

Calls 3

purl_to_dictFunction · 0.90
to_dictMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected