MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / matches_have_unknown

Function matches_have_unknown

src/packagedcode/licensing.py:602–614  ·  view source on GitHub ↗

Return True if any of the LicenseMatch in ``matches`` has an unknown license. Note that by construction and design, an unknown license must have the word "unknown" in its license key, but we only care about two specific license keys, and not all license keys.

(matches, licensing=Licensing())

Source from the content-addressed store, hash-verified

600
601
602def matches_have_unknown(matches, licensing=Licensing()):
603 """
604 Return True if any of the LicenseMatch in ``matches`` has an unknown license.
605 Note that by construction and design, an unknown license must have the word "unknown" in its
606 license key, but we only care about two specific license keys, and not all license keys.
607 """
608 for match in matches:
609 exp = match.rule.license_expression_object
610 if any(
611 key in ('unknown', 'unknown-spdx')
612 for key in licensing.license_keys(exp)
613 ):
614 return True
615
616
617def get_license_detections_from_matches(matches):

Calls 1

license_keysMethod · 0.80

Tested by

no test coverage detected