]>
Commit | Line | Data |
---|---|---|
1 | <!DOCTYPE html> | |
2 | <html lang="en"> | |
3 | <head> | |
4 | <meta charset="utf-8"> | |
5 | <title></title> | |
6 | ||
7 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
8 | <meta name="description" content=""> | |
9 | <meta name="author" content=""> | |
10 | ||
11 | <!--[if lt IE 9]> | |
12 | <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | |
13 | <![endif]--> | |
14 | ||
15 | <link href="../../assets/css/vendor/morris.css" rel="stylesheet"> | |
16 | <link href="../../assets/css/vendor/bootstrap.css" rel="stylesheet"> | |
17 | <link href="../../assets/css/vendor/font-awesome.css" rel="stylesheet"> | |
18 | <link href="../../assets/css/vendor/font-awesome-ie7.css" rel="stylesheet"> | |
19 | <link href="../../assets/css/vendor/codemirror.css" rel="stylesheet"> | |
20 | <link href="../../assets/css/plato.css" rel="stylesheet"> | |
21 | <link href="../../assets/css/plato-file.css" rel="stylesheet"> | |
22 | ||
23 | </head> | |
24 | ||
25 | <body> | |
26 | ||
27 | <div class="navbar navbar-fixed-top"> | |
28 | <div class="container"> | |
29 | <a class="navbar-brand" href="http://github.com/jsoverson/plato">Plato on Github</a> | |
30 | <ul class="nav navbar-nav"> | |
31 | <li> | |
32 | <a href="../../index.html">Report Home</a> | |
33 | </li> | |
34 | </ul> | |
35 | </div> | |
36 | </div> | |
37 | ||
38 | <div class="jumbotron"> | |
39 | <div class="container"> | |
40 | <h1>minify.json.js</h1> | |
41 | </div> | |
42 | </div> | |
43 | ||
44 | <div class="container aggregate-stats"> | |
45 | <div class="row"> | |
46 | <div class="col-md-6"> | |
47 | <h2 class="header">Maintainability <a href="http://blogs.msdn.com/b/codeanalysis/archive/2007/11/20/maintainability-index-range-and-meaning.aspx"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="A value between 0 and 100 that represents the relative ease of maintaining the code. A high value means better maintainability." data-original-title="Maintainability Index"></i></a></h2> | |
48 | <p class="stat">48.77</p> | |
49 | </div> | |
50 | <div class="col-md-6"> | |
51 | <h2 class="header">Lines of code <i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Source Lines of Code / Logical Lines of Code" data-original-title="SLOC/LSLOC"></i></h2> | |
52 | <p class="stat">81</p> | |
53 | </div> | |
54 | </div> | |
55 | <div class="row historical"> | |
56 | <div class="col-md-6"> | |
57 | <p id="chart_historical_maint" class="chart"></p> | |
58 | </div> | |
59 | <div class="col-md-6"> | |
60 | <p id="chart_historical_sloc" class="chart"></p> | |
61 | </div> | |
62 | </div> | |
63 | <div class="row"> | |
64 | <div class="col-md-6"> | |
65 | <h2 class="header">Difficulty <a href="http://en.wikipedia.org/wiki/Halstead_complexity_measures"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="The difficulty measure is related to the difficulty of the program to write or understand." data-original-title="Difficulty"></i></a></h2> | |
66 | <p class="stat">32.34</p> | |
67 | </div> | |
68 | <div class="col-md-6"> | |
69 | <h2 class="header">Estimated Errors <a href="http://en.wikipedia.org/wiki/Halstead_complexity_measures"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Halstead's delivered bugs is an estimate for the number of errors in the implementation." data-original-title="Delivered Bugs"></i></a></h2> | |
70 | <p class="stat">0.62</p> | |
71 | </div> | |
72 | </div> | |
73 | </div> | |
74 | ||
75 | <div class="container charts"> | |
76 | <div class="row"> | |
77 | <h2 class="header">Function weight</h2> | |
78 | </div> | |
79 | <div class="row"> | |
80 | <div class="col-md-6"> | |
81 | <h3 class="chart-header">By Complexity <a href="http://en.wikipedia.org/wiki/Cyclomatic_complexity"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="This metric counts the number of distinct paths through a block of code. Lower values are better." data-original-title="Cyclomatic Complexity"></i></a></h3> | |
82 | <div id="fn-by-complexity" class="stat"></div> | |
83 | </div> | |
84 | <div class="col-md-6"> | |
85 | <h3 class="chart-header">By SLOC <i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Source Lines of Code / Logical Lines of Code" data-original-title="SLOC/LSLOC"></i></h3> | |
86 | <div id="fn-by-sloc" class="stat"></div> | |
87 | </div> | |
88 | </div> | |
89 | </div> | |
90 | ||
91 | <div class="container"> | |
92 | <div class="row"> | |
93 | <textarea id="file-source" class="col-md-12">/*! JSON.minify() | |
94 | v0.1 (c) Kyle Simpson | |
95 | MIT License | |
96 | */ | |
97 | /** | |
98 | * @name minify.json.js | |
99 | * @author Kei Funagayama <kei.topaz@gmail.com | |
100 | * @overview JSON.minify | |
101 | */ | |
102 | ||
103 | /** | |
104 | * @namespace JSON | |
105 | */ | |
106 | (function(global){ | |
107 | 'use strict'; | |
108 | ||
109 | /** | |
110 | * @function | |
111 | * @memberof JSON | |
112 | * @param {Object} Transformed data. format) json-like | |
113 | * @return {String} | |
114 | * | |
115 | * @example | |
116 | * var json = { // hoge | |
117 | * "foo": "bar",// this is cool | |
118 | * "bar": [ | |
119 | * "baz", "bum", "zam" // this is cool | |
120 | * ] | |
121 | * } // hoge | |
122 | * | |
123 | */ | |
124 | var minify = function (json) { | |
125 | ||
126 | var tokenizer = /"|(\/\*)|(\*\/)|(\/\/)|\n|\r/g, | |
127 | in_string = false, | |
128 | in_multiline_comment = false, | |
129 | in_singleline_comment = false, | |
130 | tmp, tmp2, new_str = [], ns = 0, from = 0, lc, rc | |
131 | ; | |
132 | ||
133 | tokenizer.lastIndex = 0; | |
134 | ||
135 | while ( tmp = tokenizer.exec(json) ) { | |
136 | lc = RegExp.leftContext; | |
137 | rc = RegExp.rightContext; | |
138 | if (!in_multiline_comment && !in_singleline_comment) { | |
139 | tmp2 = lc.substring(from); | |
140 | if (!in_string) { | |
141 | tmp2 = tmp2.replace(/(\n|\r|\s)*/g,""); | |
142 | } | |
143 | new_str[ns++] = tmp2; | |
144 | } | |
145 | from = tokenizer.lastIndex; | |
146 | ||
147 | if (tmp[0] === "\"" && !in_multiline_comment && !in_singleline_comment) { | |
148 | tmp2 = lc.match(/(\\)*$/); | |
149 | if (!in_string || !tmp2 || (tmp2[0].length % 2) === 0) { // start of string with ", or unescaped " character found to end string | |
150 | in_string = !in_string; | |
151 | } | |
152 | from--; // include " character in next catch | |
153 | rc = json.substring(from); | |
154 | } | |
155 | else if (tmp[0] === "/*" && !in_string && !in_multiline_comment && !in_singleline_comment) { | |
156 | in_multiline_comment = true; | |
157 | } | |
158 | else if (tmp[0] === "*/" && !in_string && in_multiline_comment && !in_singleline_comment) { | |
159 | in_multiline_comment = false; | |
160 | } | |
161 | else if (tmp[0] === "//" && !in_string && !in_multiline_comment && !in_singleline_comment) { | |
162 | in_singleline_comment = true; | |
163 | } | |
164 | else if ((tmp[0] === "\n" || tmp[0] === "\r") && !in_string && !in_multiline_comment && in_singleline_comment) { | |
165 | in_singleline_comment = false; | |
166 | } | |
167 | else if (!in_multiline_comment && !in_singleline_comment && !(/\n|\r|\s/.test(tmp[0]))) { | |
168 | new_str[ns++] = tmp[0]; | |
169 | } | |
170 | } | |
171 | new_str[ns++] = rc; | |
172 | return new_str.join(""); | |
173 | }; | |
174 | ||
175 | if (typeof module !== 'undefined' && module.exports) { | |
176 | // node | |
177 | module.exports = minify; | |
178 | JSON.minify = minify; | |
179 | } else { | |
180 | // others, export global | |
181 | if (typeof global.JSON === "undefined" || !global.JSON) { | |
182 | global.JSON = {}; | |
183 | } | |
184 | global.JSON.minify = minify; | |
185 | } | |
186 | })(this);</textarea> | |
187 | </div> | |
188 | </div> | |
189 | ||
190 | <footer class="footer"> | |
191 | <div class="container"> | |
192 | <p>.</p> | |
193 | </div> | |
194 | </footer> | |
195 | ||
196 | <script type="text/html" id="complexity-popover-template"> | |
197 | <div class="complexity-notice"> | |
198 | Complexity : {{ complexity.cyclomatic }} <br> | |
199 | Length : {{ complexity.halstead.length }} <br> | |
200 | Difficulty : {{ complexity.halstead.difficulty.toFixed(2) }} <br> | |
201 | Est # bugs : {{ complexity.halstead.bugs.toFixed(2) }}<br> | |
202 | </div> | |
203 | </script> | |
204 | ||
205 | <script type="text/javascript" src="../../assets/scripts/bundles/core-bundle.js"></script> | |
206 | <script type="text/javascript" src="../../assets/scripts/bundles/codemirror.js"></script> | |
207 | <script type="text/javascript" src="../../assets/scripts/codemirror.markpopovertext.js"></script> | |
208 | <script type="text/javascript" src="report.js"></script> | |
209 | <script type="text/javascript" src="report.history.js"></script> | |
210 | <script type="text/javascript" src="../../assets/scripts/plato-file.js"></script> | |
211 | </body> | |
212 | </html> |