home.html 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077
  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 == 6 || day == 7) {
  316. return true;
  317. }
  318. return false;
  319. }
  320. </pre>
  321. </td>
  322. </tr>
  323. <tr>
  324. <td>std.suppress</td>
  325. <td>An option enables collection of Metrix++ suppressions and 2 metrics: 'std.suppress:count' and
  326. 'std.suppress.file:count'. The first is number of suppressions per region.
  327. The second is the same but applies for file-scope metrics.</td>
  328. <td><ul><li>Suppressing false-positives.</li>
  329. <li>Managing the amount of suppressions. Usually there are no false-positives to suppress with the right metric,
  330. but could be exceptions in specific cases. Managing suppressions is about managing exceptions.
  331. If there are many exceptional cases, maybe something is wrong with a metric or an application of a metric.</li></ul></td>
  332. </tr>
  333. <tr class="info">
  334. <td>std.general.procerrors</td>
  335. <td>Number of errors detected by Metrix++ code parser.
  336. Errors, like mismatched brackets, may result in bad identification of regions.</td>
  337. <td><ul><li>Cleaning up errors to ensure reliable code scanning.</li></ul></td>
  338. </tr>
  339. <tr class="info">
  340. <td>std.general.proctime</td>
  341. <td>Seconds spent on processing a file.</td>
  342. <td><ul><li>Monitor and profile tool's performance.</li></ul></td>
  343. </tr>
  344. </tbody>
  345. </table>
  346. </section>
  347. <section id="download_section">
  348. <div class="page-header">
  349. <h1>Download &amp; Install</h1>
  350. </div>
  351. <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
  352. and unpack it to some folder. First run of the tool will trigger the installation within the folder,
  353. where it was launched.</p>
  354. <p>Corresponding checkout from the <a href="https://sourceforge.net/p/metrixplusplus/code">version control system</a> is the following:</p>
  355. <pre>svn checkout <a href="https://sourceforge.net/p/metrixplusplus/code">svn://svn.code.sf.net/p/metrixplusplus/code</a>/releases/latest Metrix++</pre>
  356. <p>In order to checkout the latest version under development, use this command:</p>
  357. <pre>svn checkout <a href="https://sourceforge.net/p/metrixplusplus/code">svn://svn.code.sf.net/p/metrixplusplus/code</a>/mainline Metrix++</pre>
  358. <h4>Prerequisites</h4>
  359. <p>Python Runtime Environment (version 2.7.* or later, version 3.* has not been tested)</p>
  360. <h4>License</h4>
  361. <p>This program is free software; you can redistribute it and/or modify it
  362. under the terms of the GNU General Public License as published by the
  363. Free Software Foundation; version 3 of the License.</p>
  364. <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  365. without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  366. See the GNU General Public License for more details.</p>
  367. <p>You should have received a copy of the GNU General Public License along with the Metrix++;
  368. if not, contact <a href="mailto:avkonst@users.sourceforge.net?subject=Metrix%2B%2B License">Project Administrator</a></p>
  369. </section>
  370. <div class="page-header">
  371. <h1>Workflow</h1>
  372. </div>
  373. <p>The workflow and application usecases are demonstrated using source code of
  374. <a href="http://www.boost.org/doc/libs/1_54_0/doc/html/interprocess.html">boost/interprocess</a> library.
  375. Boost versions 1.52 and 1.54 are used and refered below as 'previous' and 'current' accordingly.</p>
  376. <section id="workflow_collect_section">
  377. <h2>Collect data</h2>
  378. <p>The first obvious step is to collect the data.
  379. The 'collect' tool has got multiple options to enable various metrics plugins.
  380. Let's collect number of lines of code and cyclomatic complexity metrics
  381. for the previous (1.52.0 version) boost interprocess library. Assuming that 2 versions of boost library
  382. are unpacked in the current working directory:</p>
  383. <pre>
  384. &gt; cd boost_1_52_0
  385. &gt; python "/path/to/metrix++.py" collect --std.code.lines.code --std.code.complexity.cyclomatic -- boost/interprocess
  386. &gt; cd ../ # return back to working directory
  387. </pre>
  388. <p>The list of arguments after '--' enumerates paths where to read source files.
  389. As a result of execution of this command, a file metrixpp.db will be written in the current working directory.
  390. It can be redefined with help of --db-file option.</p>
  391. <p>Metrix++ has got rich functionality in comparing code bases and reducing processing scope to modified or new code.
  392. So, let's collect the same data for the current (1.54.0 version) boost interprocess library.</p>
  393. <pre>
  394. &gt; cd boost_1_54_0
  395. &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
  396. &gt; cd ../ # return back to working directory
  397. </pre>
  398. <p>The option --db-file-prev points out to the file with data collected in the previous step.
  399. So, eventually it executed iterative collection. It can speed up the exectuion significantly,
  400. depending on amount of changes between two version.</p>
  401. <p>Check other options of the collect tool by executing:</p>
  402. <pre>
  403. &gt; python "/path/to/metrix++.py" collect --help
  404. </pre>
  405. </section>
  406. <section id="workflow_view_section">
  407. <h2>View data</h2>
  408. </section>
  409. <section id="workflow_view_summary_section">
  410. <h3>Summary metrics and distribution tables/graphs</h3>
  411. <p>It is time to look at the data files collected (step above). The command:</p>
  412. <pre>
  413. &gt; python "/path/to/metrix++.py" view --db-file=boost_1_54_0/metrixpp.db
  414. </pre>
  415. <p>prints summary metrics, like minimum/maximum, and distribution/frequency tables:</p>
  416. <pre>
  417. :: info: Overall metrics for 'std.code.complexity:cyclomatic' metric
  418. Average : 0.652902698283
  419. Minimum : 0
  420. Maximum : 37
  421. Total : 1597.0
  422. Distribution : 2446 regions in total (including 0 suppressed)
  423. Metric value : Ratio : R-sum : Number of regions
  424. 0 : 0.771 : 0.771 : 1886 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  425. 1 : 0.110 : 0.881 : 268 |||||||||||
  426. 2 : 0.044 : 0.925 : 108 ||||
  427. 3 : 0.025 : 0.949 : 60 ||
  428. 4 : 0.016 : 0.966 : 40 ||
  429. 5 : 0.007 : 0.973 : 18 |
  430. 6 : 0.006 : 0.979 : 14 |
  431. 7 : 0.004 : 0.983 : 10
  432. 8 : 0.003 : 0.986 : 8
  433. 9 : 0.002 : 0.988 : 4
  434. 10 : 0.004 : 0.991 : 9
  435. 11 : 0.002 : 0.993 : 4
  436. 12 : 0.001 : 0.994 : 3
  437. 13 : 0.001 : 0.995 : 2
  438. 14 : 0.001 : 0.996 : 2
  439. 15-16 : 0.001 : 0.997 : 3
  440. 17-18 : 0.001 : 0.998 : 3
  441. 20 : 0.000 : 0.999 : 1
  442. 23-25 : 0.001 : 1.000 : 2
  443. 37 : 0.000 : 1.000 : 1
  444. :: info: Overall metrics for 'std.code.lines:code' metric
  445. Average : 6.64356984479
  446. Minimum : 0
  447. Maximum : 201
  448. Total : 23970.0
  449. Distribution : 3608 regions in total (including 0 suppressed)
  450. Metric value : Ratio : R-sum : Number of regions
  451. 0-1 : 0.088 : 0.088 : 319 |||||||||
  452. 2 : 0.320 : 0.409 : 1155 ||||||||||||||||||||||||||||||||
  453. 3 : 0.108 : 0.517 : 390 |||||||||||
  454. 4 : 0.081 : 0.598 : 294 ||||||||
  455. 5 : 0.080 : 0.678 : 290 ||||||||
  456. 6 : 0.061 : 0.739 : 220 ||||||
  457. 7 : 0.049 : 0.788 : 176 |||||
  458. 8 : 0.030 : 0.818 : 109 |||
  459. 9 : 0.025 : 0.843 : 89 ||
  460. 10-11 : 0.032 : 0.876 : 117 |||
  461. 12-13 : 0.020 : 0.895 : 71 ||
  462. 14 : 0.012 : 0.907 : 43 |
  463. 15-16 : 0.017 : 0.924 : 61 ||
  464. 17-19 : 0.015 : 0.939 : 55 ||
  465. 20-22 : 0.013 : 0.952 : 46 |
  466. 23-26 : 0.011 : 0.963 : 40 |
  467. 27-30 : 0.009 : 0.972 : 33 |
  468. 31-39 : 0.009 : 0.981 : 33 |
  469. 40-65 : 0.009 : 0.991 : 34 |
  470. 66-201 : 0.009 : 1.000 : 33 |
  471. :: info: Directory content:
  472. Directory : .
  473. </pre>
  474. <p>The same command with --db-file-prev option enables comparision and change trends are shown in [] brackets:</p>
  475. <pre>
  476. &gt; python "/path/to/metrix++.py" view --db-file=boost_1_54_0/metrixpp.db --db-file-prev=boost_1_52_0/metrixpp.db
  477. </pre>
  478. <pre>
  479. :: info: Overall metrics for 'std.code.complexity:cyclomatic' metric
  480. Average : 0.652902698283 [+0.00362138411453]
  481. Minimum : 0 [+0]
  482. Maximum : 37 [+1]
  483. Total : 1597.0 [+16.0]
  484. Distribution : 2446 [+11] regions in total (including 0 [+0] suppressed)
  485. Metric value : Ratio : R-sum : Number of regions
  486. 0 : 0.771 : 0.771 : 1886 [+5 ] |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  487. 1 : 0.110 : 0.881 : 268 [+4 ] |||||||||||
  488. 2 : 0.044 : 0.925 : 108 [+0 ] ||||
  489. 3 : 0.025 : 0.949 : 60 [+2 ] ||
  490. 4 : 0.016 : 0.966 : 40 [-1 ] ||
  491. 5 : 0.007 : 0.973 : 18 [-1 ] |
  492. 6 : 0.006 : 0.979 : 14 [+1 ] |
  493. 7 : 0.004 : 0.983 : 10 [+1 ]
  494. 8 : 0.003 : 0.986 : 8 [+1 ]
  495. 9 : 0.002 : 0.988 : 4 [+0 ]
  496. 10 : 0.004 : 0.991 : 9 [-2 ]
  497. 11 : 0.002 : 0.993 : 4 [+1 ]
  498. 12 : 0.001 : 0.994 : 3 [+0 ]
  499. 13 : 0.001 : 0.995 : 2 [+0 ]
  500. 14 : 0.001 : 0.996 : 2 [+0 ]
  501. 15-16 : 0.001 : 0.997 : 3 [-1 ]
  502. 17-18 : 0.001 : 0.998 : 3 [+1 ]
  503. 20 : 0.000 : 0.999 : 1 [+0 ]
  504. 23-25 : 0.001 : 1.000 : 2 [+0 ]
  505. 36-37 : 0.000 : 1.000 : 1 [+0 ]
  506. :: info: Overall metrics for 'std.code.lines:code' metric
  507. Average : 6.64356984479 [+0.012181964309]
  508. Minimum : 0 [+0]
  509. Maximum : 201 [+4]
  510. Total : 23970.0 [+223.0]
  511. Distribution : 3608 [+27] regions in total (including 0 [+0] suppressed)
  512. Metric value : Ratio : R-sum : Number of regions
  513. 0-1 : 0.088 : 0.088 : 319 [+3 ] |||||||||
  514. 2 : 0.320 : 0.409 : 1155 [+9 ] ||||||||||||||||||||||||||||||||
  515. 3 : 0.108 : 0.517 : 390 [-3 ] |||||||||||
  516. 4 : 0.081 : 0.598 : 294 [+7 ] ||||||||
  517. 5 : 0.080 : 0.678 : 290 [+7 ] ||||||||
  518. 6 : 0.061 : 0.739 : 220 [-1 ] ||||||
  519. 7 : 0.049 : 0.788 : 176 [-2 ] |||||
  520. 8 : 0.030 : 0.818 : 109 [-1 ] |||
  521. 9 : 0.025 : 0.843 : 89 [+4 ] ||
  522. 10-11 : 0.032 : 0.876 : 117 [+9 ] |||
  523. 12-13 : 0.020 : 0.895 : 71 [-9 ] ||
  524. 14 : 0.012 : 0.907 : 43 [+0 ] |
  525. 15-16 : 0.017 : 0.924 : 61 [+0 ] ||
  526. 17-19 : 0.015 : 0.939 : 55 [+6 ] ||
  527. 20-22 : 0.013 : 0.952 : 46 [-3 ] |
  528. 23-26 : 0.011 : 0.963 : 40 [+2 ] |
  529. 27-30 : 0.009 : 0.972 : 33 [-3 ] |
  530. 31-39 : 0.009 : 0.981 : 33 [+0 ] |
  531. 40-65 : 0.009 : 0.991 : 34 [+1 ] |
  532. 66-201 : 0.009 : 1.000 : 33 [+1 ] |
  533. :: info: Directory content:
  534. Directory : .
  535. </pre>
  536. <h4>Reducing analysis scope</h4>
  537. <p>There are two ways to reduce the analysis scope for the view tool. The first is to enumerate paths of interest.
  538. For example, the following command reduces scope to 'allocators' sub-directory within the processed code.</p>
  539. <pre>
  540. &gt; python "/path/to/metrix++.py" view --db-file=boost_1_54_0/metrixpp.db -- ./boost/interprocess/allocators
  541. </pre>
  542. <p>The second is to specify --scope-mode option, which instructs the tool to process only modified and/or new files/regions.
  543. For example, view the summary metrics for all modified and new regions:</p>
  544. <pre>
  545. &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
  546. </pre>
  547. <pre>
  548. :: info: Overall metrics for 'std.code.complexity:cyclomatic' metric
  549. Average : 1.84924623116 [-0.0230941943761]
  550. Minimum : 0 [+0]
  551. Maximum : 37 [+1]
  552. Total : 368.0 [+16.0]
  553. Distribution : 199 [+11] regions in total (including 0 [+0] suppressed)
  554. Metric value : Ratio : R-sum : Number of regions
  555. 0 : 0.608 : 0.608 : 121 [+5 ] |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  556. 1 : 0.131 : 0.739 : 26 [+4 ] |||||||||||||
  557. 2 : 0.070 : 0.809 : 14 [+0 ] |||||||
  558. 3 : 0.060 : 0.869 : 12 [+2 ] ||||||
  559. 4 : 0.015 : 0.884 : 3 [-1 ] ||
  560. 5 : 0.015 : 0.899 : 3 [-1 ] ||
  561. 6 : 0.005 : 0.905 : 1 [+1 ] |
  562. 7 : 0.015 : 0.920 : 3 [+1 ] ||
  563. 8 : 0.015 : 0.935 : 3 [+1 ] ||
  564. 9 : 0.010 : 0.945 : 2 [+0 ] |
  565. 10 : 0.010 : 0.955 : 2 [-2 ] |
  566. 11 : 0.005 : 0.960 : 1 [+1 ] |
  567. 12 : 0.005 : 0.965 : 1 [+0 ] |
  568. 13 : 0.005 : 0.970 : 1 [+0 ] |
  569. 16 : 0.005 : 0.975 : 1 [-1 ] |
  570. 17 : 0.005 : 0.980 : 1 [+0 ] |
  571. 18 : 0.010 : 0.990 : 2 [+1 ] |
  572. 20 : 0.005 : 0.995 : 1 [+0 ] |
  573. 36-37 : 0.005 : 1.000 : 1 [+0 ] |
  574. :: info: Overall metrics for 'std.code.lines:code' metric
  575. Average : 15.9645390071 [-0.815853149771]
  576. Minimum : 0 [+0]
  577. Maximum : 201 [+6]
  578. Total : 4502.0 [+223.0]
  579. Distribution : 282 [+27] regions in total (including 0 [+0] suppressed)
  580. Metric value : Ratio : R-sum : Number of regions
  581. 0-1 : 0.053 : 0.053 : 15 [+3 ] |||||
  582. 2 : 0.124 : 0.177 : 35 [+9 ] ||||||||||||
  583. 3 : 0.053 : 0.230 : 15 [-3 ] |||||
  584. 4 : 0.060 : 0.291 : 17 [+7 ] ||||||
  585. 5 : 0.089 : 0.379 : 25 [+7 ] |||||||||
  586. 6 : 0.060 : 0.440 : 17 [-1 ] ||||||
  587. 7 : 0.050 : 0.489 : 14 [-2 ] |||||
  588. 8-9 : 0.074 : 0.564 : 21 [+3 ] |||||||
  589. 10 : 0.035 : 0.599 : 10 [+5 ] ||||
  590. 11 : 0.082 : 0.681 : 23 [+4 ] ||||||||
  591. 12-13 : 0.043 : 0.723 : 12 [-9 ] ||||
  592. 14-15 : 0.039 : 0.762 : 11 [-1 ] ||||
  593. 16-18 : 0.028 : 0.791 : 8 [+4 ] |||
  594. 19-22 : 0.039 : 0.830 : 11 [+0 ] ||||
  595. 23-26 : 0.039 : 0.869 : 11 [+2 ] ||||
  596. 27-32 : 0.028 : 0.897 : 8 [-3 ] |||
  597. 38-50 : 0.025 : 0.922 : 7 [+0 ] ||
  598. 51-69 : 0.025 : 0.947 : 7 [+1 ] ||
  599. 71-100 : 0.032 : 0.979 : 9 [+2 ] |||
  600. 101-201 : 0.021 : 1.000 : 6 [-1 ] ||
  601. :: info: Directory content:
  602. Directory : .
  603. </pre>
  604. </section>
  605. <section id="workflow_view_details_section">
  606. <h3>Detailed metrics per file/region</h3>
  607. <p>The same view tool can print detailed metrics per file and per every region in the specified file.
  608. In order to get detailed metrics, enumerate files of interest after '--'. For example:</p>
  609. <pre>
  610. &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
  611. </pre>
  612. <p>produces output similar to this (truncated to make the page shorter):</p>
  613. <pre>
  614. ./interprocess/detail/managed_open_or_create_impl.hpp:302: info: Metrics per 'priv_open_or_create' region
  615. Region name : priv_open_or_create
  616. Region type : function
  617. Offsets : 8314-14526
  618. Line numbers : 301-467
  619. Modified : True
  620. std.code.complexity:cyclomatic: 37 [+1]
  621. std.code.lines:code: 148 [+4]
  622. </pre>
  623. </section>
  624. <section>
  625. <h3>More about the viewer</h3>
  626. <p>The 'view' command has got an option to alter the output format. It is possible to get the same data
  627. in xml pr python disctionary formats. This can be particularly useful for integration of the tool with
  628. other applications. For example, an editor may re-collect and show context based metrics when a file is saved.</p>
  629. <pre>
  630. &gt; python "/path/to/metrix++.py" view --db-file=boost_1_54_0/metrixpp.db --format=xml
  631. </pre>
  632. <p>Check other options of the view tool by executing:</p>
  633. <pre>
  634. &gt; python "/path/to/metrix++.py" view --help
  635. </pre>
  636. </section>
  637. <section id="workflow_limit_section">
  638. <h2>Apply thresholds</h2>
  639. <p>The viewer shows (above) that there are function with quite large value of cyclomatic complexity metric.
  640. Growth of this metric can be considered as negative trend. Metrix++ 'limit' tool offers the capability
  641. to organise the control over trends by applying limits to metric values.
  642. Exceeded limites are alarms in the quality management and control.</p>
  643. </section>
  644. <section id="workflow_limit_hotspots_section">
  645. <h3>Hotspots</h3>
  646. <p>Hotspots mode of the limit tool helps to identify top files/regions exceeding a metric threshold.
  647. Let's identify top 3 functions in boost interprocess library, which exceed limit of 15 points of
  648. cyclomatic complexity metric:</p>
  649. <pre>
  650. &gt; python "/path/to/metrix++.py" limit --db-file=boost_1_54_0/metrixpp.db --max-limit=std.code.complexity:cyclomatic:15 --hotspots=3
  651. </pre>
  652. <pre>
  653. ./interprocess/detail/managed_open_or_create_impl.hpp:302: warning: Metric 'std.code.complexity:cyclomatic' for region 'priv_open_or_create' exceeds the limit.
  654. Metric name : std.code.complexity:cyclomatic
  655. Region name : priv_open_or_create
  656. Metric value : 37
  657. Modified : None
  658. Change trend : None
  659. Limit : 15.0
  660. Suppressed : False
  661. ./interprocess/streams/vectorstream.hpp:284: warning: Metric 'std.code.complexity:cyclomatic' for region 'seekoff' exceeds the limit.
  662. Metric name : std.code.complexity:cyclomatic
  663. Region name : seekoff
  664. Metric value : 25
  665. Modified : None
  666. Change trend : None
  667. Limit : 15.0
  668. Suppressed : False
  669. ./interprocess/streams/bufferstream.hpp:174: warning: Metric 'std.code.complexity:cyclomatic' for region 'seekoff' exceeds the limit.
  670. Metric name : std.code.complexity:cyclomatic
  671. Region name : seekoff
  672. Metric value : 23
  673. Modified : None
  674. Change trend : None
  675. Limit : 15.0
  676. Suppressed : False
  677. </pre>
  678. </section>
  679. <section id="workflow_limit_control_section">
  680. <h3>Controlling trends</h3>
  681. <p>Exit code of the 'limit' tool is equal to number of warnings printed. This allows to use the tool
  682. as a static analysis tool during software build process. In this case, non-zero exit code means
  683. that there are violations to the agreed standards and it may fail the build. So, the same command
  684. without --hotspots option will print all regions/files exceeding the specified limit:</p>
  685. <pre>
  686. &gt; python "/path/to/metrix++.py" limit --db-file=boost_1_54_0/metrixpp.db --max-limit=std.code.complexity:cyclomatic:15
  687. </pre>
  688. <h4>Modes to exclude old code from the considiration</h4>
  689. <p>However, it is likely there are many warnings printed in this mode, especially if very old or legacy code is profiled
  690. against new metrics and coding rules. Although all warnings can be removed
  691. by re-factoring in scope of big task force activity, it is where many tools are rejected,
  692. because it is difficult to justify the initial cost of applying and integrating them.
  693. Metrix++ 'limit' tool has got an option --warn-mode, which helps to overcome this problem.</p>
  694. <p>--warn-mode=touched encourages re-factoring only for new and modified regions. It enables
  695. continuous refactoring. It does not matter how late the rule is applied or
  696. coding standard is modified. It is possible to do it anytime with zero initial investment.
  697. For example, applying it to boost interprocess library for a changes between 1.52 and 1.54 versions
  698. results in only 6 warnings:</p>
  699. <pre>
  700. &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
  701. </pre>
  702. <pre>
  703. ./interprocess/detail/managed_open_or_create_impl.hpp:302: warning: Metric 'std.code.complexity:cyclomatic' for region 'priv_open_or_create' exceeds the limit.
  704. Metric name : std.code.complexity:cyclomatic
  705. Region name : priv_open_or_create
  706. Metric value : 37
  707. Modified : True
  708. Change trend : +1
  709. Limit : 15.0
  710. Suppressed : False
  711. ./interprocess/ipc/message_queue.hpp:375: warning: Metric 'std.code.complexity:cyclomatic' for region 'insert_at' exceeds the limit.
  712. Metric name : std.code.complexity:cyclomatic
  713. Region name : insert_at
  714. Metric value : 16
  715. Modified : True
  716. Change trend : 0
  717. Limit : 15.0
  718. Suppressed : False
  719. ./interprocess/mapped_region.hpp:575: warning: Metric 'std.code.complexity:cyclomatic' for region 'mapped_region' exceeds the limit.
  720. Metric name : std.code.complexity:cyclomatic
  721. Region name : mapped_region
  722. Metric value : 18
  723. Modified : True
  724. Change trend : +2
  725. Limit : 15.0
  726. Suppressed : False
  727. ./interprocess/mem_algo/detail/mem_algo_common.hpp:452: warning: Metric 'std.code.complexity:cyclomatic' for region 'priv_allocate_many' exceeds the limit.
  728. Metric name : std.code.complexity:cyclomatic
  729. Region name : priv_allocate_many
  730. Metric value : 20
  731. Modified : True
  732. Change trend : 0
  733. Limit : 15.0
  734. Suppressed : False
  735. ./interprocess/mem_algo/rbtree_best_fit.hpp:787: warning: Metric 'std.code.complexity:cyclomatic' for region 'priv_expand_both_sides' exceeds the limit.
  736. Metric name : std.code.complexity:cyclomatic
  737. Region name : priv_expand_both_sides
  738. Metric value : 17
  739. Modified : True
  740. Change trend : 0
  741. Limit : 15.0
  742. Suppressed : False
  743. ./interprocess/sync/windows/named_sync.hpp:98: warning: Metric 'std.code.complexity:cyclomatic' for region 'open_or_create' exceeds the limit.
  744. Metric name : std.code.complexity:cyclomatic
  745. Region name : open_or_create
  746. Metric value : 18
  747. Modified : True
  748. Change trend : 0
  749. Limit : 15.0
  750. Suppressed : False
  751. </pre>
  752. <p>If it is challenging or not beneficial to refactor everything touched,
  753. --warn-mode=trends simplifies the control over modified regions and only makes sure
  754. that there are no regressions in modified code. In other words, a warning is printed about modified region/file
  755. only if a metric exceeds the specified limit and the value of the metric has got negative trend in modification.
  756. It is possible to apply it anytime with zero initial investment and almost zero on-going investment around old code.
  757. For example, applying it to boost interprocess library for a changes between 1.52 and 1.54 versions
  758. results in only 2 warnings:</p>
  759. <pre>
  760. &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
  761. </pre>
  762. <pre>
  763. ./interprocess/detail/managed_open_or_create_impl.hpp:302: warning: Metric 'std.code.complexity:cyclomatic' for region 'priv_open_or_create' exceeds the limit.
  764. Metric name : std.code.complexity:cyclomatic
  765. Region name : priv_open_or_create
  766. Metric value : 37
  767. Modified : True
  768. Change trend : +1
  769. Limit : 15.0
  770. Suppressed : False
  771. ./interprocess/mapped_region.hpp:575: warning: Metric 'std.code.complexity:cyclomatic' for region 'mapped_region' exceeds the limit.
  772. Metric name : std.code.complexity:cyclomatic
  773. Region name : mapped_region
  774. Metric value : 18
  775. Modified : True
  776. Change trend : +2
  777. Limit : 15.0
  778. Suppressed : False
  779. </pre>
  780. <p>--warn-mode=new drops control over existing code and ensures that warnings are only about new code.
  781. For example, applying it to boost interprocess library for a changes between 1.52 and 1.54 versions
  782. results in 0 warnings, so new code is totally compliant with the standard required in the example.</p>
  783. <pre>
  784. &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
  785. </pre>
  786. <h4>Suppressions</h4>
  787. <p>It is possible to suppress warnings on exceptional basis. Suppressions are collected from comments in code
  788. and used by the 'limit' tool to filter out unnecessary (suppressed) warnings.
  789. It allows to take fine grained control over false-positive warnings, if there are.</p>
  790. <p>In order to suppress a warning:</p>
  791. <ul>
  792. <li>per region metrics: put the metrix++ instruction in the comments before the region, for example:</li>
  793. <pre class="prettyprint linenums">
  794. // This function returns string typed
  795. // representation of a name of a color,
  796. // requested by color's id
  797. // metrix++: suppress std.code.complexity:cyclomatic
  798. std::string getColorName(int color_id)
  799. {
  800. switch (color_id)
  801. {
  802. case COLOR_RED:
  803. return std::string("red")
  804. case COLOR_GREEN:
  805. return std::string("green")
  806. case COLOR_BLUE:
  807. return std::string("blue")
  808. /* and so on */
  809. }
  810. }
  811. </pre>
  812. <li>per file metrics: put the metrix++ instruction in the comments at the beginning of a file, for example:</li>
  813. <pre class="prettyprint linenums">
  814. //
  815. // This file does processing of colors and brushes
  816. // Copyright is my company, 2013
  817. //
  818. // However, it is too long and big file, and there is no time
  819. // to split it into multiple file, so shut up the metrix++ warnings:
  820. // metrix++: suppress std.general:size
  821. //
  822. std::string getColorName(int color_id)
  823. {
  824. ...
  825. ...
  826. </pre>
  827. <li>activate collection of suppressions:</li>
  828. <pre>
  829. &gt; python "/path/to/metrix++.py" collect --std.suppress
  830. </pre>
  831. <li>run the 'limit' tool WITHOUT --disable-suppressions option:</li>
  832. <pre>
  833. &gt; python "/path/to/metrix++.py" limit ...
  834. </pre>
  835. </ul>
  836. <h5>Important notice:</h5>
  837. <ul><li>--std.suppress option enables collection of 2 metrics as well: 'std.suppress:count' and
  838. 'std.suppress.file:count'. The first is number of suppressions per region.
  839. The second is the same but applies to file-scope metrics.
  840. It allows to manage the amount of suppressions.
  841. Usually there are no false-positives to suppress with the <strong>right</strong> metric,
  842. but could be exceptions in specific cases. Managing suppressions is about managing exceptions.
  843. If there are many exceptional cases, maybe something is wrong with a metric or an application of a metric.
  844. Two code examples about colors above do not demonstrate the technically exceptional case,
  845. they likely demonstrate a case of a process exception, like "there is no time to do it proper now", or
  846. a case of wrong application of a metric, like "shut up the useless tool". So, be careful.
  847. The 'view' tool shows number of suppressions and its change trends on per metric basis.</li></ul>
  848. </section>
  849. <section id="workflow_other_section">
  850. <h2>Other applications</h2>
  851. <h3>Checking data file properties</h3>
  852. <p>Metrix++ 'info' tool is helpful to check properties of a data file, like settings used to write it,
  853. colected metrics and files processed. For example:</p>
  854. <pre>
  855. &gt; python "/path/to/metrix++.py" info --db-file=boost_1_54_0/metrixpp.db
  856. </pre>
  857. <pre>
  858. boost_1_54_0/metrixpp.db:: info: Created using plugins and settings:
  859. version : 1.0
  860. std.code.complexity:version: 1.1
  861. std.code.cpp:version: 1.1
  862. std.code.cpp:files: *.c,*.cc,*.cpp,*.cxx,*.h,*.hh,*.hpp,*.hxx
  863. std.code.cs:version: 1.0
  864. std.code.cs:files: *.cs
  865. std.code.java:version: 1.1
  866. std.code.java:files: *.java
  867. std.code.lines:version: 1.1
  868. test_workflow.db:: info: Collected metrics:
  869. std.code.complexity:cyclomatic:
  870. std.code.lines:code:
  871. :: info: Processed files and checksums:
  872. ./interprocess/allocators/detail/node_pool.hpp: 0xb099a7c3
  873. ./interprocess/allocators/detail/node_tools.hpp: 0xaaf5044d
  874. ./interprocess/anonymous_shared_memory.hpp: 0x2bf06cb0
  875. ./interprocess/containers/allocation_type.hpp: 0x8e95cda0
  876. ./interprocess/containers/containers_fwd.hpp: 0xa4d0d9f7
  877. ./interprocess/containers/deque.hpp: 0x6dbb77af
  878. ./interprocess/containers/flat_map.hpp: 0x6750338c
  879. ...
  880. </pre>
  881. <h3>Exporting results</h3>
  882. <p>Metrix++ 'export' tool exports data files to csv formated files. For example:</p>
  883. <pre>
  884. &gt; python "/path/to/metrix++.py" export --db-file=boost_1_54_0/metrixpp.db > boost_1_54_0/metrixpp.csv
  885. </pre>
  886. <pre>
  887. file,region,type,modified,line start,line end,std.code.complexity:cyclomatic,std.code.lines:code
  888. ./interprocess/allocators/detail/node_pool.hpp,__global__,global,,1,110,,0
  889. ./interprocess/allocators/detail/node_pool.hpp,boost,namespace,,33,105,,2
  890. ./interprocess/allocators/detail/node_pool.hpp,interprocess,namespace,,34,104,,2
  891. ./interprocess/allocators/detail/node_pool.hpp,ipcdetail,namespace,,35,103,,4
  892. ./interprocess/allocators/detail/node_pool.hpp,SegmentManager,class,,39,72,,16
  893. ...
  894. </pre>
  895. <p>Files with csv format can be opened by applications, like Microsoft Office Excel, with advanced analysis capabilities.
  896. For example, to draw this distribution graph:</p>
  897. <p align="center"><img src="assets/img/piechart.png"/></p>
  898. <p>It is not recommended to use export tool to implement custom post-analysis Metrix++ extensions.
  899. The main reason is non granted backward compatibility support for csv columns. Another main reason is that
  900. exporting is relatively slow process. It is recommended to use Metrix++ extensions API instead.</p>
  901. </section>
  902. <section id="extend_section">
  903. <div class="page-header">
  904. <h1>Create plugin</h1>
  905. </div>
  906. <h2>New metric</h2>
  907. <p>describe METRIXPLUSPLUS_PATH environment variable</p>
  908. <h2>New language</h2>
  909. <p>...</p>
  910. <h2>New analysis tool</h2>
  911. <p>...</p>
  912. </section>
  913. <section id="contribute_section">
  914. <div class="page-header">
  915. <h1>Feeback and contribute</h1>
  916. </div>
  917. <p>Now it is your turn. There are multiple ways how you can contribute and help to improve and progress Metrix++ project:</p>
  918. <ul>
  919. <li>Try Metrix++ and <a href="https://sourceforge.net/projects/metrixplusplus/reviews/new">post review</a></li>
  920. <li><a href="https://sourceforge.net/p/metrixplusplus/tickets/new/">Submit new feature request or bug report</a></li>
  921. <li><a href="https://sourceforge.net/p/metrixplusplus/tickets/new/">Ask a question</a></li>
  922. <li>Share your patch files and ideas, colloborate by email to
  923. <a href="mailto:avkonst@users.sourceforge.net?subject=Metrix%2B%2B Project Request">project administrator</a></li>
  924. <li>Create and publish your plugin.
  925. <a href="mailto:avkonst@users.sourceforge.net?subject=Metrix%2B%2B Plugin Reference">Request to refer</a>
  926. to it from Metrix++ project space.</li>
  927. <li><a href="mailto:avkonst@users.sourceforge.net?subject=Metrix%2B%2B Plugin Submission">Submit your plugin</a>
  928. to include to the standard set</li>
  929. <li>... and consider to
  930. <a href="mailto:avkonst@users.sourceforge.net?subject=Metrix%2B%2B Join Request">join the project</a>!</li>
  931. </ul>
  932. </section>
  933. </div> <!-- end for sections -->
  934. </div></div> <!-- end for row and container -->
  935. <!-- Footer
  936. ================================================== -->
  937. <footer class="footer">
  938. <div class="container">
  939. <div class="row">
  940. <div class="span3">
  941. <p><a href="http://sourceforge.net/projects/metrixplusplus/"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=275605&amp;type=3"
  942. alt="Get Metrix++ at SourceForge.net. Fast, secure and Free Open Source software downloads" border="0"></a></p>
  943. <p>&middot;</p>
  944. <p>&middot; &middot;<script type="text/javascript" src="http://www.ohloh.net/p/485947/widgets/project_users_logo.js"></script></p>
  945. <p><a href="http://freecode.com/projects/metrix"><img src="assets/img/fm_logo.png" width="130"></a></p>
  946. <p>&middot;</p>
  947. </div>
  948. <div class="span9">
  949. <p>Copyright <strong>&copy;</strong> 2009 - 2013, <a href="mailto:avkonst@users.sourceforge.net"><span class="normalImportance">Metrix++</span> Project</a></p>
  950. <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>
  951. <ul class="footer-links">
  952. <li><a href="https://sourceforge.net/p/metrixplusplus/tickets/new/">Ask question</a></li>
  953. <li class="muted">&middot;</li>
  954. <li><a href="https://sourceforge.net/p/metrixplusplus/tickets/new/">Report defect</a></li>
  955. <li class="muted">&middot;</li>
  956. <li><a href="https://sourceforge.net/p/metrixplusplus/tickets/new/">Feature request</a></li>
  957. <li class="muted">&middot;</li>
  958. <li><a href="https://sourceforge.net/p/metrixplusplus/tickets/search/?q=%21status%3Awont-fix+%26%26+%21status%3Aclosed">Open issues</a></li>
  959. <li class="muted">&middot;</li>
  960. <li><a href="https://sourceforge.net/p/metrixplusplus/wiki/ChangeLog/">Changelog</a></li>
  961. </ul>
  962. </div>
  963. </div>
  964. </div>
  965. </footer>
  966. <!-- Le javascript
  967. ================================================== -->
  968. <!-- Placed at the end of the document so the pages load faster -->
  969. <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
  970. <script src="assets/js/jquery.js"></script>
  971. <script src="assets/js/bootstrap-transition.js"></script>
  972. <script src="assets/js/bootstrap-alert.js"></script>
  973. <script src="assets/js/bootstrap-modal.js"></script>
  974. <script src="assets/js/bootstrap-dropdown.js"></script>
  975. <script src="assets/js/bootstrap-scrollspy.js"></script>
  976. <script src="assets/js/bootstrap-tab.js"></script>
  977. <script src="assets/js/bootstrap-tooltip.js"></script>
  978. <script src="assets/js/bootstrap-popover.js"></script>
  979. <script src="assets/js/bootstrap-button.js"></script>
  980. <script src="assets/js/bootstrap-collapse.js"></script>
  981. <script src="assets/js/bootstrap-carousel.js"></script>
  982. <script src="assets/js/bootstrap-typeahead.js"></script>
  983. <script src="assets/js/bootstrap-affix.js"></script>
  984. <script>
  985. !function ($) {
  986. $(function(){
  987. // carousel demo
  988. $('#myCarousel').carousel()
  989. })
  990. }(window.jQuery)
  991. </script>
  992. <script src="assets/js/holder/holder.js"></script>
  993. <script src="assets/js/google-code-prettify/prettify.js"></script>
  994. <script src="assets/js/application.js"></script>
  995. <script>
  996. </script>
  997. <!-- Analytics
  998. ================================================== -->
  999. <!--
  1000. <script>
  1001. var _gauges = _gauges || [];
  1002. (function() {
  1003. var t = document.createElement('script');
  1004. t.type = 'text/javascript';
  1005. t.async = true;
  1006. t.id = 'gauges-tracker';
  1007. t.setAttribute('data-site-id', '4f0dc9fef5a1f55508000013');
  1008. t.src = '//secure.gaug.es/track.js';
  1009. var s = document.getElementsByTagName('script')[0];
  1010. s.parentNode.insertBefore(t, s);
  1011. })();
  1012. </script>
  1013. -->
  1014. </body>
  1015. </html>