script/test.js

Strings must use doublequote. (quotes)
3
const fs = require('fs');
Strings must use doublequote. (quotes)
5
let log = '{\n';
Strings must use doublequote. (quotes)
6
let issuelog = ' "message": "#### Syntax Issues\\n\\n Name | Entry\\n----|----------------------\\n';
Found fs.readFileSync with non literal argument at index 0 (security/detect-non-literal-fs-filename)
8
const file = fs.readFileSync(process.argv[2], 'utf8'); // Reads argv into var file
Function 'findPattern' has a complexity of 9. (complexity)
19
function findPattern(text) { // Test entries against 8 patterns. If matches pattern returns true
Function 'entryErrorCheck' has a complexity of 5. (complexity)
48
function entryErrorCheck(md) {
Generic Object Injection Sink (security/detect-object-injection)
56
entryArray[i] = new Object;
Generic Object Injection Sink (security/detect-object-injection)
57
entryArray[i].raw = entries[i];
Function Call Object Injection Sink (security/detect-object-injection)
58
if (entryFilter(entries[i]) === true) { // filter out lines that don't with * [)
Generic Object Injection Sink (security/detect-object-injection)
60
entryArray[i].name = namepatt.exec(entries[i])[1]; // Parses name of entry
Generic Object Injection Sink (security/detect-object-injection)
61
entryArray[i].pass = findPattern(entries[i]); // Tests against known patterns
Generic Object Injection Sink (security/detect-object-injection)
62
if (entryArray[i].pass === true) { // If entry passes increment totalPass counter
Unexpected console statement. (no-console)
65
console.log(`${entryArray[i].name} Failed.`); // If entry fails increment totalFail counter and append error to issuelog
Generic Object Injection Sink (security/detect-object-injection)
65
console.log(`${entryArray[i].name} Failed.`); // If entry fails increment totalFail counter and append error to issuelog
Generic Object Injection Sink (security/detect-object-injection)
68
issuelog += `${entryArray[i].name} | ${entries[i]} \\n`;
Unexpected console statement. (no-console)
73
console.log(`${totalFail} Failed, ${totalPass} Passed, of ${total}`);
Strings must use doublequote. (quotes)
75
fs.writeFileSync('syntaxcheck.json', `${log} ${issuelog} "\n}`);
Unexpected console statement. (no-console)
78
console.log(`${totalFail} Failed, ${totalPass} Passed, of ${total} \n`);
Strings must use doublequote. (quotes)
79
log += ' "error": false\n}';
Strings must use doublequote. (quotes)
80
fs.writeFileSync('syntaxcheck.json', log);