Total Complexity | 3 |
Complexity/F | 1 |
Lines of Code | 19 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | 1 | var jsrsasign = require('jsrsasign'); |
|
2 | |||
3 | function parseCertFrom(string, encoding) { |
||
4 | 136 | var cert = new jsrsasign.X509(); |
|
5 | 136 | cert.readCertHex(Buffer.from(string, encoding).toString('hex')); |
|
|
|||
6 | 136 | return cert; |
|
7 | } |
||
8 | |||
9 | function parseCertFromBase64(string) { |
||
10 | 136 | return parseCertFrom(string, 'base64'); |
|
11 | } |
||
12 | |||
13 | 1 | var certificates = require('./ca-certificates.json'); |
|
14 | 1 | var store = []; |
|
15 | 1 | Object.keys(certificates).map(function(key) { |
|
16 | 136 | store.push(parseCertFromBase64(certificates[key])); |
|
17 | }); |
||
18 | |||
19 | module.exports = store; |
||
20 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.