Przeglądaj źródła

Removed stats.txt functionality as it doesn't add much.

n1474335 8 lat temu
rodzic
commit
720b7a3e3f
3 zmienionych plików z 4 dodań i 57 usunięć
  1. 4 35
      Gruntfile.js
  2. 0 9
      src/web/html/index.html
  3. 0 13
      src/web/static/stats.txt

+ 4 - 35
Gruntfile.js

@@ -26,19 +26,15 @@ module.exports = function (grunt) {
 
     grunt.registerTask("prod",
         "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"]);
-
-    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"]);
+        ["eslint", "test", "clean:prod", "clean:docs", "jsdoc", "webpack:webProd", "inline", "chmod"]);
 
     grunt.registerTask("release",
         "Prepares and deploys a production version of CyberChef to the gh-pages branch.",
         ["copy:ghPages", "exec:deployGhPages"]);
 
     grunt.registerTask("default",
-        "Lints the code base and shows stats",
-        ["eslint", "exec:stats", "exec:displayStats"]);
+        "Lints the code base",
+        ["eslint", "exec:repoSize"]);
 
     grunt.registerTask("inline",
         "Compiles a production build of CyberChef into a single, portable web page.",
@@ -62,7 +58,6 @@ module.exports = function (grunt) {
 
     // Project configuration
     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" +
             "* CyberChef - The Cyber Swiss Army Knife\n" +
             "*\n" +
@@ -228,8 +223,7 @@ module.exports = function (grunt) {
                     new HtmlWebpackPlugin({
                         filename: "index.html",
                         template: "./src/web/html/index.html",
-                        compileTime: compileTime,
-                        codebaseStats: codebaseStats
+                        compileTime: compileTime
                     })
                 ],
                 watch: true
@@ -255,7 +249,6 @@ module.exports = function (grunt) {
                         filename: "index.html",
                         template: "./src/web/html/index.html",
                         compileTime: compileTime,
-                        codebaseStats: codebaseStats,
                         minify: {
                             removeComments: true,
                             collapseWhitespace: true,
@@ -267,7 +260,6 @@ module.exports = function (grunt) {
                         filename: "cyberchef.htm",
                         template: "./src/web/html/index.html",
                         compileTime: compileTime,
-                        codebaseStats: codebaseStats,
                         inline: true,
                         minify: {
                             removeComments: true,
@@ -333,29 +325,6 @@ module.exports = function (grunt) {
                 ].join(";"),
                 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: {
                 command: "git gc --prune=now --aggressive"
             },

+ 0 - 9
src/web/html/index.html

@@ -292,10 +292,6 @@
                                     <img src="<%- require('../static/images/bug-16x16.png') %>" />
                                     Report a bug
                                 </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">
                                     <img src="<%- require('../static/images/speech-16x16.png') %>" />
                                     About
@@ -348,11 +344,6 @@
                                     <br>
                                     <a class="btn btn-primary" href="https://github.com/gchq/CyberChef/issues/new" role="button">Raise issue on GitHub</a>
                                 </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;">
                                     <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>

+ 0 - 13
src/web/static/stats.txt

@@ -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