Recent statistics can be found at
- Node.js version 12+
- npm
- A bunch of code files (.xml or .catrobat).
- Install npm dependencies with
npm install
- Calculate statistics by using
npm start -- <arguments>(note the additional--) ornode --experimental-modules --es-module-specifier-resolution=node --experimental-worker index.js <arguments>
| argument | description | status | default |
|---|---|---|---|
‑‑program‑folder |
A single .xml or .catrobat file, or a folder which will be searched recursively for .xml or .catrobat files | required, deprecating | |
‑‑output‑file |
If specified, the output JSON will be written to the file. If not specified, the output will be written to the console which can be useful by using the > operator (e.g. node ... > path/to/statistics.json) |
optional | |
‑‑cache‑folder- |
program‑stats.js and related source files, clear the cache folder. |
not working | |
‑‑workers |
Speeds up calculating statistics for each program by using as many forked workers as possible. By using 1, no workers will be forked (helpful for debugging). | #cpus |
npm start -- --program-folder path/to/programs --output-file path/to/output/statistics.json(note the additional--)node --experimental-modules --es-module-specifier-resolution=node --experimental-worker index.js --program-folder path/to/programs --output-file path/to/output/statistics.json
UNKNOWN_VALUEis caused when usingnpm startand you forget to add--to separatenpm startfrom the program arguments. See examples on how to use it.index.jsis a link pointing tosrc/index.js. It may cause problems on some machines. Just trynode ... src/index ...instead.
- Place tests in the
test/assetsfolder. Each test is a folder containing acode.xmlstats.json. It isn't necessary to place all data in the json, only set, not empty, not 0 ones. A skeleton is used to fill out the data which is specified at text/utils.js.
- Run
npm test(don't forget to install dependencies by runningnpm installfirst)