home.html 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Metrix++ Project</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <meta name="description" content="">
  8. <meta name="author" content="">
  9. <!-- Le styles -->
  10. <!--
  11. <link href="../../style.css" rel="stylesheet">
  12. -->
  13. <link href="assets/css/bootstrap.css" rel="stylesheet">
  14. <link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
  15. <link href="assets/css/docs.css" rel="stylesheet">
  16. <link href="assets/js/google-code-prettify/prettify.css" rel="stylesheet">
  17. <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
  18. <!--[if lt IE 9]>
  19. <script src="assets/js/html5shiv.js"></script>
  20. <![endif]-->
  21. <!-- Le fav and touch icons -->
  22. <link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
  23. <link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
  24. <link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
  25. <link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
  26. <link rel="shortcut icon" href="assets/ico/favicon.png">
  27. <!--
  28. <script type="text/javascript">
  29. var _gaq = _gaq || [];
  30. _gaq.push(['_setAccount', 'UA-146052-10']);
  31. _gaq.push(['_trackPageview']);
  32. (function() {
  33. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  34. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  35. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  36. })();
  37. </script>
  38. -->
  39. </head>
  40. <body data-spy="scroll" data-target=".bs-docs-sidebar">
  41. <!-- Navbar
  42. ================================================== -->
  43. <div class="navbar navbar-link navbar-fixed-top">
  44. <div class="navbar-inner">
  45. <div class="container">
  46. <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
  47. <span class="icon-bar"></span>
  48. <span class="icon-bar"></span>
  49. <span class="icon-bar"></span>
  50. </button>
  51. <a class="brand" href="./index.html">Metrix++</a>
  52. <div class="nav-collapse collapse">
  53. <ul class="nav">
  54. <li class="">
  55. <a href="./index.html">Home</a>
  56. </li>
  57. </ul>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <!-- Subhead
  63. ================================================== -->
  64. <header class="jumbotron" id="overview">
  65. <div id="myCarousel" class="carousel slide">
  66. <div class="carousel-inner">
  67. <div class="item active">
  68. <img src="assets/img/slide-01.jpg" alt="">
  69. <div class="container">
  70. <div class="carousel-caption">
  71. <h2>Multiple languages</h2>
  72. <p class="lead">&middot; C/C++, C# and Java.</p>
  73. <p class="lead">&middot; Recognises classes, interfaces, namespaces, functions, comments, preprocessor and much more.</p>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="item">
  78. <img src="assets/img/slide-02.jpg" alt="">
  79. <div class="container">
  80. <div class="carousel-caption">
  81. <h2>Multiple metrics</h2>
  82. <p class="lead">&middot; Complexity, size and other.</p>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="item">
  87. <img src="assets/img/slide-03.jpg" alt="">
  88. <div class="container">
  89. <div class="carousel-caption">
  90. <h2>High performance and scalability</h2>
  91. <p class="lead">&middot; Applicable to huge code bases: thousands of files per minute.</p>
  92. <p class="lead">&middot; Ultra-fast feedback on iterative re-run.</p>
  93. </div>
  94. </div>
  95. </div>
  96. <div class="item">
  97. <img src="assets/img/slide-01.jpg" alt="">
  98. <div class="container">
  99. <div class="carousel-caption">
  100. <h2>Effortless application to legacy code</h2>
  101. <p class="lead">&middot; Recognises legacy, modified and new code.</p>
  102. <p class="lead">&middot; Prevents from negative trends. Encourages positive.</p>
  103. </div>
  104. </div>
  105. </div>
  106. <div class="item">
  107. <img src="assets/img/slide-02.jpg" alt="">
  108. <div class="container">
  109. <div class="carousel-caption">
  110. <h2>Configurable</h2>
  111. <p class="lead">&middot; Define and apply your rules and policies.</p>
  112. <p class="lead">&middot; Integrate with your workflow.</p>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="item">
  117. <img src="assets/img/slide-03.jpg" alt="">
  118. <div class="container">
  119. <div class="carousel-caption">
  120. <h2>Extendable via plugins</h2>
  121. <p class="lead">&middot; Define your custom metric.</p>
  122. <p class="lead">&middot; Add new language parser.</p>
  123. <p class="lead">&middot; Create advanced post-analysis tool.</p>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. <a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>
  129. <a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>
  130. </div>
  131. <div class="container">
  132. <div class="row">
  133. <div class="span3">
  134. </div>
  135. <div class="span9">
  136. <h5 class="text-right">Management of source code quality is possible.</h5>
  137. <p class="text-right">
  138. <a href="https://sourceforge.net/projects/metrixplusplus/files/latest/download"
  139. ><button type="button"class="btn btn-danger">Download</button></a>
  140. <!--
  141. <button type="button"class="btn btn-warning">Donate</button>
  142. -->
  143. </p>
  144. </div>
  145. </div>
  146. </div>
  147. </header>
  148. <div class="container"><div class="row">
  149. <!-- Docs nav
  150. ================================================== -->
  151. <div class="span3 bs-docs-sidebar">
  152. <ul class="nav nav-list bs-docs-sidenav">
  153. <!--<li><img src="../../logo_project.png"/><p>&nbsp;</p></li>-->
  154. <li><a href="#overview_section"><i class="icon-chevron-right"></i> Overview</a></li>
  155. <li><a href="#download_section"><i class="icon-chevron-right"></i> Download &amp; Install</a></li>
  156. <li><a href="#workflow_collect_section"><i class="icon-chevron-right"></i> Workflow: Collect data</a></li>
  157. <li><a href="#workflow_view_section"><i class="icon-chevron-right"></i> Workflow: View data</a></li>
  158. <li><a href="#workflow_view_summary_section"><i class="icon-hand-right"></i> &middot; summary &amp; distributions</a></li>
  159. <li><a href="#workflow_view_details_section"><i class="icon-hand-right"></i> &middot; details per file/region</a></li>
  160. <li><a href="#workflow_limit_section"><i class="icon-chevron-right"></i> Workflow: Apply thresholds</a></li>
  161. <li><a href="#workflow_limit_hotspots_section"><i class="icon-hand-right"></i> &middot; hotspots</a></li>
  162. <li><a href="#workflow_limit_control_section"><i class="icon-hand-right"></i> &middot; controlling trends</a></li>
  163. <li><a href="#workflow_other_section"><i class="icon-chevron-right"></i> Workflow: Other applications</a></li>
  164. <li><a href="#extend_section"><i class="icon-chevron-right"></i> Create plugin</a></li>
  165. <li><a href="#contribute_section"><i class="icon-chevron-right"></i> Feedback &amp; Contribute</a></li>
  166. </ul>
  167. </div>
  168. <!-- Sections
  169. ================================================== -->
  170. <div class="span9">
  171. <!-- Overview
  172. ================================================== -->
  173. <section id="overview_section">
  174. <div class="page-header">
  175. <h1>Overview</h1>
  176. </div>
  177. <h3>Highlights</h3>
  178. <p>Metrix++ is a tool to collect and analyse code metrics. Any metric is useless if it is not used.
  179. Metrix++ offers great usage capabilities and assists with variety of application use cases:</p>
  180. <ul>
  181. <li>Monitoring trends on <strong>daily</strong> basis. In order to take actions or make right decisions earlier.</li>
  182. <li>Enforcing trends on <strong>hourly</strong> basis, at every commit of code changes. In order to control quality in time, i.e. when it is not too late to redo.</li>
  183. <li>Assisiting on <strong>per minute</strong> basis during code refactoring and code development, where coding and quality standards matter.</li>
  184. </ul>
  185. <p>The workflow sections below demonstarate basic application usecases.</p>
  186. <h3>Languages supported</h3>
  187. <p>The tool can parse C/C++, C# and Java source code files. The parser identifies certain regions in the code,
  188. such as classes, functions, namespaces, interfaces, etc. It obviously detects comments, strings and code for preprocessor.
  189. The identified regions form a tree of nested source code blocks, which are refered after and additionally scanned by metrics plugins.
  190. This concept allows to attribute metrics per regions, what gives fine grained data and rich input to analysis tools.
  191. The following example demonstrates regions concept.</p>
  192. <table class="table">
  193. <thead>
  194. <tr>
  195. <th>Source code</th>
  196. <th>Regions tree [type: name: content type]</th>
  197. </tr>
  198. </thead>
  199. <tbody>
  200. <tr>
  201. <td>
  202. <pre class="prettyprint linenums">
  203. // simple C++ code
  204. #include &lt;myapi.h&gt;
  205. // I explain the following class
  206. class MyClass {
  207. public:
  208. int m_var; // some member
  209. // I explain the following function
  210. MyClass(): m_var(0) {
  211. char str[] = "unused string"
  212. // nested region for good measure
  213. struct MyStruct {};
  214. }
  215. // Do not judge ugly code below
  216. #define get_max(a,b) ((a)>(b)?(a):(b))
  217. set_max(int b) {
  218. m_var = get_max(m_var, b);
  219. }
  220. };
  221. // this is the last line
  222. </pre>
  223. </td>
  224. <td>
  225. <pre class="prettyprint linenums">
  226. file: __global__: comment
  227. file: __global__: code
  228. file: __global__: preprocessor
  229. file: __global__: code
  230. class: MyClass: comment
  231. class: MyClass: code
  232. class: MyClass: code
  233. class: MyClass: code, comment
  234. class: MyClass: code
  235. function: MyClass: comment
  236. function: MyClass: code
  237. function: MyClass: code, string
  238. function: MyClass: code
  239. struct: MyStruct: comment
  240. struct: MyStruct: code
  241. function: MyClass: code
  242. class: MyClass: code
  243. function: set_max: comment
  244. function: set_max: preprocessor
  245. function: set_max: code
  246. function: set_max: code
  247. function: set_max: code
  248. class: MyClass: code
  249. file: __global__: comment
  250. </pre>
  251. </td>
  252. </tr>
  253. </tbody>
  254. </table>
  255. <h3>Metrics</h3>
  256. <p>Metrics highlighed in blue are <strong>per file</strong> metrics. Other metrics are <strong>per region</strong> metrics.
  257. Region term is explained in the previous chapter.</p>
  258. <table class="table table-bordered">
  259. <thead>
  260. <tr>
  261. <th>Metric (enable option)</th>
  262. <th>Brief description</th>
  263. <th>Motivation</th>
  264. </tr>
  265. </thead>
  266. <tbody>
  267. <tr class="info">
  268. <td>std.general.size</td>
  269. <td>Size of a file in bytes.</td>
  270. <td rowspan="4"><ul><li>Monitoring growth of source code base.</li>
  271. <li>Normalizing other metrics.</li>
  272. <li>Preventing large files and regions (large things difficult to maintain).</li>
  273. <li>Predicting delivery dates by comparing
  274. <a href="http://www.compaid.com/caiInternet/casestudies/kanarticle2.pdf">S-shaped code base growth / change curves</a>.</li></ul></td>
  275. </tr>
  276. <tr>
  277. <td>std.code.length.total</td>
  278. <td>The same as 'std.general.size' metric, but attributed to code regions.</td>
  279. <td></td>
  280. </tr>
  281. <tr>
  282. <td>std.code.lines.total</td>
  283. <td>Number of non-blank lines of code of any content type (exectuable, comments, etc.)</td>
  284. <td></td>
  285. </tr>
  286. <tr>
  287. <td>std.code.lines.code</td>
  288. <td>Number of non-blank lines of code excluding preprocessor and comments.</td>
  289. <td></td>
  290. </tr>
  291. <tr>
  292. <td>std.code.lines.preprocessor</td>
  293. <td>Number of non-blank lines of preprocessor code.</td>
  294. <td><ul><li>Enforcing localisation of preprocessor code in a single place.</li>
  295. <li>Encouraging usage of safer code structures instead of preprocessor.</li></ul></td>
  296. </tr>
  297. <tr>
  298. <td>std.code.lines.comments</td>
  299. <td>Number of non-blank lines of comments.</td>
  300. <td><ul><li>Low number of comments may indicate about maintainability problems.</li></ul></td>
  301. </tr>
  302. <tr>
  303. <td>std.code.complexity.cyclomatic</td>
  304. <td>McCabe cyclomatic complexity metric.</td>
  305. <td colspan="2"><ul><li>Identification of highly complex code for review and refactoring.</li>
  306. <li>Preventing complex functions (complexity is a reason of many defects and a reason of expensive maintaintenance).</li></ul></td>
  307. </tr>
  308. <tr>
  309. <td>std.code.complexity.maxindent</td>
  310. <td>Maximum level of indentation of blocks within a region. For example, the following class has got
  311. the metric equal to 1 and the function has got it equal to 2:
  312. <pre class="prettyprint">
  313. class WeekClass {
  314. int isWeekend(int day) {
  315. if (day == SATURDAY ||
  316. day == SUNDAY) {
  317. return true;
  318. }
  319. return false;
  320. }
  321. }
  322. </pre>
  323. </td>
  324. </tr>
  325. <tr>
  326. <td>std.suppress</td>
  327. <td>An option enables collection of Metrix++ suppressions and 2 metrics: 'std.suppress:count' and
  328. 'std.suppress.file:count'. The first is number of suppressions per region.
  329. The second is the same but applies for file-scope metrics.</td>
  330. <td><ul><li>Suppressing false-positives.</li>
  331. <li>Managing the amount of suppressions. Usually there are no false-positives to suppress with the right metric,
  332. but could be exceptions in specific cases. Managing suppressions is about managing exceptions.
  333. If there are many exceptional cases, maybe something is wrong with a metric or an application of a metric.</li></ul></td>
  334. </tr>
  335. <tr class="info">
  336. <td>std.general.procerrors</td>
  337. <td>Number of errors detected by Metrix++ code parser.
  338. Errors, like mismatched brackets, may result in bad identification of regions.</td>
  339. <td><ul><li>Cleaning up errors to ensure reliable code scanning.</li></ul></td>
  340. </tr>
  341. <tr class="info">
  342. <td>std.general.proctime</td>
  343. <td>Seconds spent on processing a file.</td>
  344. <td><ul><li>Monitor and profile tool's performance.</li></ul></td>
  345. </tr>
  346. </tbody>
  347. </table>
  348. </section>
  349. <section id="download_section">
  350. <div class="page-header">
  351. <h1>Download &amp; Install</h1>
  352. </div>
  353. <p>In order to get the tool working, <a href="https://sourceforge.net/projects/metrixplusplus/files/latest/download">dowload the archive</a> with the latest stable version
  354. and unpack it to some folder. First run of the tool will trigger the installation within the folder,
  355. where it was launched.</p>
  356. <p>Corresponding checkout from the <a href="https://sourceforge.net/p/metrixplusplus/code">version control system</a> is the following:</p>
  357. <pre>svn checkout <a href="https://sourceforge.net/p/metrixplusplus/code">svn://svn.code.sf.net/p/metrixplusplus/code</a>/releases/latest Metrix++</pre>
  358. <p>In order to checkout the latest version under development, use this command:</p>
  359. <pre>svn checkout <a href="https://sourceforge.net/p/metrixplusplus/code">svn://svn.code.sf.net/p/metrixplusplus/code</a>/mainline Metrix++</pre>
  360. <h4>Prerequisites</h4>
  361. <p>Python Runtime Environment (version 2.7.* or later, version 3.* has not been tested)</p>
  362. <h4>License</h4>
  363. <p>This program is free software; you can redistribute it and/or modify it
  364. under the terms of the GNU General Public License as published by the
  365. Free Software Foundation; version 3 of the License.</p>
  366. <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  367. without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  368. See the GNU General Public License for more details.</p>
  369. <p>You should have received a copy of the GNU General Public License along with the Metrix++;
  370. if not, contact <a href="mailto:avkonst@users.sourceforge.net?subject=Metrix%2B%2B License">Project Administrator</a></p>
  371. </section>
  372. <div class="page-header">
  373. <h1>Workflow</h1>
  374. </div>
  375. <p>The workflow and application usecases are demonstrated using source code of
  376. <a href="http://www.boost.org/doc/libs/1_54_0/doc/html/interprocess.html">boost/interprocess</a> library.
  377. Boost versions 1.52 and 1.54 are used and refered below as 'previous' and 'current' accordingly.</p>
  378. <section id="workflow_collect_section">
  379. <h2>Collect data</h2>
  380. <p>The first obvious step is to collect the data.
  381. The 'collect' tool has got multiple options to enable various metrics plugins.
  382. Let's collect number of lines of code and cyclomatic complexity metrics
  383. for the previous (1.52.0 version) boost interprocess library. Assuming that 2 versions of boost library
  384. are unpacked in the current working directory:</p>
  385. <pre>
  386. &gt; cd boost_1_52_0
  387. &gt; python "/path/to/metrix++.py" collect --std.code.lines.code --std.code.complexity.cyclomatic -- boost/interprocess
  388. &gt; cd ../ # return back to working directory
  389. </pre>
  390. <p>The list of arguments after '--' enumerates paths where to read source files.
  391. As a result of execution of this command, a file metrixpp.db will be written in the current working directory.
  392. It can be redefined with help of --db-file option.</p>
  393. <p>Metrix++ has got rich functionality in comparing code bases and reducing processing scope to modified or new code.
  394. So, let's collect the same data for the current (1.54.0 version) boost interprocess library.</p>
  395. <pre>
  396. &gt; cd boost_1_54_0
  397. &gt; python "/path/to/metrix++.py" collect --std.code.lines.code --std.code.complexity.cyclomatic -- boost/interprocess --db-file-prev=../boost_1_52_0/metrixpp.db
  398. &gt; cd ../ # return back to working directory
  399. </pre>
  400. <p>The option --db-file-prev points out to the file with data collected in the previous step.
  401. So, eventually it executed iterative collection. It can speed up the exectuion significantly,
  402. depending on amount of changes between two version.</p>
  403. <p>Check other options of the collect tool by executing:</p>
  404. <pre>
  405. &gt; python "/path/to/metrix++.py" collect --help
  406. </pre>
  407. </section>
  408. <section id="workflow_view_section">
  409. <h2>View data</h2>
  410. </section>
  411. <section id="workflow_view_summary_section">
  412. <h3>Summary metrics and distribution tables/graphs</h3>
  413. <p>It is time to look at the data files collected (step above). The command:</p>
  414. <pre>
  415. &gt; python "/path/to/metrix++.py" view --db-file=boost_1_54_0/metrixpp.db
  416. </pre>
  417. <p>prints summary metrics, like minimum/maximum, and distribution/frequency tables:</p>
  418. <pre>
  419. :: info: Overall metrics for 'std.code.complexity:cyclomatic' metric
  420. Average : 0.652902698283
  421. Minimum : 0
  422. Maximum : 37
  423. Total : 1597.0
  424. Distribution : 2446 regions in total (including 0 suppressed)
  425. Metric value : Ratio : R-sum : Number of regions
  426. 0 : 0.771 : 0.771 : 1886 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  427. 1 : 0.110 : 0.881 : 268 |||||||||||
  428. 2 : 0.044 : 0.925 : 108 ||||
  429. 3 : 0.025 : 0.949 : 60 ||
  430. 4 : 0.016 : 0.966 : 40 ||
  431. 5 : 0.007 : 0.973 : 18 |
  432. 6 : 0.006 : 0.979 : 14 |
  433. 7 : 0.004 : 0.983 : 10
  434. 8 : 0.003 : 0.986 : 8
  435. 9 : 0.002 : 0.988 : 4
  436. 10 : 0.004 : 0.991 : 9
  437. 11 : 0.002 : 0.993 : 4
  438. 12 : 0.001 : 0.994 : 3
  439. 13 : 0.001 : 0.995 : 2
  440. 14 : 0.001 : 0.996 : 2
  441. 15-16 : 0.001 : 0.997 : 3
  442. 17-18 : 0.001 : 0.998 : 3
  443. 20 : 0.000 : 0.999 : 1
  444. 23-25 : 0.001 : 1.000 : 2
  445. 37 : 0.000 : 1.000 : 1
  446. :: info: Overall metrics for 'std.code.lines:code' metric
  447. Average : 6.64356984479
  448. Minimum : 0
  449. Maximum : 201
  450. Total : 23970.0
  451. Distribution : 3608 regions in total (including 0 suppressed)
  452. Metric value : Ratio : R-sum : Number of regions
  453. 0-1 : 0.088 : 0.088 : 319 |||||||||
  454. 2 : 0.320 : 0.409 : 1155 ||||||||||||||||||||||||||||||||
  455. 3 : 0.108 : 0.517 : 390 |||||||||||
  456. 4 : 0.081 : 0.598 : 294 ||||||||
  457. 5 : 0.080 : 0.678 : 290 ||||||||
  458. 6 : 0.061 : 0.739 : 220 ||||||
  459. 7 : 0.049 : 0.788 : 176 |||||
  460. 8 : 0.030 : 0.818 : 109 |||
  461. 9 : 0.025 : 0.843 : 89 ||
  462. 10-11 : 0.032 : 0.876 : 117 |||
  463. 12-13 : 0.020 : 0.895 : 71 ||
  464. 14 : 0.012 : 0.907 : 43 |
  465. 15-16 : 0.017 : 0.924 : 61 ||
  466. 17-19 : 0.015 : 0.939 : 55 ||
  467. 20-22 : 0.013 : 0.952 : 46 |
  468. 23-26 : 0.011 : 0.963 : 40 |
  469. 27-30 : 0.009 : 0.972 : 33 |
  470. 31-39 : 0.009 : 0.981 : 33 |
  471. 40-65 : 0.009 : 0.991 : 34 |
  472. 66-201 : 0.009 : 1.000 : 33 |
  473. :: info: Directory content:
  474. Directory : .
  475. </pre>
  476. <p>The same command with --db-file-prev option enables comparision and change trends are shown in [] brackets:</p>
  477. <pre>
  478. &gt; python "/path/to/metrix++.py" view --db-file=boost_1_54_0/metrixpp.db --db-file-prev=boost_1_52_0/metrixpp.db
  479. </pre>
  480. <pre>
  481. :: info: Overall metrics for 'std.code.complexity:cyclomatic' metric
  482. Average : 0.652902698283 [+0.00362138411453]
  483. Minimum : 0 [+0]
  484. Maximum : 37 [+1]
  485. Total : 1597.0 [+16.0]
  486. Distribution : 2446 [+11] regions in total (including 0 [+0] suppressed)
  487. Metric value : Ratio : R-sum : Number of regions
  488. 0 : 0.771 : 0.771 : 1886 [+5 ] |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  489. 1 : 0.110 : 0.881 : 268 [+4 ] |||||||||||
  490. 2 : 0.044 : 0.925 : 108 [+0 ] ||||
  491. 3 : 0.025 : 0.949 : 60 [+2 ] ||
  492. 4 : 0.016 : 0.966 : 40 [-1 ] ||
  493. 5 : 0.007 : 0.973 : 18 [-1 ] |
  494. 6 : 0.006 : 0.979 : 14 [+1 ] |
  495. 7 : 0.004 : 0.983 : 10 [+1 ]
  496. 8 : 0.003 : 0.986 : 8 [+1 ]
  497. 9 : 0.002 : 0.988 : 4 [+0 ]
  498. 10 : 0.004 : 0.991 : 9 [-2 ]
  499. 11 : 0.002 : 0.993 : 4 [+1 ]
  500. 12 : 0.001 : 0.994 : 3 [+0 ]
  501. 13 : 0.001 : 0.995 : 2 [+0 ]
  502. 14 : 0.001 : 0.996 : 2 [+0 ]
  503. 15-16 : 0.001 : 0.997 : 3 [-1 ]
  504. 17-18 : 0.001 : 0.998 : 3 [+1 ]
  505. 20 : 0.000 : 0.999 : 1 [+0 ]
  506. 23-25 : 0.001 : 1.000 : 2 [+0 ]
  507. 36-37 : 0.000 : 1.000 : 1 [+0 ]
  508. :: info: Overall metrics for 'std.code.lines:code' metric
  509. Average : 6.64356984479 [+0.012181964309]
  510. Minimum : 0 [+0]
  511. Maximum : 201 [+4]
  512. Total : 23970.0 [+223.0]
  513. Distribution : 3608 [+27] regions in total (including 0 [+0] suppressed)
  514. Metric value : Ratio : R-sum : Number of regions
  515. 0-1 : 0.088 : 0.088 : 319 [+3 ] |||||||||
  516. 2 : 0.320 : 0.409 : 1155 [+9 ] ||||||||||||||||||||||||||||||||
  517. 3 : 0.108 : 0.517 : 390 [-3 ] |||||||||||
  518. 4 : 0.081 : 0.598 : 294 [+7 ] ||||||||
  519. 5 : 0.080 : 0.678 : 290 [+7 ] ||||||||
  520. 6 : 0.061 : 0.739 : 220 [-1 ] ||||||
  521. 7 : 0.049 : 0.788 : 176 [-2 ] |||||
  522. 8 : 0.030 : 0.818 : 109 [-1 ] |||
  523. 9 : 0.025 : 0.843 : 89 [+4 ] ||
  524. 10-11 : 0.032 : 0.876 : 117 [+9 ] |||
  525. 12-13 : 0.020 : 0.895 : 71 [-9 ] ||
  526. 14 : 0.012 : 0.907 : 43 [+0 ] |
  527. 15-16 : 0.017 : 0.924 : 61 [+0 ] ||
  528. 17-19 : 0.015 : 0.939 : 55 [+6 ] ||
  529. 20-22 : 0.013 : 0.952 : 46 [-3 ] |
  530. 23-26 : 0.011 : 0.963 : 40 [+2 ] |
  531. 27-30 : 0.009 : 0.972 : 33 [-3 ] |
  532. 31-39 : 0.009 : 0.981 : 33 [+0 ] |
  533. 40-65 : 0.009 : 0.991 : 34 [+1 ] |
  534. 66-201 : 0.009 : 1.000 : 33 [+1 ] |
  535. :: info: Directory content:
  536. Directory : .
  537. </pre>
  538. <h4>Reducing analysis scope</h4>
  539. <p>There are two ways to reduce the analysis scope for the view tool. The first is to enumerate paths of interest.
  540. For example, the following command reduces scope to 'allocators' sub-directory within the processed code.</p>
  541. <pre>
  542. &gt; python "/path/to/metrix++.py" view --db-file=boost_1_54_0/metrixpp.db -- ./boost/interprocess/allocators
  543. </pre>
  544. <p>The second is to specify --scope-mode option, which instructs the tool to process only modified and/or new files/regions.
  545. For example, view the summary metrics for all modified and new regions:</p>
  546. <pre>
  547. &gt; python "/path/to/metrix++.py" view --db-file=boost_1_54_0/metrixpp.db --db-file-prev=boost_1_52_0/metrixpp.db --scope-mode=touched
  548. </pre>
  549. <pre>
  550. :: info: Overall metrics for 'std.code.complexity:cyclomatic' metric
  551. Average : 1.84924623116 [-0.0230941943761]
  552. Minimum : 0 [+0]
  553. Maximum : 37 [+1]
  554. Total : 368.0 [+16.0]
  555. Distribution : 199 [+11] regions in total (including 0 [+0] suppressed)
  556. Metric value : Ratio : R-sum : Number of regions
  557. 0 : 0.608 : 0.608 : 121 [+5 ] |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  558. 1 : 0.131 : 0.739 : 26 [+4 ] |||||||||||||
  559. 2 : 0.070 : 0.809 : 14 [+0 ] |||||||
  560. 3 : 0.060 : 0.869 : 12 [+2 ] ||||||
  561. 4 : 0.015 : 0.884 : 3 [-1 ] ||
  562. 5 : 0.015 : 0.899 : 3 [-1 ] ||
  563. 6 : 0.005 : 0.905 : 1 [+1 ] |
  564. 7 : 0.015 : 0.920 : 3 [+1 ] ||
  565. 8 : 0.015 : 0.935 : 3 [+1 ] ||
  566. 9 : 0.010 : 0.945 : 2 [+0 ] |
  567. 10 : 0.010 : 0.955 : 2 [-2 ] |
  568. 11 : 0.005 : 0.960 : 1 [+1 ] |
  569. 12 : 0.005 : 0.965 : 1 [+0 ] |
  570. 13 : 0.005 : 0.970 : 1 [+0 ] |
  571. 16 : 0.005 : 0.975 : 1 [-1 ] |
  572. 17 : 0.005 : 0.980 : 1 [+0 ] |
  573. 18 : 0.010 : 0.990 : 2 [+1 ] |
  574. 20 : 0.005 : 0.995 : 1 [+0 ] |
  575. 36-37 : 0.005 : 1.000 : 1 [+0 ] |
  576. :: info: Overall metrics for 'std.code.lines:code' metric
  577. Average : 15.9645390071 [-0.815853149771]
  578. Minimum : 0 [+0]
  579. Maximum : 201 [+6]
  580. Total : 4502.0 [+223.0]
  581. Distribution : 282 [+27] regions in total (including 0 [+0] suppressed)
  582. Metric value : Ratio : R-sum : Number of regions
  583. 0-1 : 0.053 : 0.053 : 15 [+3 ] |||||
  584. 2 : 0.124 : 0.177 : 35 [+9 ] ||||||||||||
  585. 3 : 0.053 : 0.230 : 15 [-3 ] |||||
  586. 4 : 0.060 : 0.291 : 17 [+7 ] ||||||
  587. 5 : 0.089 : 0.379 : 25 [+7 ] |||||||||
  588. 6 : 0.060 : 0.440 : 17 [-1 ] ||||||
  589. 7 : 0.050 : 0.489 : 14 [-2 ] |||||
  590. 8-9 : 0.074 : 0.564 : 21 [+3 ] |||||||
  591. 10 : 0.035 : 0.599 : 10 [+5 ] ||||
  592. 11 : 0.082 : 0.681 : 23 [+4 ] ||||||||
  593. 12-13 : 0.043 : 0.723 : 12 [-9 ] ||||
  594. 14-15 : 0.039 : 0.762 : 11 [-1 ] ||||
  595. 16-18 : 0.028 : 0.791 : 8 [+4 ] |||
  596. 19-22 : 0.039 : 0.830 : 11 [+0 ] ||||
  597. 23-26 : 0.039 : 0.869 : 11 [+2 ] ||||
  598. 27-32 : 0.028 : 0.897 : 8 [-3 ] |||
  599. 38-50 : 0.025 : 0.922 : 7 [+0 ] ||
  600. 51-69 : 0.025 : 0.947 : 7 [+1 ] ||
  601. 71-100 : 0.032 : 0.979 : 9 [+2 ] |||
  602. 101-201 : 0.021 : 1.000 : 6 [-1 ] ||
  603. :: info: Directory content:
  604. Directory : .
  605. </pre>
  606. </section>
  607. <section id="workflow_view_details_section">
  608. <h3>Detailed metrics per file/region</h3>
  609. <p>The same view tool can print detailed metrics per file and per every region in the specified file.
  610. In order to get detailed metrics, enumerate files of interest after '--'. For example:</p>
  611. <pre>
  612. &gt; python "/path/to/metrix++.py" view --db-file=boost_1_54_0/metrixpp.db --db-file-prev=boost_1_52_0/metrixpp.db -- ./boost/interprocess/detail/managed_open_or_create_impl.hpp
  613. </pre>
  614. <p>produces output similar to this (truncated to make the page shorter):</p>
  615. <pre>
  616. ./interprocess/detail/managed_open_or_create_impl.hpp:302: info: Metrics per 'priv_open_or_create' region
  617. Region name : priv_open_or_create
  618. Region type : function
  619. Offsets : 8314-14526
  620. Line numbers : 301-467
  621. Modified : True
  622. std.code.complexity:cyclomatic: 37 [+1]
  623. std.code.lines:code: 148 [+4]
  624. </pre>
  625. </section>
  626. <section>
  627. <h3>More about the viewer</h3>
  628. <p>The 'view' command has got an option to alter the output format. It is possible to get the same data
  629. in xml pr python disctionary formats. This can be particularly useful for integration of the tool with
  630. other applications. For example, an editor may re-collect and show context based metrics when a file is saved.</p>
  631. <pre>
  632. &gt; python "/path/to/metrix++.py" view --db-file=boost_1_54_0/metrixpp.db --format=xml
  633. </pre>
  634. <p>Check other options of the view tool by executing:</p>
  635. <pre>
  636. &gt; python "/path/to/metrix++.py" view --help
  637. </pre>
  638. </section>
  639. <section id="workflow_limit_section">
  640. <h2>Apply thresholds</h2>
  641. <p>The viewer shows (above) that there are function with quite large value of cyclomatic complexity metric.
  642. Growth of this metric can be considered as negative trend. Metrix++ 'limit' tool offers the capability
  643. to organise the control over trends by applying limits to metric values.
  644. Exceeded limites are alarms in the quality management and control.</p>
  645. </section>
  646. <section id="workflow_limit_hotspots_section">
  647. <h3>Hotspots</h3>
  648. <p>Hotspots mode of the limit tool helps to identify top files/regions exceeding a metric threshold.
  649. Let's identify top 3 functions in boost interprocess library, which exceed limit of 15 points of
  650. cyclomatic complexity metric:</p>
  651. <pre>
  652. &gt; python "/path/to/metrix++.py" limit --db-file=boost_1_54_0/metrixpp.db --max-limit=std.code.complexity:cyclomatic:15 --hotspots=3
  653. </pre>
  654. <pre>
  655. ./interprocess/detail/managed_open_or_create_impl.hpp:302: warning: Metric 'std.code.complexity:cyclomatic' for region 'priv_open_or_create' exceeds the limit.
  656. Metric name : std.code.complexity:cyclomatic
  657. Region name : priv_open_or_create
  658. Metric value : 37
  659. Modified : None
  660. Change trend : None
  661. Limit : 15.0
  662. Suppressed : False
  663. ./interprocess/streams/vectorstream.hpp:284: warning: Metric 'std.code.complexity:cyclomatic' for region 'seekoff' exceeds the limit.
  664. Metric name : std.code.complexity:cyclomatic
  665. Region name : seekoff
  666. Metric value : 25
  667. Modified : None
  668. Change trend : None
  669. Limit : 15.0
  670. Suppressed : False
  671. ./interprocess/streams/bufferstream.hpp:174: warning: Metric 'std.code.complexity:cyclomatic' for region 'seekoff' exceeds the limit.
  672. Metric name : std.code.complexity:cyclomatic
  673. Region name : seekoff
  674. Metric value : 23
  675. Modified : None
  676. Change trend : None
  677. Limit : 15.0
  678. Suppressed : False
  679. </pre>
  680. </section>
  681. <section id="workflow_limit_control_section">
  682. <h3>Controlling trends</h3>
  683. <p>Exit code of the 'limit' tool is equal to number of warnings printed. This allows to use the tool
  684. as a static analysis tool during software build process. In this case, non-zero exit code means
  685. that there are violations to the agreed standards and it may fail the build. So, the same command
  686. without --hotspots option will print all regions/files exceeding the specified limit:</p>
  687. <pre>
  688. &gt; python "/path/to/metrix++.py" limit --db-file=boost_1_54_0/metrixpp.db --max-limit=std.code.complexity:cyclomatic:15
  689. </pre>
  690. <h4>Modes to exclude old code from the considiration</h4>
  691. <p>However, it is likely there are many warnings printed in this mode, especially if very old or legacy code is profiled
  692. against new metrics and coding rules. Although all warnings can be removed
  693. by re-factoring in scope of big task force activity, it is where many tools are rejected,
  694. because it is difficult to justify the initial cost of applying and integrating them.
  695. Metrix++ 'limit' tool has got an option --warn-mode, which helps to overcome this problem.</p>
  696. <p>--warn-mode=touched encourages re-factoring only for new and modified regions. It enables
  697. continuous refactoring. It does not matter how late the rule is applied or
  698. coding standard is modified. It is possible to do it anytime with zero initial investment.
  699. For example, applying it to boost interprocess library for a changes between 1.52 and 1.54 versions
  700. results in only 6 warnings:</p>
  701. <pre>
  702. &gt; python "/path/to/metrix++.py" limit --db-file=boost_1_54_0/metrixpp.db --db-file-prev=boost_1_52_0/metrixpp.db --max-limit=std.code.complexity:cyclomatic:15 --warn-mode=touched
  703. </pre>
  704. <pre>
  705. ./interprocess/detail/managed_open_or_create_impl.hpp:302: warning: Metric 'std.code.complexity:cyclomatic' for region 'priv_open_or_create' exceeds the limit.
  706. Metric name : std.code.complexity:cyclomatic
  707. Region name : priv_open_or_create
  708. Metric value : 37
  709. Modified : True
  710. Change trend : +1
  711. Limit : 15.0
  712. Suppressed : False
  713. ./interprocess/ipc/message_queue.hpp:375: warning: Metric 'std.code.complexity:cyclomatic' for region 'insert_at' exceeds the limit.
  714. Metric name : std.code.complexity:cyclomatic
  715. Region name : insert_at
  716. Metric value : 16
  717. Modified : True
  718. Change trend : 0
  719. Limit : 15.0
  720. Suppressed : False
  721. ./interprocess/mapped_region.hpp:575: warning: Metric 'std.code.complexity:cyclomatic' for region 'mapped_region' exceeds the limit.
  722. Metric name : std.code.complexity:cyclomatic
  723. Region name : mapped_region
  724. Metric value : 18
  725. Modified : True
  726. Change trend : +2
  727. Limit : 15.0
  728. Suppressed : False
  729. ./interprocess/mem_algo/detail/mem_algo_common.hpp:452: warning: Metric 'std.code.complexity:cyclomatic' for region 'priv_allocate_many' exceeds the limit.
  730. Metric name : std.code.complexity:cyclomatic
  731. Region name : priv_allocate_many
  732. Metric value : 20
  733. Modified : True
  734. Change trend : 0
  735. Limit : 15.0
  736. Suppressed : False
  737. ./interprocess/mem_algo/rbtree_best_fit.hpp:787: warning: Metric 'std.code.complexity:cyclomatic' for region 'priv_expand_both_sides' exceeds the limit.
  738. Metric name : std.code.complexity:cyclomatic
  739. Region name : priv_expand_both_sides
  740. Metric value : 17
  741. Modified : True
  742. Change trend : 0
  743. Limit : 15.0
  744. Suppressed : False
  745. ./interprocess/sync/windows/named_sync.hpp:98: warning: Metric 'std.code.complexity:cyclomatic' for region 'open_or_create' exceeds the limit.
  746. Metric name : std.code.complexity:cyclomatic
  747. Region name : open_or_create
  748. Metric value : 18
  749. Modified : True
  750. Change trend : 0
  751. Limit : 15.0
  752. Suppressed : False
  753. </pre>
  754. <p>If it is challenging or not beneficial to refactor everything touched,
  755. --warn-mode=trends simplifies the control over modified regions and only makes sure
  756. that there are no regressions in modified code. In other words, a warning is printed about modified region/file
  757. only if a metric exceeds the specified limit and the value of the metric has got negative trend in modification.
  758. It is possible to apply it anytime with zero initial investment and almost zero on-going investment around old code.
  759. For example, applying it to boost interprocess library for a changes between 1.52 and 1.54 versions
  760. results in only 2 warnings:</p>
  761. <pre>
  762. &gt; python "/path/to/metrix++.py" limit --db-file=boost_1_54_0/metrixpp.db --db-file-prev=boost_1_52_0/metrixpp.db --max-limit=std.code.complexity:cyclomatic:15 --warn-mode=trend
  763. </pre>
  764. <pre>
  765. ./interprocess/detail/managed_open_or_create_impl.hpp:302: warning: Metric 'std.code.complexity:cyclomatic' for region 'priv_open_or_create' exceeds the limit.
  766. Metric name : std.code.complexity:cyclomatic
  767. Region name : priv_open_or_create
  768. Metric value : 37
  769. Modified : True
  770. Change trend : +1
  771. Limit : 15.0
  772. Suppressed : False
  773. ./interprocess/mapped_region.hpp:575: warning: Metric 'std.code.complexity:cyclomatic' for region 'mapped_region' exceeds the limit.
  774. Metric name : std.code.complexity:cyclomatic
  775. Region name : mapped_region
  776. Metric value : 18
  777. Modified : True
  778. Change trend : +2
  779. Limit : 15.0
  780. Suppressed : False
  781. </pre>
  782. <p>--warn-mode=new drops control over existing code and ensures that warnings are only about new code.
  783. For example, applying it to boost interprocess library for a changes between 1.52 and 1.54 versions
  784. results in 0 warnings, so new code is totally compliant with the standard required in the example.</p>
  785. <pre>
  786. &gt; python "/path/to/metrix++.py" limit --db-file=boost_1_54_0/metrixpp.db --db-file-prev=boost_1_52_0/metrixpp.db --max-limit=std.code.complexity:cyclomatic:15 --warn-mode=new
  787. </pre>
  788. <h4>Suppressions</h4>
  789. <p>It is possible to suppress warnings on exceptional basis. Suppressions are collected from comments in code
  790. and used by the 'limit' tool to filter out unnecessary (suppressed) warnings.
  791. It allows to take fine grained control over false-positive warnings, if there are.</p>
  792. <p>In order to suppress a warning:</p>
  793. <ul>
  794. <li>per region metrics: put the metrix++ instruction in the comments before the region, for example:</li>
  795. <pre class="prettyprint linenums">
  796. // This function returns string typed
  797. // representation of a name of a color,
  798. // requested by color's id
  799. // metrix++: suppress std.code.complexity:cyclomatic
  800. std::string getColorName(int color_id)
  801. {
  802. switch (color_id)
  803. {
  804. case COLOR_RED:
  805. return std::string("red")
  806. case COLOR_GREEN:
  807. return std::string("green")
  808. case COLOR_BLUE:
  809. return std::string("blue")
  810. /* and so on */
  811. }
  812. }
  813. </pre>
  814. <li>per file metrics: put the metrix++ instruction in the comments at the beginning of a file, for example:</li>
  815. <pre class="prettyprint linenums">
  816. //
  817. // This file does processing of colors and brushes
  818. // Copyright is my company, 2013
  819. //
  820. // However, it is too long and big file, and there is no time
  821. // to split it into multiple file, so shut up the metrix++ warnings:
  822. // metrix++: suppress std.general:size
  823. //
  824. std::string getColorName(int color_id)
  825. {
  826. ...
  827. ...
  828. </pre>
  829. <li>activate collection of suppressions:</li>
  830. <pre>
  831. &gt; python "/path/to/metrix++.py" collect --std.suppress
  832. </pre>
  833. <li>run the 'limit' tool WITHOUT --disable-suppressions option:</li>
  834. <pre>
  835. &gt; python "/path/to/metrix++.py" limit ...
  836. </pre>
  837. </ul>
  838. <h5>Important notice:</h5>
  839. <ul><li>--std.suppress option enables collection of 2 metrics as well: 'std.suppress:count' and
  840. 'std.suppress.file:count'. The first is number of suppressions per region.
  841. The second is the same but applies to file-scope metrics.
  842. It allows to manage the amount of suppressions.
  843. Usually there are no false-positives to suppress with the <strong>right</strong> metric,
  844. but could be exceptions in specific cases. Managing suppressions is about managing exceptions.
  845. If there are many exceptional cases, maybe something is wrong with a metric or an application of a metric.
  846. Two code examples about colors above do not demonstrate the technically exceptional case,
  847. they likely demonstrate a case of a process exception, like "there is no time to do it proper now", or
  848. a case of wrong application of a metric, like "shut up the useless tool". So, be careful.
  849. The 'view' tool shows number of suppressions and its change trends on per metric basis.</li></ul>
  850. </section>
  851. <section id="workflow_other_section">
  852. <h2>Other applications</h2>
  853. <h3>Checking data file properties</h3>
  854. <p>Metrix++ 'info' tool is helpful to check properties of a data file, like settings used to write it,
  855. colected metrics and files processed. For example:</p>
  856. <pre>
  857. &gt; python "/path/to/metrix++.py" info --db-file=boost_1_54_0/metrixpp.db
  858. </pre>
  859. <pre>
  860. boost_1_54_0/metrixpp.db:: info: Created using plugins and settings:
  861. version : 1.0
  862. std.code.complexity:version: 1.1
  863. std.code.cpp:version: 1.1
  864. std.code.cpp:files: *.c,*.cc,*.cpp,*.cxx,*.h,*.hh,*.hpp,*.hxx
  865. std.code.cs:version: 1.0
  866. std.code.cs:files: *.cs
  867. std.code.java:version: 1.1
  868. std.code.java:files: *.java
  869. std.code.lines:version: 1.1
  870. test_workflow.db:: info: Collected metrics:
  871. std.code.complexity:cyclomatic:
  872. std.code.lines:code:
  873. :: info: Processed files and checksums:
  874. ./interprocess/allocators/detail/node_pool.hpp: 0xb099a7c3
  875. ./interprocess/allocators/detail/node_tools.hpp: 0xaaf5044d
  876. ./interprocess/anonymous_shared_memory.hpp: 0x2bf06cb0
  877. ./interprocess/containers/allocation_type.hpp: 0x8e95cda0
  878. ./interprocess/containers/containers_fwd.hpp: 0xa4d0d9f7
  879. ./interprocess/containers/deque.hpp: 0x6dbb77af
  880. ./interprocess/containers/flat_map.hpp: 0x6750338c
  881. ...
  882. </pre>
  883. <h3>Exporting results</h3>
  884. <p>Metrix++ 'export' tool exports data files to csv formated files. For example:</p>
  885. <pre>
  886. &gt; python "/path/to/metrix++.py" export --db-file=boost_1_54_0/metrixpp.db > boost_1_54_0/metrixpp.csv
  887. </pre>
  888. <pre>
  889. file,region,type,modified,line start,line end,std.code.complexity:cyclomatic,std.code.lines:code
  890. ./interprocess/allocators/detail/node_pool.hpp,__global__,global,,1,110,,0
  891. ./interprocess/allocators/detail/node_pool.hpp,boost,namespace,,33,105,,2
  892. ./interprocess/allocators/detail/node_pool.hpp,interprocess,namespace,,34,104,,2
  893. ./interprocess/allocators/detail/node_pool.hpp,ipcdetail,namespace,,35,103,,4
  894. ./interprocess/allocators/detail/node_pool.hpp,SegmentManager,class,,39,72,,16
  895. ...
  896. </pre>
  897. <p>Files with csv format can be opened by applications, like Microsoft Office Excel, with advanced analysis capabilities.
  898. For example, to draw this distribution graph:</p>
  899. <p align="center"><img src="assets/img/piechart.png"/></p>
  900. <p>It is not recommended to use export tool to implement custom post-analysis Metrix++ extensions.
  901. The main reason is non granted backward compatibility support for csv columns. Another main reason is that
  902. exporting is relatively slow process. It is recommended to use Metrix++ extensions API instead.</p>
  903. </section>
  904. <section id="extend_section">
  905. <div class="page-header">
  906. <h1>Create plugin</h1>
  907. </div>
  908. <h2>New metric</h2>
  909. <p>describe METRIXPLUSPLUS_PATH environment variable</p>
  910. <h2>New language</h2>
  911. <p>...</p>
  912. <h2>New analysis tool</h2>
  913. <p>...</p>
  914. </section>
  915. <section id="contribute_section">
  916. <div class="page-header">
  917. <h1>Feeback and contribute</h1>
  918. </div>
  919. <p>Now it is your turn. There are multiple ways how you can contribute and help to improve and progress Metrix++ project:</p>
  920. <ul>
  921. <li>Try Metrix++ and <a href="https://sourceforge.net/projects/metrixplusplus/reviews/new">post review</a></li>
  922. <li><a href="https://sourceforge.net/p/metrixplusplus/tickets/new/">Submit new feature request or bug report</a></li>
  923. <li><a href="https://sourceforge.net/p/metrixplusplus/tickets/new/">Ask a question</a></li>
  924. <li>Share your patch files and ideas, colloborate by email to
  925. <a href="mailto:avkonst@users.sourceforge.net?subject=Metrix%2B%2B Project Request">project administrator</a></li>
  926. <li>Create and publish your plugin.
  927. <a href="mailto:avkonst@users.sourceforge.net?subject=Metrix%2B%2B Plugin Reference">Request to refer</a>
  928. to it from Metrix++ project space.</li>
  929. <li><a href="mailto:avkonst@users.sourceforge.net?subject=Metrix%2B%2B Plugin Submission">Submit your plugin</a>
  930. to include to the standard set</li>
  931. <li>... and consider to
  932. <a href="mailto:avkonst@users.sourceforge.net?subject=Metrix%2B%2B Join Request">join the project</a>!</li>
  933. </ul>
  934. </section>
  935. </div> <!-- end for sections -->
  936. </div></div> <!-- end for row and container -->
  937. <!-- Footer
  938. ================================================== -->
  939. <footer class="footer">
  940. <div class="container">
  941. <div class="row">
  942. <div class="span3">
  943. <p><a href="http://sourceforge.net/projects/metrixplusplus/"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=275605&amp;type=3"
  944. alt="Get Metrix++ at SourceForge.net. Fast, secure and Free Open Source software downloads" border="0"></a></p>
  945. <p>&middot;</p>
  946. <p>&middot; &middot;<script type="text/javascript" src="http://www.ohloh.net/p/485947/widgets/project_users_logo.js"></script></p>
  947. <p><a href="http://freecode.com/projects/metrix"><img src="assets/img/fm_logo.png" width="130"></a></p>
  948. <p>&middot;</p>
  949. </div>
  950. <div class="span9">
  951. <p>Copyright <strong>&copy;</strong> 2009 - 2013, <a href="mailto:avkonst@users.sourceforge.net"><span class="normalImportance">Metrix++</span> Project</a></p>
  952. <p>Code licensed under <a href="http://www.gnu.org/licenses/gpl.txt" target="_blank">GPL 3.0</a>, documentation under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
  953. <ul class="footer-links">
  954. <li><a href="https://sourceforge.net/p/metrixplusplus/tickets/new/">Ask question</a></li>
  955. <li class="muted">&middot;</li>
  956. <li><a href="https://sourceforge.net/p/metrixplusplus/tickets/new/">Report defect</a></li>
  957. <li class="muted">&middot;</li>
  958. <li><a href="https://sourceforge.net/p/metrixplusplus/tickets/new/">Feature request</a></li>
  959. <li class="muted">&middot;</li>
  960. <li><a href="https://sourceforge.net/p/metrixplusplus/tickets/search/?q=%21status%3Awont-fix+%26%26+%21status%3Aclosed">Open issues</a></li>
  961. <li class="muted">&middot;</li>
  962. <li><a href="https://sourceforge.net/p/metrixplusplus/wiki/ChangeLog/">Changelog</a></li>
  963. </ul>
  964. </div>
  965. </div>
  966. </div>
  967. </footer>
  968. <!-- Le javascript
  969. ================================================== -->
  970. <!-- Placed at the end of the document so the pages load faster -->
  971. <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
  972. <script src="assets/js/jquery.js"></script>
  973. <script src="assets/js/bootstrap-transition.js"></script>
  974. <script src="assets/js/bootstrap-alert.js"></script>
  975. <script src="assets/js/bootstrap-modal.js"></script>
  976. <script src="assets/js/bootstrap-dropdown.js"></script>
  977. <script src="assets/js/bootstrap-scrollspy.js"></script>
  978. <script src="assets/js/bootstrap-tab.js"></script>
  979. <script src="assets/js/bootstrap-tooltip.js"></script>
  980. <script src="assets/js/bootstrap-popover.js"></script>
  981. <script src="assets/js/bootstrap-button.js"></script>
  982. <script src="assets/js/bootstrap-collapse.js"></script>
  983. <script src="assets/js/bootstrap-carousel.js"></script>
  984. <script src="assets/js/bootstrap-typeahead.js"></script>
  985. <script src="assets/js/bootstrap-affix.js"></script>
  986. <script>
  987. !function ($) {
  988. $(function(){
  989. // carousel demo
  990. $('#myCarousel').carousel()
  991. })
  992. }(window.jQuery)
  993. </script>
  994. <script src="assets/js/holder/holder.js"></script>
  995. <script src="assets/js/google-code-prettify/prettify.js"></script>
  996. <script src="assets/js/application.js"></script>
  997. <script>
  998. </script>
  999. <!-- Analytics
  1000. ================================================== -->
  1001. <!--
  1002. <script>
  1003. var _gauges = _gauges || [];
  1004. (function() {
  1005. var t = document.createElement('script');
  1006. t.type = 'text/javascript';
  1007. t.async = true;
  1008. t.id = 'gauges-tracker';
  1009. t.setAttribute('data-site-id', '4f0dc9fef5a1f55508000013');
  1010. t.src = '//secure.gaug.es/track.js';
  1011. var s = document.getElementsByTagName('script')[0];
  1012. s.parentNode.insertBefore(t, s);
  1013. })();
  1014. </script>
  1015. -->
  1016. </body>
  1017. </html>