You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -24,99 +24,231 @@ export async function outputPurlScore(
24
24
}
25
25
26
26
if(outputKind==='markdown'){
27
-
const{ alerts, func, score, worst }=dataas{
28
-
func: string
29
-
score: {
30
-
license: number
31
-
maintenance: number
32
-
overall: number
33
-
quality: number
34
-
supplyChain: number
35
-
vulnerability: number
27
+
const{
28
+
purl: requestedPurl,
29
+
self: {
30
+
alerts: selfAlerts,
31
+
capabilities: selfCaps,
32
+
purl,
33
+
score: selfScore
34
+
},
35
+
transitively: {
36
+
alerts,
37
+
capabilities,
38
+
dependencyCount,
39
+
func,
40
+
lowest,
41
+
score
36
42
}
37
-
worst: {
38
-
license: string
39
-
maintenance: string
40
-
overall: string
41
-
quality: string
42
-
supplyChain: string
43
-
vulnerability: string
43
+
}=dataas{
44
+
purl: string
45
+
self: {
46
+
purl: string
47
+
score: {
48
+
license: number
49
+
maintenance: number
50
+
overall: number
51
+
quality: number
52
+
supplyChain: number
53
+
vulnerability: number
54
+
}
55
+
capabilities: string[]
56
+
alerts: Array<{
57
+
name: string
58
+
severity: string
59
+
category: string
60
+
example: string
61
+
}>
62
+
}
63
+
transitively: {
64
+
dependencyCount: number
65
+
func: string
66
+
score: {
67
+
license: number
68
+
maintenance: number
69
+
overall: number
70
+
quality: number
71
+
supplyChain: number
72
+
vulnerability: number
73
+
}
74
+
lowest: {
75
+
license: string
76
+
maintenance: string
77
+
overall: string
78
+
quality: string
79
+
supplyChain: string
80
+
vulnerability: string
81
+
}
82
+
capabilities: string[]
83
+
alerts: Array<{
84
+
name: string
85
+
severity: string
86
+
category: string
87
+
example: string
88
+
}>
44
89
}
45
-
alerts: Array<{
46
-
name: string
47
-
severity: string
48
-
category: string
49
-
}>
50
90
}
51
91
52
-
logger.error(`Score report for "${purl}":\n`)
53
-
logger.log('# Deep Package Score')
54
-
logger.log('')
55
-
logger.log(
56
-
'This Socket report contains the response for requesting a deep package score for'
57
-
)
58
-
logger.log(
59
-
`a package and any of its dependencies or transitive dependencies.`
60
-
)
61
-
logger.log('')
62
-
logger.log(`The package is: ${purl}`)
92
+
logger.error(`Score report for "${requestedPurl}" ("${purl}"):\n`)
93
+
logger.log('# Complete Package Score')
63
94
logger.log('')
64
-
logger.log('## Score')
95
+
if(dependencyCount){
96
+
logger.log(
97
+
`This is a Socket report for the package *"${purl}"* and its *${dependencyCount}* direct/transitive dependencies.`
98
+
)
99
+
}else{
100
+
logger.log(
101
+
`This is a Socket report for the package *"${purl}"*. It has *no dependencies*.`
102
+
)
103
+
}
65
104
logger.log('')
66
-
logger.log('Please note:')
67
-
logger.log(
68
-
' The listed scores reflect the scores from the requested package, its'
69
-
)
70
-
logger.log(
71
-
' dependencies, and any transitive dependencies. An aggregation function'
72
-
)
73
-
logger.log(
74
-
' computes the final score which is presented in this report.'
75
-
)
105
+
if(dependencyCount){
106
+
logger.log(
107
+
`It will show you the shallow score for just the package itself and a deep score for all the transitives combined. Additionally you can see which capabilities were found and the top alerts as well as a package that was responsible for it.`
108
+
)
109
+
}else{
110
+
logger.log(
111
+
`It will show you the shallow score for the package itself, which capabilities were found, and its top alerts.`
112
+
)
113
+
logger.log('')
114
+
logger.log(
115
+
'Since it has no dependencies, the shallow score is also the deep score.'
116
+
)
117
+
}
76
118
logger.log('')
77
-
logger.log(`The aggregation function that was used is: "${func}"`)
119
+
if(dependencyCount){
120
+
// This doesn't make much sense if there are no dependencies. Better to omit it.
121
+
logger.log(
122
+
'The report should give you a good insight into the status of this package.'
123
+
)
124
+
logger.log('')
125
+
logger.log('## Package itself')
126
+
logger.log('')
127
+
logger.log(
128
+
'Here are results for the package itself (excluding data from dependencies).'
129
+
)
130
+
}else{
131
+
logger.log('## Report')
132
+
logger.log('')
133
+
logger.log(
134
+
'The report should give you a good insight into the status of this package.'
'These are the packages with the lowest recorded score. If there is more than one with the lowest score, just one is shown here. This may help you figure out the source of low scores.'
0 commit comments