Removed stats.txt functionality as it doesn't add much.
parent
06d4002c6b
commit
720b7a3e3f
39
Gruntfile.js
39
Gruntfile.js
|
@ -26,19 +26,15 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
grunt.registerTask("prod",
|
grunt.registerTask("prod",
|
||||||
"Creates a production-ready build. Use the --msg flag to add a compile message.",
|
"Creates a production-ready build. Use the --msg flag to add a compile message.",
|
||||||
["eslint", "test", "clean:prod", "clean:docs", "jsdoc", "exec:stats", "webpack:webProd", "inline", "chmod"]);
|
["eslint", "test", "clean:prod", "clean:docs", "jsdoc", "webpack:webProd", "inline", "chmod"]);
|
||||||
|
|
||||||
grunt.registerTask("stats",
|
|
||||||
"Provides statistics about the code base such as how many lines there are as well as details of file sizes before and after compression.",
|
|
||||||
["webpack:webDev", "webpack:webProd", "exec:stats", "exec:repoSize", "exec:displayStats"]);
|
|
||||||
|
|
||||||
grunt.registerTask("release",
|
grunt.registerTask("release",
|
||||||
"Prepares and deploys a production version of CyberChef to the gh-pages branch.",
|
"Prepares and deploys a production version of CyberChef to the gh-pages branch.",
|
||||||
["copy:ghPages", "exec:deployGhPages"]);
|
["copy:ghPages", "exec:deployGhPages"]);
|
||||||
|
|
||||||
grunt.registerTask("default",
|
grunt.registerTask("default",
|
||||||
"Lints the code base and shows stats",
|
"Lints the code base",
|
||||||
["eslint", "exec:stats", "exec:displayStats"]);
|
["eslint", "exec:repoSize"]);
|
||||||
|
|
||||||
grunt.registerTask("inline",
|
grunt.registerTask("inline",
|
||||||
"Compiles a production build of CyberChef into a single, portable web page.",
|
"Compiles a production build of CyberChef into a single, portable web page.",
|
||||||
|
@ -62,7 +58,6 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
// Project configuration
|
// Project configuration
|
||||||
var compileTime = grunt.template.today("dd/mm/yyyy HH:MM:ss") + " UTC",
|
var compileTime = grunt.template.today("dd/mm/yyyy HH:MM:ss") + " UTC",
|
||||||
codebaseStats = grunt.file.read("src/web/static/stats.txt").split("\n").join("<br>"),
|
|
||||||
banner = "/**\n" +
|
banner = "/**\n" +
|
||||||
"* CyberChef - The Cyber Swiss Army Knife\n" +
|
"* CyberChef - The Cyber Swiss Army Knife\n" +
|
||||||
"*\n" +
|
"*\n" +
|
||||||
|
@ -228,8 +223,7 @@ module.exports = function (grunt) {
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
filename: "index.html",
|
filename: "index.html",
|
||||||
template: "./src/web/html/index.html",
|
template: "./src/web/html/index.html",
|
||||||
compileTime: compileTime,
|
compileTime: compileTime
|
||||||
codebaseStats: codebaseStats
|
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
watch: true
|
watch: true
|
||||||
|
@ -255,7 +249,6 @@ module.exports = function (grunt) {
|
||||||
filename: "index.html",
|
filename: "index.html",
|
||||||
template: "./src/web/html/index.html",
|
template: "./src/web/html/index.html",
|
||||||
compileTime: compileTime,
|
compileTime: compileTime,
|
||||||
codebaseStats: codebaseStats,
|
|
||||||
minify: {
|
minify: {
|
||||||
removeComments: true,
|
removeComments: true,
|
||||||
collapseWhitespace: true,
|
collapseWhitespace: true,
|
||||||
|
@ -267,7 +260,6 @@ module.exports = function (grunt) {
|
||||||
filename: "cyberchef.htm",
|
filename: "cyberchef.htm",
|
||||||
template: "./src/web/html/index.html",
|
template: "./src/web/html/index.html",
|
||||||
compileTime: compileTime,
|
compileTime: compileTime,
|
||||||
codebaseStats: codebaseStats,
|
|
||||||
inline: true,
|
inline: true,
|
||||||
minify: {
|
minify: {
|
||||||
removeComments: true,
|
removeComments: true,
|
||||||
|
@ -333,29 +325,6 @@ module.exports = function (grunt) {
|
||||||
].join(";"),
|
].join(";"),
|
||||||
stderr: false
|
stderr: false
|
||||||
},
|
},
|
||||||
stats: {
|
|
||||||
command: "rm src/web/static/stats.txt;" +
|
|
||||||
[
|
|
||||||
"ls src/ -R1 | grep '^$' -v | grep ':$' -v | wc -l | xargs printf '%b\tsource files\n'",
|
|
||||||
"find src/ -regex '.*\..*' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'",
|
|
||||||
"du -hs src/ | pcregrep -o '^[^\t]*' | xargs printf '%b\tsize\n'",
|
|
||||||
|
|
||||||
"find src/ -regex '.*\.js' -not -regex '.*/lib/.*' -print | wc -l | xargs printf '\n%b\tJavaScript source files\n'",
|
|
||||||
"find src/ -regex '.*\.js' -not -regex '.*/lib/.*' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'",
|
|
||||||
"find src/ -regex '.*\.js' -not -regex '.*/lib/.*' -exec du -hcs {} \+ | tail -n1 | egrep -o '^[^\t]*' | xargs printf '%b\tsize\n'",
|
|
||||||
|
|
||||||
"du build/dev/scripts.js -h | egrep -o '^[^\t]*' | xargs printf '\n%b\tuncompressed JavaScript size\n'",
|
|
||||||
"du build/prod/scripts.js -h | egrep -o '^[^\t]*' | xargs printf '%b\tcompressed JavaScript size\n'",
|
|
||||||
|
|
||||||
"grep -E '^\\s+name: ' src/core/config/Categories.js | wc -l | xargs printf '\n%b\tcategories\n'",
|
|
||||||
"grep -E '^\\s+\"[A-Za-z0-9 \\-]+\": {' src/core/config/OperationConfig.js | wc -l | xargs printf '%b\toperations\n'",
|
|
||||||
|
|
||||||
].join(" >> src/web/static/stats.txt;") + " >> src/web/static/stats.txt;",
|
|
||||||
stderr: false
|
|
||||||
},
|
|
||||||
displayStats: {
|
|
||||||
command: "cat src/web/static/stats.txt"
|
|
||||||
},
|
|
||||||
cleanGit: {
|
cleanGit: {
|
||||||
command: "git gc --prune=now --aggressive"
|
command: "git gc --prune=now --aggressive"
|
||||||
},
|
},
|
||||||
|
|
|
@ -292,10 +292,6 @@
|
||||||
<img src="<%- require('../static/images/bug-16x16.png') %>" />
|
<img src="<%- require('../static/images/bug-16x16.png') %>" />
|
||||||
Report a bug
|
Report a bug
|
||||||
</a></li>
|
</a></li>
|
||||||
<li role="presentation"><a href="#stats" aria-controls="messages" role="tab" data-toggle="tab">
|
|
||||||
<img src="<%- require('../static/images/stats-16x16.png') %>" />
|
|
||||||
Stats
|
|
||||||
</a></li>
|
|
||||||
<li role="presentation"><a href="#about" aria-controls="messages" role="tab" data-toggle="tab">
|
<li role="presentation"><a href="#about" aria-controls="messages" role="tab" data-toggle="tab">
|
||||||
<img src="<%- require('../static/images/speech-16x16.png') %>" />
|
<img src="<%- require('../static/images/speech-16x16.png') %>" />
|
||||||
About
|
About
|
||||||
|
@ -348,11 +344,6 @@
|
||||||
<br>
|
<br>
|
||||||
<a class="btn btn-primary" href="https://github.com/gchq/CyberChef/issues/new" role="button">Raise issue on GitHub</a>
|
<a class="btn btn-primary" href="https://github.com/gchq/CyberChef/issues/new" role="button">Raise issue on GitHub</a>
|
||||||
</div>
|
</div>
|
||||||
<div role="tabpanel" class="tab-pane" id="stats">
|
|
||||||
<br>
|
|
||||||
<p>If you're a nerd like me, you might find statistics really fun! Here's some about the CyberChef code base:</p>
|
|
||||||
<br><pre><%= htmlWebpackPlugin.options.codebaseStats %></pre>
|
|
||||||
</div>
|
|
||||||
<div role="tabpanel" class="tab-pane" id="about" style="padding: 20px;">
|
<div role="tabpanel" class="tab-pane" id="about" style="padding: 20px;">
|
||||||
<h4>What</h4>
|
<h4>What</h4>
|
||||||
<p>A simple, intuitive web app for analysing and decoding data without having to deal with complex tools or programming languages. CyberChef encourages both technical and non-technical people to explore data formats, encryption and compression.</p>
|
<p>A simple, intuitive web app for analysing and decoding data without having to deal with complex tools or programming languages. CyberChef encourages both technical and non-technical people to explore data formats, encryption and compression.</p>
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
129 source files
|
|
||||||
49199 lines
|
|
||||||
1.9M size
|
|
||||||
|
|
||||||
63 JavaScript source files
|
|
||||||
21016 lines
|
|
||||||
788K size
|
|
||||||
|
|
||||||
4.7M uncompressed JavaScript size
|
|
||||||
compressed JavaScript size
|
|
||||||
|
|
||||||
15 categories
|
|
||||||
177 operations
|
|
Loading…
Reference in New Issue