<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Phumudzo Muvhango on Medium]]></title>
        <description><![CDATA[Stories by Phumudzo Muvhango on Medium]]></description>
        <link>https://medium.com/@pa.muvhango?source=rss-923740d3bd4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2DViETNY5P_jZhRCI0bSPw.jpeg</url>
            <title>Stories by Phumudzo Muvhango on Medium</title>
            <link>https://medium.com/@pa.muvhango?source=rss-923740d3bd4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 08:30:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pa.muvhango/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Integrating SonarQube to your Flutter App using Docker]]></title>
            <link>https://levelup.gitconnected.com/integrating-sonarqube-to-your-flutter-app-using-docker-c7b2a8d94e49?source=rss-923740d3bd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7b2a8d94e49</guid>
            <category><![CDATA[quality-software]]></category>
            <category><![CDATA[sonarqube]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Phumudzo Muvhango]]></dc:creator>
            <pubDate>Sun, 19 Jul 2020 04:00:57 GMT</pubDate>
            <atom:updated>2020-07-23T00:21:53.779Z</atom:updated>
            <content:encoded><![CDATA[<p>At the time of this writing there was no clear, straight forward way to add SonarQube’s (<a href="https://www.sonarqube.org/">https://www.sonarqube.org/</a>) static code analysis tool to your Flutter code.</p><p>In this article, I’ll provide step-by-step instructions on how to install Docker, modify its state, save your container as an image, add SonarQube’s SonarScanner and run analysis on your code.</p><p>A machine running MacOS was used during this tutorial.</p><h4>Prerequisites:</h4><ul><li>Dart SDK (<a href="https://dart.dev/get-dart">https://dart.dev/get-dart</a>)</li><li>Docker (<a href="https://docs.docker.com/engine/install/">https://docs.docker.com/engine/install/</a>)</li><li>SonarScanner Flutter Plugin (<a href="https://github.com/insideapp-oss/sonar-flutter">https://github.com/insideapp-oss/sonar-flutter</a>)</li><li>SonarScanner (<a href="https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/">https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/</a>)</li></ul><h4>1. Download Docker</h4><p>Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow developers to package an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as a single package.</p><p>Download: <a href="https://docs.docker.com/engine/install/">https://docs.docker.com/engine/install/</a></p><p>After downloading, ensure you are logged in and leave it running.</p><p><em>if you are experiencing problems try:</em></p><blockquote>- docker logout</blockquote><blockquote>docker login — username &lt;username&gt; — password &lt;password&gt; <a href="https://hub.docker.com/">https://hub.docker.com</a></blockquote><p>or</p><blockquote>docker login</blockquote><h4>2. Download the SonarScanner Flutter Plugin</h4><p>At the time of this writing, there were no official support for Dart on SonarScanner but luckily for now there’s a plugin that can help us with that</p><p>After downloading the “sonar-flutter-plugin-0.2.1.jar” file, paste it on the root of your Flutter project</p><p>Download : <a href="https://github.com/insideapp-oss/sonar-flutter">https://github.com/insideapp-oss/sonar-flutter</a></p><h4>3. Create SonarQube’s Project Properties file</h4><p>In the root directory of your Flutter project create “sonar-project.properties” and add the following:</p><blockquote># must be unique in a given SonarQube instance</blockquote><blockquote>sonar.projectKey=fluttertemplate</blockquote><blockquote>sonar.projectName=fluttertemplate</blockquote><blockquote>sonar.projectVersion=1.0</blockquote><blockquote># Path is relative to the sonar-project.properties file. Defaults to</blockquote><blockquote>sonar.sources=lib</blockquote><blockquote>sonar.tests=test</blockquote><blockquote># Encoding of the source code. Default is default system encoding</blockquote><blockquote>sonar.sourceEncoding=UTF-8</blockquote><blockquote># Exclude spec files for coverage tests</blockquote><blockquote>#sonar.exclusions=lib/test</blockquote><h4>4. Download SonarScanner for your OS</h4><p>After downloading, extract the file to an easily accessible path and add sonar-scanner to your system path so it can be accessed from the terminal:</p><p>$PATH_TO_SONAR-SCANNER/sonar-scanner-4.4.0.2170-macosx/bin</p><p>Download: <a href="https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/">https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/</a></p><h4>5. Create a base container</h4><p>run:</p><blockquote>docker create — name sonarqubebase -p 9000:9000 sonarqube</blockquote><p>This will create a container called sonarqubebase with sonarqube (<a href="https://hub.docker.com/_/sonarqube">https://hub.docker.com/_/sonarqube</a>) as it’s base image with port 9000 exposed</p><blockquote>Inspect images : docker images</blockquote><blockquote>Inspect containers: docker ps -a</blockquote><h4>6. Start the container</h4><blockquote>run: docker sonarqubebase</blockquote><p>Wait for the server to startup, You can view the log on Docker Desktop Dashboard</p><h4>7. Create an image from your container</h4><blockquote>run: docker commit sonarqubebase</blockquote><blockquote>then run : docker images</blockquote><p>Now tag your image</p><p>run:</p><blockquote>docker tag &lt;ID&gt; &lt;TagName&gt;</blockquote><h4>8. Create a Dockerfile for your Flutter project</h4><p>create a Dockerfile in the root of your flutter project with the following lines:</p><blockquote>FROM sonarqubebase</blockquote><blockquote>COPY sonar-flutter-plugin-0.2.1.jar /opt/sonarqube/extensions/plugins</blockquote><p>Here we copy the unofficial sonar scanner plugin to our docker image</p><h4>9. Build &amp; Run</h4><p>run the following in the root of your Flutter project:</p><blockquote>sudo docker build — tag sonarqubescan .</blockquote><p>then</p><blockquote>sudo docker run -d -p 9000:9000 sonarqubescan</blockquote><h4>10. Run code analysis</h4><p>In the root of your flutter project run:</p><blockquote>sonar-scanner</blockquote><p>Analysis should shortly start and you’ll be able to view your report on <a href="http://localhost:9000/">http://localhost:9000/</a></p><p>You can run another analysis in the root of your flutter project for a new report using:</p><blockquote>sonar-scanner</blockquote><p>Results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JRe_AKnoleaMdAwwS7SJEA.png" /></figure><p>Thank you for your time and I hope you’ve found this article helpful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7b2a8d94e49" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/integrating-sonarqube-to-your-flutter-app-using-docker-c7b2a8d94e49">Integrating SonarQube to your Flutter App using Docker</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>