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

Method relevance

src/licensedcode/detection.py:387–396  ·  view source on GitHub ↗

Return the ``relevance`` of this detection. The relevance is a float between 0 and 100 where 100 means highly relevant and 0 means not relevant at all. This is computed as the relevance of the sum of the underlying matches rule length.

(self)

Source from the content-addressed store, hash-verified

385 return min([round(sum(weighted_coverages), 2), 100])
386
387 def relevance(self):
388 """
389 Return the ``relevance`` of this detection. The relevance
390 is a float between 0 and 100 where 100 means highly relevant and 0 means
391 not relevant at all.
392
393 This is computed as the relevance of the sum of the underlying matches
394 rule length.
395 """
396 return compute_relevance(self.rules_length())
397
398 def score(self):
399 """

Callers

nothing calls this directly

Calls 2

rules_lengthMethod · 0.95
compute_relevanceFunction · 0.90

Tested by

no test coverage detected