Skip to content

Commit d62a2a7

Browse files
authored
Merge pull request #10 from SecureCodeWarrior/v1
Updated wording
2 parents 7677c7c + 5d59615 commit d62a2a7

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

dist/index.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sarifProcessors/helpProcessor.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ function addTextAndMarkdown(helpObj, textToAdd, markdownToAdd) {
1717
}
1818

1919
function appendHeader(helpObj) {
20-
let textToAdd = 'Secure Code Warrior Training:';
21-
let markdownToAdd = `## Secure Code Warrior Training`;
20+
let textToAdd = 'Build your secure coding skills and defend your code:';
21+
let markdownToAdd = `## Build your secure coding skills and defend your code`;
2222
addTextAndMarkdown(helpObj, textToAdd, markdownToAdd);
2323
}
2424

@@ -28,11 +28,11 @@ function appendTrainingData(helpObj, name, description, url, videos, displayRefe
2828
if (videos && videos[0]) videos[0] = videos[0].replace(/ /g, '%20');
2929

3030
let textToAdd = `[${displayReference}] ${name}`;
31-
if (videos && videos[0]) textToAdd += ` [What is this?](${videos[0]})`;
31+
if (videos && videos[0]) textToAdd += ` [What is this? (2min video)](${videos[0]})`;
3232
textToAdd += `\n\n${description} [Try this challenge in Secure Code Warrior](${url})`;
3333

3434
let markdownToAdd = `#### [${displayReference}] ${name}`
35-
if (videos && videos[0]) markdownToAdd += ` *[What is this?](${videos[0]})*`;
35+
if (videos && videos[0]) markdownToAdd += ` *[What is this? (2min video)](${videos[0]})*`;
3636
markdownToAdd += `\n\n* ${description} [Try this challenge in Secure Code Warrior](${url})`;
3737

3838
addTextAndMarkdown(helpObj, textToAdd, markdownToAdd);

sarifProcessors/helpProcessor.test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ test('helpProcessor should create both text and markdown if neither are present'
1313
const helpObj = {};
1414
helpProcessor.appendTrainingData(helpObj, NAME, DESCRIPTION, URL, VIDEOS, DISPLAY_REF);
1515
expect(helpObj).toEqual({
16-
markdown: `#### [${DISPLAY_REF}] ${NAME} *[What is this?](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`,
17-
text: `[${DISPLAY_REF}] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
16+
markdown: `#### [${DISPLAY_REF}] ${NAME} *[What is this? (2min video)](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`,
17+
text: `[${DISPLAY_REF}] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
1818
});
1919
});
2020

@@ -24,7 +24,7 @@ test('helpProcessor should append to markdown if only markdown is present', asyn
2424
};
2525
helpProcessor.appendTrainingData(helpObj, NAME, DESCRIPTION, URL, VIDEOS, DISPLAY_REF);
2626
expect(helpObj).toEqual({
27-
markdown: `existing markdown\n\n#### [${DISPLAY_REF}] ${NAME} *[What is this?](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
27+
markdown: `existing markdown\n\n#### [${DISPLAY_REF}] ${NAME} *[What is this? (2min video)](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
2828
});
2929
});
3030

@@ -44,7 +44,7 @@ test('helpProcessor should append to text if only text is present', async () =>
4444
};
4545
helpProcessor.appendTrainingData(helpObj, NAME, DESCRIPTION, URL, VIDEOS, DISPLAY_REF);
4646
expect(helpObj).toEqual({
47-
text: `existing text\n\n[${DISPLAY_REF}] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
47+
text: `existing text\n\n[${DISPLAY_REF}] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
4848
});
4949
});
5050

@@ -55,8 +55,8 @@ test('helpProcessor should append to both text and markdown if both are present'
5555
};
5656
helpProcessor.appendTrainingData(helpObj, NAME, DESCRIPTION, URL, VIDEOS, DISPLAY_REF);
5757
expect(helpObj).toEqual({
58-
markdown: `existing markdown\n\n#### [${DISPLAY_REF}] ${NAME} *[What is this?](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`,
59-
text: `existing text\n\n[${DISPLAY_REF}] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
58+
markdown: `existing markdown\n\n#### [${DISPLAY_REF}] ${NAME} *[What is this? (2min video)](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`,
59+
text: `existing text\n\n[${DISPLAY_REF}] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
6060
});
6161
});
6262

@@ -67,7 +67,7 @@ test('helpProcessor should append header to both text and markdown if both are p
6767
};
6868
helpProcessor.appendHeader(helpObj);
6969
expect(helpObj).toEqual({
70-
markdown: `existing markdown\n\n## Secure Code Warrior Training`,
71-
text: `existing text\n\nSecure Code Warrior Training:`
70+
markdown: `existing markdown\n\n## Build your secure coding skills and defend your code`,
71+
text: `existing text\n\nBuild your secure coding skills and defend your code:`
7272
});
7373
});

