MCPcopy Index your code
hub / github.com/apache/caldera / Visibility

Class Visibility

app/objects/secondclass/c_visibility.py:16–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14
15
16class Visibility(BaseObject):
17
18 MIN_SCORE = 1
19 MAX_SCORE = 100
20
21 schema = VisibilitySchema()
22
23 @property
24 def display(self):
25 return self.clean(dict(score=self.score))
26
27 @property
28 def score(self):
29 total_score = self._score + sum([a.offset for a in self.adjustments])
30 if total_score > self.MAX_SCORE:
31 return self.MAX_SCORE
32 elif total_score < self.MIN_SCORE:
33 return self.MIN_SCORE
34 return total_score
35
36 def __init__(self):
37 super().__init__()
38 self._score = 50
39 self.adjustments = []
40
41 def apply(self, adjustment):
42 self.adjustments.append(adjustment)

Callers 2

__init__Method · 0.90
build_visibilityMethod · 0.85

Calls 1

VisibilitySchemaClass · 0.85

Tested by

no test coverage detected