_
69 | } 70 |_
80 | } 81 |_
98 | } 99 |_
116 | } 117 |Evaluation
132 |_
149 | } 150 |_
) 128 | } else if (analysis.analyzer === 'Vulnerability' || analysis.analyzer === 'Software Composition') { 129 | let severity = summary; 130 | if (analysis.analyzer === 'Software Composition') { 131 | const { critical, high, medium, low } = summary 132 | 133 | severity = { 134 | critical, 135 | high, 136 | medium, 137 | low 138 | } 139 | } 140 | 141 | Object.keys(severity).map((key) => { 142 | if ((severity[key] != 0 || severity[key] != '')) { 143 | component.push( 144 |{`Total Dependencies: `}{summary.totalDependency}
154 |{`Vulnerable Dependencies: `}{summary.vulnerableDependency}
155 |{`Vulnerabilities Found: `}{summary.vulnerabilityFound}
156 |Severities
160 |No vulnerabilities found
); 181 | } else if (analysis.analyzer === 'Malware') { 182 | const malwareCount = analysis.summary.infectedFiles.length; 183 | const noun = malwareCount > 1 ? 'threats' : 'threat'; 184 | 185 | if (malwareCount > 0) { 186 | component.push( 187 |Threats
193 || File | 196 |Virus | 197 |
|---|---|
| {infectedFile.file_name} | 202 |{infectedFile.virus} | 203 |
No threats found
); 213 | } 214 | } else if (analysis.analyzer === 'License') { 215 | const licenseCount = analysis.summary.length; 216 | const noun = licenseCount > 1 ? 'licenses' : 'license'; 217 | 218 | if (licenseCount > 0) { 219 | component.push( 220 |Licenses
226 | { 227 | analysis.summary.map((license: any) => 228 |-
); 237 | } 238 | } else if (analysis.analyzer === 'Secrets') { 239 | const secretsCount = analysis.summary.length; 240 | if (secretsCount > 0) { 241 | const noun = secretsCount > 1 ? 'secrets' : 'secret'; 242 | component.push( 243 |No secrets found
); 250 | } 251 | component.length === 0 && component.push(No secrets found
); 252 | } else if (analysis.analyzer === 'Bill Of Materials') { 253 | const artifactsCount = analysis.summary.length; 254 | 255 | if (artifactsCount > 0) { 256 | const noun = artifactsCount > 1 ? 'artifacts' : 'artifact'; 257 | const groupBy = (array: [], key: string) => { 258 | return array.reduce((result: any, currentValue) => { 259 | (result[currentValue[key]] = result[currentValue[key]]+1 || 1); 260 | return result; 261 | }, {}); 262 | }; 263 | const artifactCountByType = groupBy(analysis.summary, "type"); 264 | component.push( 265 |Artifact Types
271 | { 272 | Object.keys(artifactCountByType).map(key => 273 |No licenses found.
); 282 | } 283 | } 284 | 285 | return component; 286 | } 287 | 288 | render() { 289 | const { analysis, isAnalyzing } = this.props; 290 | const { result } = analysis; 291 | 292 | const analyses = this.createAnalyses(result); 293 | 294 | return ( 295 | <> 296 |No Analysis
) 290 | } 291 | return( 292 |_
306 | } 307 |_
317 | } 318 |