sarifProcessors/ruleProcessor.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ test('ruleProcessor should load test002 and add contextual micro-learning materi
6262
"text": "Unused variables, imports, functions or classes may be a symptom of a bug and should be examined carefully."
6363
},
6464
"help": {
65-
"text": `some help text\n\nSecure Code Warrior Training:\n\n[CWE 89] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
65+
"text": `some help text\n\nBuild your secure coding skills and defend your code:\n\n[CWE 89] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
6666
}
6767
});
6868

@@ -82,8 +82,8 @@ test('ruleProcessor should load test002 and add contextual micro-learning materi
8282
"text": "something something cwe89 something CWE: 79 and\nsomething else cwe-----352 again"
8383
},
8484
"help": {
85-
"text": `Some text here some text here\n\nSecure Code Warrior Training:\n\n[CWE 352] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 89] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 79] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 94] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`,
86-
"markdown": `# A Heading\n\nSome text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here\n\n## A Smaller Heading\n\nMore text here more text here more text here more text here more text here more text here CWE_94 more text here more text here\n\n## Secure Code Warrior Training\n\n#### [CWE 352] ${NAME} *[What is this?](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 89] ${NAME} *[What is this?](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 79] ${NAME} *[What is this?](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 94] ${NAME} *[What is this?](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
85+
"text": `Some text here some text here\n\nBuild your secure coding skills and defend your code:\n\n[CWE 352] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 89] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 79] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 94] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`,
86+
"markdown": `# A Heading\n\nSome text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here\n\n## A Smaller Heading\n\nMore text here more text here more text here more text here more text here more text here CWE_94 more text here more text here\n\n## Build your secure coding skills and defend your code\n\n#### [CWE 352] ${NAME} *[What is this? (2min video)](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 89] ${NAME} *[What is this? (2min video)](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 79] ${NAME} *[What is this? (2min video)](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 94] ${NAME} *[What is this? (2min video)](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
8787
}
8888
});
8989
});
@@ -118,8 +118,8 @@ test('ruleProcessor should load test003 and add 2 entries based on the rule id a
118118
"text": "Unused variables, imports, functions or classes may be a symptom of a bug and should be examined carefully."
119119
},
120120
"help": {
121-
"text": `some help text\n\nSecure Code Warrior Training:\n\n[CWE 22] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 23] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`,
122-
"markdown": `markdown version some link [here](https://github.com)\n\n## Secure Code Warrior Training\n\n#### [CWE 22] ${NAME} *[What is this?](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 23] ${NAME} *[What is this?](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
121+
"text": `some help text\n\nBuild your secure coding skills and defend your code:\n\n[CWE 22] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 23] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`,
122+
"markdown": `markdown version some link [here](https://github.com)\n\n## Build your secure coding skills and defend your code\n\n#### [CWE 22] ${NAME} *[What is this? (2min video)](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 23] ${NAME} *[What is this? (2min video)](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
123123
}
124124
});
125125
});
@@ -154,8 +154,8 @@ test('ruleProcessor should load test004 and add 4 entries based on the rule id,
154154
"text": "Unused variables, imports, functions or classes may be a symptom of a bug and should be examined carefully."
155155
},
156156
"help": {
157-
"text": `some help text\n\nSecure Code Warrior Training:\n\n[CWE 22] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 23] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 24] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 25] ${NAME} [What is this?](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`,
158-
"markdown": `markdown version some link [here](https://github.com)\n\n## Secure Code Warrior Training\n\n#### [CWE 22] ${NAME} *[What is this?](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 23] ${NAME} *[What is this?](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 24] ${NAME} *[What is this?](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 25] ${NAME} *[What is this?](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
157+
"text": `some help text\n\nBuild your secure coding skills and defend your code:\n\n[CWE 22] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 23] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 24] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n[CWE 25] ${NAME} [What is this? (2min video)](${VIDEOS[0]})\n\n${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`,
158+
"markdown": `markdown version some link [here](https://github.com)\n\n## Build your secure coding skills and defend your code\n\n#### [CWE 22] ${NAME} *[What is this? (2min video)](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 23] ${NAME} *[What is this? (2min video)](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 24] ${NAME} *[What is this? (2min video)](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})\n\n#### [CWE 25] ${NAME} *[What is this? (2min video)](${VIDEOS[0]})*\n\n* ${DESCRIPTION} [Try this challenge in Secure Code Warrior](${URL})`
159159
},
160160
"properties": {
161161
"tags": [

0 commit comments

Comments
 (0)