Skip to content

Commit ccfcad4

Browse files
committed
Add flowchart in new extractors/README.md
Adds a mermaid (markdown-formatted) flowchart to show the flow of execution for the current (shell-script-based) extractor implementation. Updates the root `.gitignore` file for this project and adds: - `extractors/.gitignore` - 'javascript/frameworks/cap/test/.gitignore'
1 parent fe6937a commit ccfcad4

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ typings/
6262

6363
# Misc
6464
.DS_Store
65+
.*.swp
6566

6667
dist/
6768
tmp/

extractors/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Files to ignore under this "extractors" directory
2+
3+
## Ignore the debug directory
4+
debug/
5+

extractors/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# codeql-sap-js:extractors/README.md
2+
3+
## CodeQL CDS Extractor : Flowchart
4+
5+
The following flowchart shows the flow of execution for the current implementation of the extractor.
6+
7+
```mermaid
8+
flowchart TD
9+
COM["`export _build_cmd=<br>$(pwd)/extractors/
10+
javascript/tools/
11+
pre-finalize.sh`"]
12+
DCR[codeql database create<br>--command=$_build_cmd<br>--language=javascript<br>--search-path=./extractors/<br>--<br>/path/to/database]
13+
DB@{ shape: cyl, label: "/path/to/database" }
14+
DINIT[codeql database init]
15+
CRE[codeql resolve extractor]
16+
DTRAC[codeql database<br>trace-command]
17+
SPF[[pre-finalize.sh]]
18+
JSE[[javascript extractor]]
19+
SIF[[index-files.sh]]
20+
DIDX[codeql database index-files<br> --language=cds<br>--include-extension=.cds]
21+
CC[[\`cds\` compiler]]
22+
CDJ([.cds.json files])
23+
TF([CodeQL TRAP files])
24+
DBF[codeql database finalize<br> -- /path/to/database]
25+
26+
COM ==> DCR
27+
DCR ==> |run internal CLI<br>plumbing command| DINIT
28+
DINIT ----> |--language=javascript| CRE
29+
CRE -..-> |/extractor/path/javascript| DINIT
30+
DINIT -.initialize database.-> DB
31+
32+
DINIT ==> |run the<br>javascript extractor| JSE
33+
SPF ==> |run the cds extractor| DIDX
34+
JSE -.-> |extract javascript files:<br>_.html, .js, .json, .ts_| DB
35+
DTRAC ==> |run the build --command| SPF
36+
JSE ==> |run autobuild within<br>the javascript extractor| DTRAC
37+
DIDX ==> |script discovered<br>via --search-path| SIF
38+
SIF ==> |call the cds compiler| CC
39+
CC ==> |compile .cds files to<br>create .cds.json files| CDJ
40+
CDJ -.-> |extract .cds.json files<br>to database| DB
41+
42+
CDJ ==> |generate .trap files| TF
43+
TF ==> |finalize database once<br>pre-finalize completes| DBF
44+
DBF ==> |import TRAP files,<br>then cleanup| DB
45+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore package-lock.json files for tests.
2+
package-lock.json
3+

0 commit comments

Comments
 (0)