- package-json-files
- scripts
- tasks-number
- tasks-names
- tasks
- technologies-types
- tasks-technologies
- test-tasks
- technologies-test
- start-tasks
- technologies-start
- build-tasks
- technologies-build
- start-vs-build
- dev-vs-start
SELECT *
FROM [bigquery-public-data:github_repos.contents]
WHERE id IN (SELECT id FROM (
SELECT *
FROM [bigquery-public-data:github_repos.files]
WHERE path = 'package.json'
AND ref = 'refs/heads/master'
))
// The UDF
function getTasks(row, emit) {
if (row.jsonScripts) {
x = JSON.parse(row.jsonScripts)
if (x !== null && typeof x === 'object') {
tasksCounter = 0
Object.keys(x).forEach(function(entry) {
if (validTask(x, entry)) {
tasksCounter++;
}
});
Object.keys(x).forEach(function(entry) {
if (validTask(x, entry)) {
emit({
taskName: entry,
task: decodeTaskHelper(x, entry),
scripts: row.jsonScripts,
projectID: row.id,
tasksCounter: tasksCounter
});
}
});
}
}
}
function validTask(x, entry) {
return decodeTaskHelper(x, entry) != '' && decodeTaskHelper(x, entry) != 'echo "Error: no test specified" && exit 1';
}
function decodeTaskHelper(x, entry) {
var returnVal = x[entry];
return typeof returnVal === 'string' ? returnVal : '' + returnVal;
}
bigquery.defineFunction(
'getTasks', // Name used to call the function from SQL
['id', 'jsonScripts'], // Input column names
// JSON representation of the output schema
[
{name: 'task', type: 'string'},
{name: 'scripts', type: 'string'},
{name: 'taskName', type: 'string'},
{name: 'projectID', type: 'string'},
{name: 'tasksCounter', type: 'integer'},
],
getTasks // The function reference
);
SELECT taskName, task, tasksCounter, projectID, scripts
FROM getTasks(
SELECT id, JSON_EXTRACT(content, '$.scripts') AS jsonScripts
FROM [package-json-files]
)
SELECT tasksCounter, (count(distinct projectID) / 286140 * 100) as percent
FROM [scripts]
GROUP BY tasksCounter
ORDER BY tasksCounter
SELECT taskName, (count(*) / 974274 * 100) as percent
FROM [scripts]
GROUP BY taskName
ORDER BY percent DESC
SELECT task, (count(distinct projectID) / 974274 * 100) as percent
FROM [scripts]
GROUP BY task
ORDER BY percent DESC
| taskType |
group |
| .sh |
task-runner/transpilator |
| ava |
test |
| babel |
compiler |
| babelify |
compiler |
| bower |
other |
| browserify |
task-runner/transpilator |
| cake |
task-runner/transpilator |
| coffee |
compiler |
| compodoc |
documentation |
| coveralls |
test |
| cross-env |
other |
| docker |
documentation |
| documentation |
documentation |
| electron |
framework |
| ember |
framework |
| eslint |
lint |
| find |
other |
| flow |
test |
| grunt |
task-runner/transpilator |
| gulp |
task-runner/transpilator |
| ionic |
framework |
| istanbul |
test |
| jasmine |
test |
| jest |
test |
| jscs |
lint |
| jsdoc |
documentation |
| jshint |
lint |
| karma |
test |
| lab |
test |
| lcovonly |
test |
| lerna |
other |
| less |
compiler |
| lite-server |
server |
| make |
task-runner/transpilator |
| meteor |
framework |
| mocha |
test |
| next |
framework |
| ng |
framework |
| nightwatch |
test |
| nodemon |
server |
| nodeunit |
test |
| nyc |
test |
| pm2 |
server |
| protractor |
test |
| react-native |
framework |
| react-scripts |
framework |
| rm |
other |
| rollup |
task-runner/transpilator |
| sass |
compiler |
| semantic-release |
documentation |
| semistandard |
lint |
| shjs |
other |
| source-map-explorer |
other |
| standard |
lint |
| stylelint |
lint |
| tap |
test |
| travis |
test |
| tsc |
compiler |
| tslint |
lint |
| typings |
test |
| webpack |
task-runner/transpilator |
| webpack-dev-server |
server |
| xo |
lint |
SELECT scripts.taskType as taskType, scripts.percent as percent, types.group as type
FROM (
SELECT taskType, (count(distinct projectID) / 286140 * 100) as percent
FROM
(SELECT *, 'nodemon' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodemon\b)')),
(SELECT *, 'pm2' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bpm2\b)')),
(SELECT *, 'istanbul' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bistanbul\b)')),
(SELECT *, 'jsdoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjsdoc\b)')),
(SELECT *, 'documentation' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocumentation\b)')),
(SELECT *, 'make' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmake\b)')),
(SELECT *, 'semistandard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemistandard\b)')),
(SELECT *, 'eslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\beslint\b)')),
(SELECT *, 'standard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstandard\b)')),
(SELECT *, 'tslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btslint\b)')),
(SELECT *, 'jshint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjshint\b)')),
(SELECT *, 'xo' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bxo\b)')),
(SELECT *, 'jasmine' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjasmine\b)')),
(SELECT *, 'jest' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjest\b)')),
(SELECT *, 'ava' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bava\b)')),
(SELECT *, '.sh' as taskType FROM [scripts] where REGEXP_MATCH(task, r'\.sh')),
(SELECT *, 'mocha' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmocha\b)')),
(SELECT *, 'cake' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcake\b)')),
(SELECT *, 'babel' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabel\b)')),
(SELECT *, 'rollup' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brollup\b)')),
(SELECT *, 'bower' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbower\b)')),
(SELECT *, 'ionic' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bionic\b)')),
(SELECT *, 'next' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnext\b)')),
(SELECT *, 'grunt' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgrunt\b)')),
(SELECT *, 'gulp' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgulp\b)')),
(SELECT *, 'webpack' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack\b)')),
(SELECT *, 'browserify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbrowserify\b)')),
(SELECT *, 'ng' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bng\b)')),
(SELECT *, 'tsc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btsc\b)')),
(SELECT *, 'react-scripts' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-scripts\b)')),
(SELECT *, 'react-native' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-native\b)')),
(SELECT *, 'ember' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bember\b)')),
(SELECT *, 'electron' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\belectron\b)')),
(SELECT *, 'meteor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmeteor\b)')),
(SELECT *, 'karma' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bkarma\b)')),
(SELECT *, 'protractor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bprotractor\b)')),
(SELECT *, 'nyc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnyc\b)')),
(SELECT *, 'coveralls' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoveralls\b)')),
(SELECT *, 'lcovonly' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blcovonly\b)')),
(SELECT *, 'typings' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btypings\b)')),
(SELECT *, 'jscs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjscs\b)')),
(SELECT *, 'less' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bless\b)')),
(SELECT *, 'sass' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsass\b)')),
(SELECT *, 'tap' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btap\b)')),
(SELECT *, 'semantic-release' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemantic-release\b)')),
(SELECT *, 'docker' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocker\b)')),
(SELECT *, 'coffee' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoffee\b)')),
(SELECT *, 'babelify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabelify\b)')),
(SELECT *, 'lite-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blite-server\b)')),
(SELECT *, 'flow' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bflow\b)')),
(SELECT *, 'nodeunit' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodeunit\b)')),
(SELECT *, 'lab' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blab\b)')),
(SELECT *, 'lerna' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blerna\b)')),
(SELECT *, 'stylelint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstylelint\b)')),
(SELECT *, 'travis' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btravis\b)')),
(SELECT *, 'compodoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcompodoc\b)')),
(SELECT *, 'rm' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brm\b)')),
(SELECT *, 'cross-env' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcross-env\b)')),
(SELECT *, 'find' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bfind\b)')),
(SELECT *, 'shjs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bshjs\b)')),
(SELECT *, 'nightwatch' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnightwatch\b)')),
(SELECT *, 'source-map-explorer' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsource-map-explorer\b)')),
(SELECT *, 'webpack-dev-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack-dev-server\b)')),
group by taskType
) as scripts
JOIN [types] as types
ON scripts.taskType = types.taskType
ORDER BY percent DESC
SELECT task, (count(distinct projectID) / 202808 * 100) as percent
FROM [scripts]
WHERE taskName = 'test'
GROUP BY task
ORDER BY percent DESC
SELECT scripts.taskType as taskType, scripts.percent as percent, types.group as type
FROM (
SELECT taskType, (count(distinct projectID) / 202808 * 100) as percent
FROM
(SELECT *, 'nodemon' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodemon\b)')),
(SELECT *, 'pm2' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bpm2\b)')),
(SELECT *, 'istanbul' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bistanbul\b)')),
(SELECT *, 'jsdoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjsdoc\b)')),
(SELECT *, 'documentation' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocumentation\b)')),
(SELECT *, 'make' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmake\b)')),
(SELECT *, 'semistandard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemistandard\b)')),
(SELECT *, 'eslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\beslint\b)')),
(SELECT *, 'standard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstandard\b)')),
(SELECT *, 'tslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btslint\b)')),
(SELECT *, 'jshint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjshint\b)')),
(SELECT *, 'xo' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bxo\b)')),
(SELECT *, 'jasmine' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjasmine\b)')),
(SELECT *, 'jest' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjest\b)')),
(SELECT *, 'ava' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bava\b)')),
(SELECT *, '.sh' as taskType FROM [scripts] where REGEXP_MATCH(task, r'\.sh')),
(SELECT *, 'mocha' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmocha\b)')),
(SELECT *, 'cake' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcake\b)')),
(SELECT *, 'babel' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabel\b)')),
(SELECT *, 'rollup' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brollup\b)')),
(SELECT *, 'bower' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbower\b)')),
(SELECT *, 'ionic' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bionic\b)')),
(SELECT *, 'next' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnext\b)')),
(SELECT *, 'grunt' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgrunt\b)')),
(SELECT *, 'gulp' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgulp\b)')),
(SELECT *, 'webpack' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack\b)')),
(SELECT *, 'browserify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbrowserify\b)')),
(SELECT *, 'ng' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bng\b)')),
(SELECT *, 'tsc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btsc\b)')),
(SELECT *, 'react-scripts' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-scripts\b)')),
(SELECT *, 'react-native' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-native\b)')),
(SELECT *, 'ember' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bember\b)')),
(SELECT *, 'electron' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\belectron\b)')),
(SELECT *, 'meteor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmeteor\b)')),
(SELECT *, 'karma' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bkarma\b)')),
(SELECT *, 'protractor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bprotractor\b)')),
(SELECT *, 'nyc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnyc\b)')),
(SELECT *, 'coveralls' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoveralls\b)')),
(SELECT *, 'lcovonly' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blcovonly\b)')),
(SELECT *, 'typings' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btypings\b)')),
(SELECT *, 'jscs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjscs\b)')),
(SELECT *, 'less' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bless\b)')),
(SELECT *, 'sass' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsass\b)')),
(SELECT *, 'tap' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btap\b)')),
(SELECT *, 'semantic-release' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemantic-release\b)')),
(SELECT *, 'docker' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocker\b)')),
(SELECT *, 'coffee' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoffee\b)')),
(SELECT *, 'babelify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabelify\b)')),
(SELECT *, 'lite-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blite-server\b)')),
(SELECT *, 'flow' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bflow\b)')),
(SELECT *, 'nodeunit' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodeunit\b)')),
(SELECT *, 'lab' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blab\b)')),
(SELECT *, 'lerna' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blerna\b)')),
(SELECT *, 'stylelint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstylelint\b)')),
(SELECT *, 'travis' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btravis\b)')),
(SELECT *, 'compodoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcompodoc\b)')),
(SELECT *, 'rm' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brm\b)')),
(SELECT *, 'cross-env' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcross-env\b)')),
(SELECT *, 'find' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bfind\b)')),
(SELECT *, 'shjs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bshjs\b)')),
(SELECT *, 'nightwatch' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnightwatch\b)')),
(SELECT *, 'source-map-explorer' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsource-map-explorer\b)')),
(SELECT *, 'webpack-dev-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack-dev-server\b)')),
where taskName = 'test'
group by taskType
) as scripts
JOIN [types] as types
ON scripts.taskType = types.taskType
ORDER BY percent DESC
SELECT task, (count(distinct projectID) / 107646 * 100) as percent
FROM [scripts]
WHERE taskName = 'start'
GROUP BY task
ORDER BY percent DESC
SELECT scripts.taskType as taskType, scripts.percent as percent, types.group as type
FROM (
SELECT taskType, (count(distinct projectID) / 107646 * 100) as percent
FROM
(SELECT *, 'nodemon' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodemon\b)')),
(SELECT *, 'pm2' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bpm2\b)')),
(SELECT *, 'istanbul' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bistanbul\b)')),
(SELECT *, 'jsdoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjsdoc\b)')),
(SELECT *, 'documentation' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocumentation\b)')),
(SELECT *, 'make' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmake\b)')),
(SELECT *, 'semistandard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemistandard\b)')),
(SELECT *, 'eslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\beslint\b)')),
(SELECT *, 'standard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstandard\b)')),
(SELECT *, 'tslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btslint\b)')),
(SELECT *, 'jshint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjshint\b)')),
(SELECT *, 'xo' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bxo\b)')),
(SELECT *, 'jasmine' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjasmine\b)')),
(SELECT *, 'jest' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjest\b)')),
(SELECT *, 'ava' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bava\b)')),
(SELECT *, '.sh' as taskType FROM [scripts] where REGEXP_MATCH(task, r'\.sh')),
(SELECT *, 'mocha' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmocha\b)')),
(SELECT *, 'cake' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcake\b)')),
(SELECT *, 'babel' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabel\b)')),
(SELECT *, 'rollup' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brollup\b)')),
(SELECT *, 'bower' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbower\b)')),
(SELECT *, 'ionic' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bionic\b)')),
(SELECT *, 'next' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnext\b)')),
(SELECT *, 'grunt' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgrunt\b)')),
(SELECT *, 'gulp' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgulp\b)')),
(SELECT *, 'webpack' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack\b)')),
(SELECT *, 'browserify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbrowserify\b)')),
(SELECT *, 'ng' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bng\b)')),
(SELECT *, 'tsc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btsc\b)')),
(SELECT *, 'react-scripts' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-scripts\b)')),
(SELECT *, 'react-native' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-native\b)')),
(SELECT *, 'ember' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bember\b)')),
(SELECT *, 'electron' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\belectron\b)')),
(SELECT *, 'meteor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmeteor\b)')),
(SELECT *, 'karma' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bkarma\b)')),
(SELECT *, 'protractor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bprotractor\b)')),
(SELECT *, 'nyc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnyc\b)')),
(SELECT *, 'coveralls' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoveralls\b)')),
(SELECT *, 'lcovonly' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blcovonly\b)')),
(SELECT *, 'typings' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btypings\b)')),
(SELECT *, 'jscs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjscs\b)')),
(SELECT *, 'less' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bless\b)')),
(SELECT *, 'sass' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsass\b)')),
(SELECT *, 'tap' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btap\b)')),
(SELECT *, 'semantic-release' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemantic-release\b)')),
(SELECT *, 'docker' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocker\b)')),
(SELECT *, 'coffee' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoffee\b)')),
(SELECT *, 'babelify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabelify\b)')),
(SELECT *, 'lite-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blite-server\b)')),
(SELECT *, 'flow' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bflow\b)')),
(SELECT *, 'nodeunit' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodeunit\b)')),
(SELECT *, 'lab' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blab\b)')),
(SELECT *, 'lerna' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blerna\b)')),
(SELECT *, 'stylelint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstylelint\b)')),
(SELECT *, 'travis' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btravis\b)')),
(SELECT *, 'compodoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcompodoc\b)')),
(SELECT *, 'rm' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brm\b)')),
(SELECT *, 'cross-env' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcross-env\b)')),
(SELECT *, 'find' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bfind\b)')),
(SELECT *, 'shjs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bshjs\b)')),
(SELECT *, 'nightwatch' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnightwatch\b)')),
(SELECT *, 'source-map-explorer' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsource-map-explorer\b)')),
(SELECT *, 'webpack-dev-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack-dev-server\b)')),
where taskName = 'start'
group by taskType
) as scripts
JOIN [types] as types
ON scripts.taskType = types.taskType
ORDER BY percent DESC
SELECT task, (count(distinct projectID) / 65794 * 100) as percent
FROM [scripts]
WHERE taskName = 'build'
GROUP BY task
ORDER BY percent DESC
SELECT scripts.taskType as taskType, scripts.percent as percent, types.group as type
FROM (
SELECT taskType, (count(distinct projectID) / 65794 * 100) as percent
FROM
(SELECT *, 'nodemon' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodemon\b)')),
(SELECT *, 'pm2' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bpm2\b)')),
(SELECT *, 'istanbul' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bistanbul\b)')),
(SELECT *, 'jsdoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjsdoc\b)')),
(SELECT *, 'documentation' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocumentation\b)')),
(SELECT *, 'make' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmake\b)')),
(SELECT *, 'semistandard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemistandard\b)')),
(SELECT *, 'eslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\beslint\b)')),
(SELECT *, 'standard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstandard\b)')),
(SELECT *, 'tslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btslint\b)')),
(SELECT *, 'jshint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjshint\b)')),
(SELECT *, 'xo' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bxo\b)')),
(SELECT *, 'jasmine' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjasmine\b)')),
(SELECT *, 'jest' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjest\b)')),
(SELECT *, 'ava' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bava\b)')),
(SELECT *, '.sh' as taskType FROM [scripts] where REGEXP_MATCH(task, r'\.sh')),
(SELECT *, 'mocha' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmocha\b)')),
(SELECT *, 'cake' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcake\b)')),
(SELECT *, 'babel' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabel\b)')),
(SELECT *, 'rollup' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brollup\b)')),
(SELECT *, 'bower' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbower\b)')),
(SELECT *, 'ionic' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bionic\b)')),
(SELECT *, 'next' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnext\b)')),
(SELECT *, 'grunt' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgrunt\b)')),
(SELECT *, 'gulp' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgulp\b)')),
(SELECT *, 'webpack' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack\b)')),
(SELECT *, 'browserify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbrowserify\b)')),
(SELECT *, 'ng' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bng\b)')),
(SELECT *, 'tsc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btsc\b)')),
(SELECT *, 'react-scripts' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-scripts\b)')),
(SELECT *, 'react-native' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-native\b)')),
(SELECT *, 'ember' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bember\b)')),
(SELECT *, 'electron' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\belectron\b)')),
(SELECT *, 'meteor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmeteor\b)')),
(SELECT *, 'karma' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bkarma\b)')),
(SELECT *, 'protractor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bprotractor\b)')),
(SELECT *, 'nyc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnyc\b)')),
(SELECT *, 'coveralls' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoveralls\b)')),
(SELECT *, 'lcovonly' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blcovonly\b)')),
(SELECT *, 'typings' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btypings\b)')),
(SELECT *, 'jscs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjscs\b)')),
(SELECT *, 'less' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bless\b)')),
(SELECT *, 'sass' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsass\b)')),
(SELECT *, 'tap' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btap\b)')),
(SELECT *, 'semantic-release' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemantic-release\b)')),
(SELECT *, 'docker' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocker\b)')),
(SELECT *, 'coffee' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoffee\b)')),
(SELECT *, 'babelify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabelify\b)')),
(SELECT *, 'lite-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blite-server\b)')),
(SELECT *, 'flow' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bflow\b)')),
(SELECT *, 'nodeunit' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodeunit\b)')),
(SELECT *, 'lab' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blab\b)')),
(SELECT *, 'lerna' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blerna\b)')),
(SELECT *, 'stylelint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstylelint\b)')),
(SELECT *, 'travis' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btravis\b)')),
(SELECT *, 'compodoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcompodoc\b)')),
(SELECT *, 'rm' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brm\b)')),
(SELECT *, 'cross-env' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcross-env\b)')),
(SELECT *, 'find' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bfind\b)')),
(SELECT *, 'shjs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bshjs\b)')),
(SELECT *, 'nightwatch' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnightwatch\b)')),
(SELECT *, 'source-map-explorer' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsource-map-explorer\b)')),
(SELECT *, 'webpack-dev-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack-dev-server\b)')),
where taskName = 'build'
group by taskType
) as scripts
JOIN [types] as types
ON scripts.taskType = types.taskType
ORDER BY percent DESC
SELECT build.taskType as taskType, build.percent as build, start.percent as start, build.type as type
FROM (
SELECT scripts.taskType as taskType, scripts.percent as percent, types.group as type
FROM (
SELECT taskType, (count(distinct projectID) / 65794 * 100) as percent
FROM
(SELECT *, 'nodemon' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodemon\b)')),
(SELECT *, 'pm2' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bpm2\b)')),
(SELECT *, 'istanbul' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bistanbul\b)')),
(SELECT *, 'jsdoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjsdoc\b)')),
(SELECT *, 'documentation' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocumentation\b)')),
(SELECT *, 'make' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmake\b)')),
(SELECT *, 'semistandard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemistandard\b)')),
(SELECT *, 'eslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\beslint\b)')),
(SELECT *, 'standard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstandard\b)')),
(SELECT *, 'tslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btslint\b)')),
(SELECT *, 'jshint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjshint\b)')),
(SELECT *, 'xo' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bxo\b)')),
(SELECT *, 'jasmine' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjasmine\b)')),
(SELECT *, 'jest' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjest\b)')),
(SELECT *, 'ava' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bava\b)')),
(SELECT *, '.sh' as taskType FROM [scripts] where REGEXP_MATCH(task, r'\.sh')),
(SELECT *, 'mocha' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmocha\b)')),
(SELECT *, 'cake' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcake\b)')),
(SELECT *, 'babel' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabel\b)')),
(SELECT *, 'rollup' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brollup\b)')),
(SELECT *, 'bower' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbower\b)')),
(SELECT *, 'ionic' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bionic\b)')),
(SELECT *, 'next' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnext\b)')),
(SELECT *, 'grunt' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgrunt\b)')),
(SELECT *, 'gulp' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgulp\b)')),
(SELECT *, 'webpack' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack\b)')),
(SELECT *, 'browserify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbrowserify\b)')),
(SELECT *, 'ng' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bng\b)')),
(SELECT *, 'tsc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btsc\b)')),
(SELECT *, 'react-scripts' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-scripts\b)')),
(SELECT *, 'react-native' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-native\b)')),
(SELECT *, 'ember' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bember\b)')),
(SELECT *, 'electron' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\belectron\b)')),
(SELECT *, 'meteor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmeteor\b)')),
(SELECT *, 'karma' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bkarma\b)')),
(SELECT *, 'protractor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bprotractor\b)')),
(SELECT *, 'nyc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnyc\b)')),
(SELECT *, 'coveralls' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoveralls\b)')),
(SELECT *, 'lcovonly' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blcovonly\b)')),
(SELECT *, 'typings' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btypings\b)')),
(SELECT *, 'jscs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjscs\b)')),
(SELECT *, 'less' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bless\b)')),
(SELECT *, 'sass' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsass\b)')),
(SELECT *, 'tap' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btap\b)')),
(SELECT *, 'semantic-release' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemantic-release\b)')),
(SELECT *, 'docker' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocker\b)')),
(SELECT *, 'coffee' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoffee\b)')),
(SELECT *, 'babelify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabelify\b)')),
(SELECT *, 'lite-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blite-server\b)')),
(SELECT *, 'flow' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bflow\b)')),
(SELECT *, 'nodeunit' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodeunit\b)')),
(SELECT *, 'lab' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blab\b)')),
(SELECT *, 'lerna' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blerna\b)')),
(SELECT *, 'stylelint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstylelint\b)')),
(SELECT *, 'travis' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btravis\b)')),
(SELECT *, 'compodoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcompodoc\b)')),
(SELECT *, 'rm' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brm\b)')),
(SELECT *, 'cross-env' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcross-env\b)')),
(SELECT *, 'find' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bfind\b)')),
(SELECT *, 'shjs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bshjs\b)')),
(SELECT *, 'nightwatch' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnightwatch\b)')),
(SELECT *, 'source-map-explorer' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsource-map-explorer\b)')),
(SELECT *, 'webpack-dev-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack-dev-server\b)')),
where taskName = 'build'
group by taskType
) as scripts
JOIN [types] as types
ON scripts.taskType = types.taskType
ORDER BY percent DESC
) as build
JOIN (SELECT taskType, (count(distinct projectID) / 107646 * 100) as percent
FROM
(SELECT *, 'nodemon' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodemon\b)')),
(SELECT *, 'pm2' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bpm2\b)')),
(SELECT *, 'istanbul' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bistanbul\b)')),
(SELECT *, 'jsdoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjsdoc\b)')),
(SELECT *, 'documentation' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocumentation\b)')),
(SELECT *, 'make' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmake\b)')),
(SELECT *, 'semistandard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemistandard\b)')),
(SELECT *, 'eslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\beslint\b)')),
(SELECT *, 'standard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstandard\b)')),
(SELECT *, 'tslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btslint\b)')),
(SELECT *, 'jshint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjshint\b)')),
(SELECT *, 'xo' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bxo\b)')),
(SELECT *, 'jasmine' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjasmine\b)')),
(SELECT *, 'jest' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjest\b)')),
(SELECT *, 'ava' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bava\b)')),
(SELECT *, '.sh' as taskType FROM [scripts] where REGEXP_MATCH(task, r'\.sh')),
(SELECT *, 'mocha' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmocha\b)')),
(SELECT *, 'cake' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcake\b)')),
(SELECT *, 'babel' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabel\b)')),
(SELECT *, 'rollup' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brollup\b)')),
(SELECT *, 'bower' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbower\b)')),
(SELECT *, 'ionic' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bionic\b)')),
(SELECT *, 'next' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnext\b)')),
(SELECT *, 'grunt' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgrunt\b)')),
(SELECT *, 'gulp' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgulp\b)')),
(SELECT *, 'webpack' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack\b)')),
(SELECT *, 'browserify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbrowserify\b)')),
(SELECT *, 'ng' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bng\b)')),
(SELECT *, 'tsc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btsc\b)')),
(SELECT *, 'react-scripts' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-scripts\b)')),
(SELECT *, 'react-native' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-native\b)')),
(SELECT *, 'ember' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bember\b)')),
(SELECT *, 'electron' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\belectron\b)')),
(SELECT *, 'meteor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmeteor\b)')),
(SELECT *, 'karma' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bkarma\b)')),
(SELECT *, 'protractor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bprotractor\b)')),
(SELECT *, 'nyc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnyc\b)')),
(SELECT *, 'coveralls' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoveralls\b)')),
(SELECT *, 'lcovonly' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blcovonly\b)')),
(SELECT *, 'typings' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btypings\b)')),
(SELECT *, 'jscs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjscs\b)')),
(SELECT *, 'less' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bless\b)')),
(SELECT *, 'sass' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsass\b)')),
(SELECT *, 'tap' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btap\b)')),
(SELECT *, 'semantic-release' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemantic-release\b)')),
(SELECT *, 'docker' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocker\b)')),
(SELECT *, 'coffee' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoffee\b)')),
(SELECT *, 'babelify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabelify\b)')),
(SELECT *, 'lite-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blite-server\b)')),
(SELECT *, 'flow' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bflow\b)')),
(SELECT *, 'nodeunit' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodeunit\b)')),
(SELECT *, 'lab' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blab\b)')),
(SELECT *, 'lerna' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blerna\b)')),
(SELECT *, 'stylelint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstylelint\b)')),
(SELECT *, 'travis' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btravis\b)')),
(SELECT *, 'compodoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcompodoc\b)')),
(SELECT *, 'rm' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brm\b)')),
(SELECT *, 'cross-env' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcross-env\b)')),
(SELECT *, 'find' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bfind\b)')),
(SELECT *, 'shjs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bshjs\b)')),
(SELECT *, 'nightwatch' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnightwatch\b)')),
(SELECT *, 'source-map-explorer' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsource-map-explorer\b)')),
(SELECT *, 'webpack-dev-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack-dev-server\b)')),
where taskName = 'start'
group by taskType
) as start
ON start.taskType = build.taskType
SELECT dev.taskType as taskType, dev.percent as dev, start.percent as start, dev.type as type
FROM (
SELECT scripts.taskType as taskType, scripts.percent as percent, types.group as type
FROM (
SELECT taskType, (count(distinct projectID) / 15868 * 100) as percent
FROM
(SELECT *, 'nodemon' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodemon\b)')),
(SELECT *, 'pm2' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bpm2\b)')),
(SELECT *, 'istanbul' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bistanbul\b)')),
(SELECT *, 'jsdoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjsdoc\b)')),
(SELECT *, 'documentation' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocumentation\b)')),
(SELECT *, 'make' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmake\b)')),
(SELECT *, 'semistandard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemistandard\b)')),
(SELECT *, 'eslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\beslint\b)')),
(SELECT *, 'standard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstandard\b)')),
(SELECT *, 'tslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btslint\b)')),
(SELECT *, 'jshint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjshint\b)')),
(SELECT *, 'xo' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bxo\b)')),
(SELECT *, 'jasmine' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjasmine\b)')),
(SELECT *, 'jest' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjest\b)')),
(SELECT *, 'ava' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bava\b)')),
(SELECT *, '.sh' as taskType FROM [scripts] where REGEXP_MATCH(task, r'\.sh')),
(SELECT *, 'mocha' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmocha\b)')),
(SELECT *, 'cake' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcake\b)')),
(SELECT *, 'babel' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabel\b)')),
(SELECT *, 'rollup' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brollup\b)')),
(SELECT *, 'bower' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbower\b)')),
(SELECT *, 'ionic' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bionic\b)')),
(SELECT *, 'next' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnext\b)')),
(SELECT *, 'grunt' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgrunt\b)')),
(SELECT *, 'gulp' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgulp\b)')),
(SELECT *, 'webpack' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack\b)')),
(SELECT *, 'browserify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbrowserify\b)')),
(SELECT *, 'ng' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bng\b)')),
(SELECT *, 'tsc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btsc\b)')),
(SELECT *, 'react-scripts' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-scripts\b)')),
(SELECT *, 'react-native' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-native\b)')),
(SELECT *, 'ember' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bember\b)')),
(SELECT *, 'electron' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\belectron\b)')),
(SELECT *, 'meteor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmeteor\b)')),
(SELECT *, 'karma' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bkarma\b)')),
(SELECT *, 'protractor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bprotractor\b)')),
(SELECT *, 'nyc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnyc\b)')),
(SELECT *, 'coveralls' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoveralls\b)')),
(SELECT *, 'lcovonly' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blcovonly\b)')),
(SELECT *, 'typings' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btypings\b)')),
(SELECT *, 'jscs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjscs\b)')),
(SELECT *, 'less' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bless\b)')),
(SELECT *, 'sass' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsass\b)')),
(SELECT *, 'tap' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btap\b)')),
(SELECT *, 'semantic-release' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemantic-release\b)')),
(SELECT *, 'docker' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocker\b)')),
(SELECT *, 'coffee' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoffee\b)')),
(SELECT *, 'babelify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabelify\b)')),
(SELECT *, 'lite-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blite-server\b)')),
(SELECT *, 'flow' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bflow\b)')),
(SELECT *, 'nodeunit' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodeunit\b)')),
(SELECT *, 'lab' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blab\b)')),
(SELECT *, 'lerna' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blerna\b)')),
(SELECT *, 'stylelint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstylelint\b)')),
(SELECT *, 'travis' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btravis\b)')),
(SELECT *, 'compodoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcompodoc\b)')),
(SELECT *, 'rm' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brm\b)')),
(SELECT *, 'cross-env' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcross-env\b)')),
(SELECT *, 'find' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bfind\b)')),
(SELECT *, 'shjs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bshjs\b)')),
(SELECT *, 'nightwatch' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnightwatch\b)')),
(SELECT *, 'source-map-explorer' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsource-map-explorer\b)')),
(SELECT *, 'webpack-dev-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack-dev-server\b)')),
where taskName = 'dev'
group by taskType
) as scripts
JOIN [types] as types
ON scripts.taskType = types.taskType
ORDER BY percent DESC
) as dev
JOIN (SELECT taskType, (count(distinct projectID) / 107646 * 100) as percent
FROM
(SELECT *, 'nodemon' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodemon\b)')),
(SELECT *, 'pm2' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bpm2\b)')),
(SELECT *, 'istanbul' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bistanbul\b)')),
(SELECT *, 'jsdoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjsdoc\b)')),
(SELECT *, 'documentation' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocumentation\b)')),
(SELECT *, 'make' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmake\b)')),
(SELECT *, 'semistandard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemistandard\b)')),
(SELECT *, 'eslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\beslint\b)')),
(SELECT *, 'standard' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstandard\b)')),
(SELECT *, 'tslint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btslint\b)')),
(SELECT *, 'jshint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjshint\b)')),
(SELECT *, 'xo' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bxo\b)')),
(SELECT *, 'jasmine' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjasmine\b)')),
(SELECT *, 'jest' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjest\b)')),
(SELECT *, 'ava' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bava\b)')),
(SELECT *, '.sh' as taskType FROM [scripts] where REGEXP_MATCH(task, r'\.sh')),
(SELECT *, 'mocha' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmocha\b)')),
(SELECT *, 'cake' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcake\b)')),
(SELECT *, 'babel' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabel\b)')),
(SELECT *, 'rollup' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brollup\b)')),
(SELECT *, 'bower' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbower\b)')),
(SELECT *, 'ionic' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bionic\b)')),
(SELECT *, 'next' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnext\b)')),
(SELECT *, 'grunt' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgrunt\b)')),
(SELECT *, 'gulp' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bgulp\b)')),
(SELECT *, 'webpack' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack\b)')),
(SELECT *, 'browserify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbrowserify\b)')),
(SELECT *, 'ng' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bng\b)')),
(SELECT *, 'tsc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btsc\b)')),
(SELECT *, 'react-scripts' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-scripts\b)')),
(SELECT *, 'react-native' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\breact-native\b)')),
(SELECT *, 'ember' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bember\b)')),
(SELECT *, 'electron' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\belectron\b)')),
(SELECT *, 'meteor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bmeteor\b)')),
(SELECT *, 'karma' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bkarma\b)')),
(SELECT *, 'protractor' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bprotractor\b)')),
(SELECT *, 'nyc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnyc\b)')),
(SELECT *, 'coveralls' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoveralls\b)')),
(SELECT *, 'lcovonly' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blcovonly\b)')),
(SELECT *, 'typings' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btypings\b)')),
(SELECT *, 'jscs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bjscs\b)')),
(SELECT *, 'less' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bless\b)')),
(SELECT *, 'sass' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsass\b)')),
(SELECT *, 'tap' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btap\b)')),
(SELECT *, 'semantic-release' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsemantic-release\b)')),
(SELECT *, 'docker' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bdocker\b)')),
(SELECT *, 'coffee' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcoffee\b)')),
(SELECT *, 'babelify' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bbabelify\b)')),
(SELECT *, 'lite-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blite-server\b)')),
(SELECT *, 'flow' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bflow\b)')),
(SELECT *, 'nodeunit' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnodeunit\b)')),
(SELECT *, 'lab' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blab\b)')),
(SELECT *, 'lerna' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\blerna\b)')),
(SELECT *, 'stylelint' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bstylelint\b)')),
(SELECT *, 'travis' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\btravis\b)')),
(SELECT *, 'compodoc' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcompodoc\b)')),
(SELECT *, 'rm' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\brm\b)')),
(SELECT *, 'cross-env' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bcross-env\b)')),
(SELECT *, 'find' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bfind\b)')),
(SELECT *, 'shjs' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bshjs\b)')),
(SELECT *, 'nightwatch' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bnightwatch\b)')),
(SELECT *, 'source-map-explorer' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bsource-map-explorer\b)')),
(SELECT *, 'webpack-dev-server' as taskType FROM [scripts] where REGEXP_MATCH(task, r'(\bwebpack-dev-server\b)')),
where taskName = 'start'
group by taskType
) as start
ON start.taskType = build.taskType