1+ // https://github.com/SocketDev/socket-python-cli/blob/6d4fc56faee68d3a4764f1f80f84710635bdaf05/socketsecurity/core/messages.py
12import { Diff , Issue , Purl } from './classes'
23
34export class Messages {
4- // OK
5- createSecurityCommentJSON ( { diff } : { diff : Diff } ) {
5+ static createSecurityCommentJSON ( { diff } : { diff : Diff } ) {
66 let scanFailed = false
77
88 if ( diff . newAlerts . length === 0 ) {
9- // TODO : unreachable code
9+ // FIXME : unreachable code
1010 for ( const alert of diff . newAlerts ) {
1111 if ( alert . error ) {
1212 scanFailed = true
@@ -31,13 +31,11 @@ export class Messages {
3131 return output
3232 }
3333
34- // OK
3534 static createPurlLink ( purl : Purl ) : string {
3635 const packageUrl = `[${ purl . purl } ](${ purl . url } )`
3736 return packageUrl
3837 }
3938
40- // OK
4139 static createAddedTable ( diff : Diff ) : string {
4240 const overviewTable = [
4341 'Package' ,
@@ -72,7 +70,6 @@ export class Messages {
7270 return md
7371 }
7472
75- // OK
7673 static createRemoveLine ( diff : Diff ) : string {
7774 const removedLine = [ 'Removed packages:' ]
7875 for ( const removed of diff . removedPackages ) {
@@ -82,7 +79,6 @@ export class Messages {
8279 return removedLine . join ( ', ' )
8380 }
8481
85- // OK
8682 static dependencyOverviewTemplate ( diff : Diff ) : string {
8783 let md = ''
8884 md += '<!-- socket-overview-comment-actions -->\n'
@@ -96,7 +92,6 @@ export class Messages {
9692 return md
9793 }
9894
99- // OK
10095 static createSources ( alert : Issue ) : [ string , string ] {
10196 const sources : string [ ] = [ ]
10297 const manifests : string [ ] = [ ]
@@ -117,7 +112,6 @@ export class Messages {
117112 return [ manifestStr , sourcesStr ]
118113 }
119114
120- // OK
121115 static createSecurityAlertTable ( diff : Diff ) : {
122116 ignoreCommands : string [ ]
123117 nextSteps : Record < string , string [ ] >
@@ -165,7 +159,6 @@ export class Messages {
165159 return { ignoreCommands, nextSteps, mdTable : md }
166160 }
167161
168- // OK
169162 static createNextSteps ( nextSteps : Record < string , string [ ] > ) : string {
170163 let md = ''
171164 for ( const step in nextSteps ) {
@@ -180,7 +173,6 @@ export class Messages {
180173 return md
181174 }
182175
183- // OK
184176 static createDeeperLook ( ) : string {
185177 let md = ''
186178 md += '<details>\n'
@@ -191,7 +183,6 @@ export class Messages {
191183 return md
192184 }
193185
194- // OK
195186 static createRemovePackage ( ) : string {
196187 let md = ''
197188 md += '<details>\n'
@@ -202,7 +193,6 @@ export class Messages {
202193 return md
203194 }
204195
205- // OK
206196 static createAcceptableRisk ( ignoreCommands : string [ ] ) : string {
207197 let md = ''
208198 md += '<details>\n'
@@ -218,7 +208,6 @@ export class Messages {
218208 return md
219209 }
220210
221- // OK
222211 static securityCommentTemplate ( diff : Diff ) : string {
223212 let md = ''
224213 md += '<!-- socket-security-comment-actions -->\n'
0 commit comments