-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstride.puml
59 lines (54 loc) · 1.93 KB
/
stride.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
!function $TrustValueRatio($ratio)
!return "<font:monospace><b><back:white><color:black> " + $ratio + " </color></back></b></font>"
!endfunction
!function $AggregatedRisk($risk)
!return "<font:monospace><b><back:#darkorchid><color:#white> " + $risk + " </color></back></b></font>"
!endfunction
!function $AggregatedRisks($risks)
!$risk_string = ""
!$index = 0
!$length = %strlen($risks)
!$current_risk = ""
!while $index < $length
!$char = %substr($risks, $index, 1)
!if (%strpos($char, ":") == 0)
!$risk_string = $risk_string + $AggregatedRisk($current_risk) + " "
!$current_risk = ""
!else
!$current_risk = $current_risk + $char
!endif
!$index = $index + 1
!endwhile
!return $risk_string + $AggregatedRisk($current_risk)
!endfunction
!function $Stride($stride_code)
!$stride_string = ""
!if (%strpos($stride_code, "S")>=0)
!$stride_string = $stride_string + "<color:#blue><back:#lightblue> S </back></color>"
!endif
!if (%strpos($stride_code, "T")>=0)
!$stride_string = $stride_string + "<color:#green><back:#lightgreen> T </back></color>"
!endif
!if (%strpos($stride_code, "R")>=0)
!$stride_string = $stride_string + "<color:#brown><back:#orange> R </back></color>"
!endif
!if (%strpos($stride_code, "I")>=0)
!$stride_string = $stride_string + "<color:#darkgoldenrod><back:#yellow> I </back></color>"
!endif
!if (%strpos($stride_code, "D")>=0)
!$stride_string = $stride_string + "<color:#firebrick><back:#pink> D </back></color>"
!endif
!if (%strpos($stride_code, "E")>=0)
!$stride_string = $stride_string + "<color:#purple><back:#plum> E </back></color>"
!endif
!return "<font:monospace><b>" + $stride_string + "</b></font>"
!endfunction
skinparam card {
backgroundColor<<risk_table>> White
BorderColor<<risk_table>> Black
shadowing<<risk_table>> false
}
!procedure $RiskTable()
hide stereotype
card risks <<risk_table>>
!endprocedure