{"id":784,"date":"2013-12-22T16:12:03","date_gmt":"2013-12-22T15:12:03","guid":{"rendered":"http:\/\/qualilogy.com\/en\/?p=784"},"modified":"2013-12-22T17:08:45","modified_gmt":"2013-12-22T16:08:45","slug":"plsql-analysis-with-sonarqube-organization","status":"publish","type":"post","link":"http:\/\/qualilogy.com\/en\/plsql-analysis-with-sonarqube-organization\/","title":{"rendered":"PL\/SQL analysis with SonarQube &#8211; Organization"},"content":{"rendered":"<p><a href=\"http:\/\/500px.com\/Vicken\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-1416\" alt=\"SonarQubePLSQL1\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/SonarQubePLSQL1.jpg\" width=\"380\" height=\"181\" \/><\/a>Now that I have update my source code analysis environment, with the <a href=\"http:\/\/qualilogy.com\/en\/sonarqube-upgrade-4-0\/\" target=\"_blank\">upgrades of SonarQube<\/a>,or\u00a0 <a href=\"http:\/\/qualilogy.com\/en\/upgrade-sonarqube-runner-jenkins\/\" target=\"_blank\">SonarQube-Runner and Jenkins<\/a>, time has come to update also mi repository of aplicactions and demos. <!--more--><\/p>\n<p>As a Quality Consultant, I have all kinds of &#8216;projects&#8217;, I mean, all kind of source code analysis, for various types of processes (Continuous Integration, Quality Gate, Quality Assessment, etc.). and for all kinds of technologies. let&#8217;s remember that SonarQube is not just an Open Source tool that analyzes Java or object-oriented programming languages\u200b\u200b: it is also very useful for Legacy applications with Cobol, SAP-ABAP, client-server, etc.<\/p>\n<p>So I decided to take advantage of the relative decrease in activity at the end of year to clean up my demos &#8230; starting with PL\/SQL. Over time, I collected all kinds of scripts programs for database procedures, and this will be an opportunity to:<\/p>\n<ul>\n<li>Remember how I organize my analysis.<\/li>\n<li>Configure and realize a PL\/SQL code analysis with SonarQube.<\/li>\n<li>Look at customizing the perfile of PL\/SQL rules delivered with SonarQube.<\/li>\n<\/ul>\n<p>I stil don&#8217;t know how many posts will be needed to cover these topics, I tend to write as it comes and I like to leave some margin for improvisation. In addition, I will probably have to stop for some New Year&#8217;s greetings (and family celebrations), so it is likely that this will take us until January.<\/p>\n<h2>Organization of the environment analysis<\/h2>\n<p><span id=\"result_box\" lang=\"en\"><span title=\"Tout d'abord, quelques rappels sur la mani\u00e8re dont j'ai organis\u00e9 mon environnement d'analyse de code source.\">First, a few reminders on how I organized my environment. <\/span><span title=\"Il n'est \u00e9videmment pas absolument indispensable de proc\u00e9der de m\u00eame, mais je vous recommande n\u00e9anmoins d'adopter un minimum de r\u00e8gles d'organisation.\">It is obviously not necessary to do the same, but I still recommend you to adopt some rules. <\/span><\/span><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span title=\"Notamment si vous travaillez en \u00e9quipe.\">Especially if you work as a team. <\/span><span title=\"Vous n'avez pas envie qu'on vous appelle pendant les vacances parce que personne n'est capable de reprendre cet audit de code que vous n'avez pas pu terminer \u00e0 cause du retard pris par le client pour livrer \u00e0 temps le code de\">You do not want that people call you during the holidays because nobody is able to work on that code quality assessment that you have not completed due to some\u00a0 delay taken by the customer to deliver on time the code of <\/span><span title=\"son application.\">his application. <\/span><span title=\"Et le pauvre malheureux qui doit continuer cette t\u00e2che ne sait pas comment vous avez l'habitude de travailler, comment vous configurer une analyse, si vous utilisez des r\u00e8gles ou m\u00e9triques particuli\u00e8res, etc.\">And the poor guy who must continue this task does not know how you used to work, how you set up a code scan, if you use some specific rules, etc. <\/span><\/span><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span title=\"Et m\u00eame si vous travaillez seul, comme moi en freelance par exemple, il reste souhaitable de toujours suivre les m\u00eames processus, au risque de ne pas vous rappeler o\u00fa diable vous avez gard\u00e9 ce fichier de configuration de cette analyse, men\u00e9e il y a 2 ans\">And even if you work alone, as a freelancer for example, it remains a good thing to always follow the same process, or you could not remember where the hell you saved this configuration file of this analysis conducted 2 years ago<\/span><span title=\", et que vous aimeriez retrouver maintenant.\">, and that you would like to find now.<\/span><\/span><\/p>\n<p><span title=\"Enfin bref, voici comment je travaille, sur mon portable :\">Anyway, here&#8217;s how I organize it on my laptop:<\/span><\/p>\n<ul>\n<li>A folder dedicated to my analysis environment \u2018C:\\SRC\u2019.<\/li>\n<li>Different directories organized around different technologies (J2EE, ABAP, Cobol, Repository for other technos, \u2026) and a folder for all my d\u00e9mos : \u2018C:\\SRC\\Demo\u2019.<\/li>\n<li>Inside this folder, a sub-directory for each demo for each technology :\u2018C:\\SRC\\Demo\\J2EE\u2019, \u2018C:\\SRC\\Demo\\Cobol\u2019, \u2026, and \u2018C:\\SRC\\Demo\\PLSQL\u2019.<\/li>\n<\/ul>\n<p>Inside each of these folders, I use three directories:<\/p>\n<ul>\n<li>\u2018Delivery\u2019 to store the versions of the application delivered for an assessment.<\/li>\n<li>\u2018Conf\u2019 to manage all configuration files, documentations, assessments, sheets, presentations, etc.<\/li>\n<li>\u2018Source\u2019 to copy the source code to be analized.<\/li>\n<\/ul>\n<p>Why not have a single directory to analyze one version? First because I may have to analyze successive versions. For example, a customer wants an assessment because he is not very happy with his outsourcer and he would like to check the quality of the code provided. We will first analyze the initial version assigned for maintenance to the outsourcer, and then the final version that he has returned to the customer. By analyzing these two versions sequentially, we can determine the differences &#8211; for better or for worse &#8211; in terms of defects, complexity and maintainability between these two versions.<\/p>\n<p>More importantly, sometimes I have to change the code supplied by the customer, for several reasons:<\/p>\n<ul>\n<li>A file causes a problem forcing the parser to stop the analysis. For example, the delivery supplied by the customer contains an old program, which is no longer used, but does not compile either.<\/li>\n<li>I have to rearrange the code differently. Amazing the number of architects who reinvented best practices in organizing packages and directories.<\/li>\n<li>The delivery contains a lot of directories &#8216;.svn&#8217; filling up hard disk space, but also slowing down the analysis.<\/li>\n<\/ul>\n<p><span id=\"result_box\" lang=\"en\"><span class=\"hps\">If you<\/span> <span class=\"hps\">have a server<\/span><span>, I recommend<\/span> <span class=\"hps\">you use<\/span> <span class=\"hps\">a first drive for<\/span> <span class=\"hps\">your<\/span> <span class=\"hps\">softwares<\/span> <span class=\"hps\">and<\/span> the <span class=\"hps\">more<\/span> <span class=\"hps\">efficient<\/span> hard disk <span class=\"hps\">to store the<\/span> <span class=\"hps\">source<\/span> <span class=\"hps\">code<\/span> <span class=\"hps\">and<\/span> <span class=\"hps\">make your<\/span> <span class=\"hps\">analysis<\/span><span>.<\/span><br \/>\n<\/span><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span class=\"hps\">Of course<\/span><span>, if you work<\/span> <span class=\"hps\">within a<\/span> <span class=\"hps\">project team,<\/span> <span class=\"hps\">you probably<\/span> <span class=\"hps\">have a<\/span> <span class=\"hps\">configuration<\/span> <span class=\"hps\">management tool<\/span> <span class=\"hps\">(SCM)<\/span> <span class=\"hps\">and therefore your<\/span> <span class=\"hps\">environment<\/span> <span class=\"hps\">will be different.<\/span> <span class=\"hps\">Note simply<\/span> <span class=\"hps\">that<\/span> <span class=\"hps\">my\u00a0<\/span><span class=\"hps\">analysis<\/span> <span class=\"hps\">of<\/span> <span class=\"hps\">PL<\/span><span class=\"hps\">\/SQL will be done in\u00a0<\/span><span>: &#8216;C<\/span><span>:\\<\/span><span class=\"hps\">SRC\\<\/span><span class=\"hps\">Demo\\<\/span><span class=\"hps\">PLSQL<\/span><span class=\"hps\">\\Source&#8217;<\/span><span>.<\/span><br \/>\n<\/span><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span class=\"hps\">The next<\/span> <span class=\"hps\">post<\/span> <span class=\"hps\">will focus on the<\/span> <span class=\"hps\">configuration<\/span> <span class=\"hps\">of this analysis.<br \/>\n<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that I have update my source code analysis environment, with the upgrades of SonarQube,or\u00a0 SonarQube-Runner and Jenkins, time has come to update also mi repository of aplicactions and demos.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-784","post","type-post","status-publish","format-standard","hentry","category-sonarqube-plsql"],"_links":{"self":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/784"}],"collection":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/comments?post=784"}],"version-history":[{"count":13,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/784\/revisions"}],"predecessor-version":[{"id":800,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/784\/revisions\/800"}],"wp:attachment":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/media?parent=784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/categories?post=784"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/tags?post=784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}