Qafoo GmbH - passion for software quality ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Author: Kore Nordmann :Date: Fri, 16 Sep 2016 11:44:49 +0200 :Revision: 11 :Copyright: All rights reserved ================ Code Review Tool ================ :Description: We, at Qafoo, do Code Reviews quite often together with our customers. This often focusses on dicussing metrics, browsing the associated code and discussing solutions for the issues found. We started using a bunch of shell scripts for that, like everyone else, but at some point we came up with a webinterface to do this in a more comfortable way. Now we want to share this tool with you. :Keywords: code review, sofware quaility, team, oop, ood We, at Qafoo__, do Code Reviews quite often together with our customers. This often focusses on dicussing metrics, browsing the associated code and discussing solutions for the issues found. We started using a bunch of shell scripts for that, like everyone else, but at some point we came up with a webinterface to do this in a more comfortable way. Now we want to share this tool__ with you. __ http://qafoo.com/ __ http://github.com/Qafoo/review The tool currently focuses on our use cases and probably will continue to do so. This involves getting an overview on the customers source code. There are several metrics, like `Code Rank`__, `Weighted Method per Class`__ and alike which give you an overview on that. We found "tag clouds" and tables the best view to browse them. Of course all classes are clickable and directly lead to the related source code view: __ http://pdepend.org/documentation/software-metrics/index.html __ http://pdepend.org/documentation/software-metrics/index.html .. image:: images/review_pdepend_classes_thumb.png :alt: PDepend Code Rank classes tag cloud :width: 250px :height: 126px :target: images/review_pdepend_classes.png Additionally we often want to know about especially complex parts in the application, and the distribution of complexity. For the first also Method based tag clouds for metrics like `Cyclomatic Complexity`__ and `NPath Complexity`__ exist. For the distribution we also generate charts to get a quick overview: __ http://pdepend.org/documentation/software-metrics/index.html __ http://pdepend.org/documentation/software-metrics/index.html .. note:: Want to train your skills in using software metrics, continuous integration and automated testing? Get an individual `Qafoo expert training`__ for your team! __ /services/training.html .. image:: images/review_pdepend_ccn_graph_thumb.png :alt: Cyclomatic Complexity distribution chart :width: 250px :height: 145px :target: images/review_pdepend_ccn_graph.png On top of those simple metrics a combination of metrics often makes sense especially on class level. For this we included a metrics "calculator" which lists the results of formulas based on class metric to find out more sophisticated and task related issues in software: .. image:: images/review_calc_thumb.png :alt: PDepend metric calculator :width: 250px :height: 172px :target: images/review_calc.png Source Code Browser =================== All mentions of classes reference the respective files in the source code browser. The source code browser also contains clickable annotations, so you can directly see if some analyzer complained about a certain class, method or line of code. .. image:: images/review_source_browse_thumb.png :alt: Basic source code browser :width: 250px :height: 172px :target: images/review_source_browse.png You can of course also get a list of all annotations of the currently selected file: .. image:: images/review_source_anootation_list_thumb.png :alt: Source file annotation list :width: 250px :height: 172px :target: images/review_source_anootation_list.png Or you can click through the class dependencies, based on usage or inheritance connections: .. image:: images/review_source_dependencies_thumb.png :alt: Class dependency list :width: 250px :height: 172px :target: images/review_source_dependencies.png Other Tools =========== It should be fairly simple to include other (custom) analyzers in this tool. By default there is also something which draws simplified class diagrams, lists issues discovered by PHPMD__ and the `PHP Copy Paste Detector`__. __ http://phpmd.org/ __ https://github.com/sebastianbergmann/phpcpd .. image:: images/review_uml_thumb.png :alt: Class diagram extract :width: 250px :height: 150px :target: images/review_uml.png The software has been licensed under AGPLv3__ and is available on Github__. Please keep in mind that we develop this software mainly for internal use, so things might change or break. We still want to share this little gem with you. Feel free to issue pull requests, fork it or do whatever you like with it. More screenshots__ can also be found on github. For an installation guide checkout the `README.rst`__. We hope it works for you as well, as it does for us. __ https://www.gnu.org/licenses/agpl-3.0.html __ http://github.com/Qafoo/review __ https://github.com/Qafoo/review/tree/master/doc/screens __ https://github.com/Qafoo/review/blob/master/README.rst .. Local Variables: mode: rst fill-column: 79 End: vim: et syn=rst tw=79 Trackbacks ========== Comments ======== - gggeek at Mon, 05 Nov 2012 10:33:05 +0100 Very interesting! Looking forward to implement this as QA step in the ezextensionbuilder project. One question: is ant only needed to download the tool, or is it also needed to setup or execute the code analysis? - Kore at Mon, 05 Nov 2012 11:13:36 +0100 @gggeek: ant is required to set the tool up. You can go without this by applying the MySQL-Schema manually and install the composer dependencies (I guess). After the initial installation ant will also provide you with the means to keep the tool up-to-date (migrations) and to verify that the tool itself still works. To execute the tool itself after successfull installation ant is not required. - Johann-Peter Hartmann at Mon, 05 Nov 2012 16:45:12 +0100 Nice, thanks for sharing! - johann - Thomas Koch at Mon, 05 Nov 2012 17:46:36 +0100 I thought you were talking about a code review tool like Gerrit (which I'm currently packaging for Debian) or reviewboard. Would code analysis/inspection tool describe it better? - Kore at Mon, 05 Nov 2012 21:44:15 +0100 @Thomas Koch: Names have different meanings for different people, and names are just names. We *use* this tool for code reviews, so the name is appropriate to us. Feel free to tag it differently in your brain ;)