/
antoninsch_factors.go
103 lines (59 loc) · 2.34 KB
/
antoninsch_factors.go
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package cores
import (
"github.com/a-grasso/deprec/configuration"
"github.com/a-grasso/deprec/model"
)
func DeityGiven(m model.DataModel, c configuration.CoresConfig) model.Core {
cr := model.NewCore(model.DeityGiven)
marking := Marking(m, c.Marking)
vulnerabilities := Vulnerabilities(m, c.Vulnerabilities)
cr.Overtake(marking, c.DeityGiven.Weights.Marking)
cr.Overtake(vulnerabilities, c.DeityGiven.Weights.Vulnerabilities)
return *cr
}
func Effort(m model.DataModel, c configuration.CoresConfig) model.Core {
cr := model.NewCore(model.Effort)
activity := Activity(m, c.Activity)
recentness := Recentness(m, c.Recentness)
coreTeam := CoreTeam(m, c.CoreTeam)
cr.Overtake(recentness, c.Effort.Weights.Recentness)
cr.Overtake(activity, c.Effort.Weights.Activity)
cr.Overtake(coreTeam, c.Effort.Weights.CoreTeam)
return *cr
}
func Interconnectedness(m model.DataModel, c configuration.CoresConfig) model.Core {
cr := model.NewCore(model.Interconnectedness)
network := Network(m, c.Network)
popularity := Popularity(m, c.Popularity)
cr.Overtake(network, c.Interconnectedness.Weights.Network)
cr.Overtake(popularity, c.Interconnectedness.Weights.Popularity)
return *cr
}
func Community(m model.DataModel, c configuration.CoresConfig) model.Core {
cr := model.NewCore(model.Community)
participation := Participation(m, c.Participation)
backup := Backup(m, c.Backup)
prestige := Prestige(m, c.Prestige)
cr.Overtake(prestige, c.Community.Weights.Prestige)
cr.Overtake(backup, c.Community.Weights.Backup)
cr.Overtake(participation, c.Community.Weights.Participation)
return *cr
}
func Support(m model.DataModel, c configuration.CoresConfig) model.Core {
cr := model.NewCore(model.Support)
processing := Processing(m, c.Processing)
engagement := Engagement(m, c.Engagement)
cr.Overtake(processing, c.Support.Weights.Processing)
cr.Overtake(engagement, c.Support.Weights.Engagement)
return *cr
}
func Circumstances(m model.DataModel, c configuration.CoresConfig) model.Core {
cr := model.NewCore(model.Circumstances)
rivalry := Rivalry(m, c.Rivalry)
quality := ProjectQuality(m, c.ProjectQuality)
licensing := Licensing(m, c.Licensing)
cr.Overtake(rivalry, c.Circumstances.Weights.Rivalry)
cr.Overtake(licensing, c.Circumstances.Weights.Licensing)
cr.Overtake(quality, c.Circumstances.Weights.ProjectQuality)
return *cr
}