Managing your project code quality

Download Managing your project code quality

Post on 05-Apr-2017

105 views

Category:

Software

1 download

Embed Size (px)

TRANSCRIPT

<p>Managing your Project Code Quality</p> <p>nuno.cancelo@gmail.comManaging your Project Code QualityNuno Cancelo</p> <p>e.Sponsors.ApplyThanks ( )</p> <p>Managing your Project Code Quality</p> <p>AgendaWho Am IWhy, When, Who and HowSonarQubeCreate your own Infrastruture</p> <p>whoami</p> <p>Founder of Fundisk EntertainmentAuthor @ Revista ProgramarMember @ Comunidade NetpontoProfessional Code Janitor</p> <p>What?Why?When?Who?How?</p> <p>What is Quality?ISO 8402-1986 standard defines quality as "the totality of features and characteristics of a product or service that bears its ability to satisfy stated or implied needs."http://www.businessdictionary.com/definition/quality.html</p> <p>Some Code Quality MeasuresAverage Method Lines Of Code (AMLOC)Average Cyclomatic Complexity per Method (ACCM)Response For a Class (RFC)Depth in Inheritance Tree (DIT)Number of Children (NOC)Lack of Cohesion in Methods (LCOM4)Afferent Connections per Class (ACC)Coupling Factor (COF)</p> <p>Why we need Code Quality Management?Control the evolution of the codeIdentify, asap, code bugs, bad practices, etc.Centralize Code Quality of the projectsManage Multiple Projects QualityManage work effort among the projects</p> <p>When should we do it?Anytime is a good enoughSoon as possible is even betterIs hard to maintain the project</p> <p>Who should be doing it?Developers should analyze their codeIntegration InfrastructureTeam leadersProjects ManagersApplication ownersEveryone </p> <p>How to do it?Most IDEs have tools for code analysisThird parties toolshttps://www.owasp.org/index.php/Source_Code_Analysis_ToolsCode Quality Management PlatformsSonarqubeCodacySQuORETeamscaleEtc. </p> <p>Create your own Infrastruture</p> <p>+</p> <p>Docker</p> <p>DockerDocker is the worlds leading software container platform. Eliminate works on my machine problems.Docker automates the repetitive tasks of setting up and configuring development environments so that developers can focus on what matters: building great software.Src: https://www.docker.com/what-docker</p> <p>SonarQube</p> <p>SonarQube FeaturesCommunity Edition (Free)Continuous Code Quality PlatformWrite Clean CodeMultiple languages supportDetect bugsDevops integrationCentralize Quality</p> <p>SonarQube PluginsSonarlintIDE extensionVisual Studio, Eclipse, IntelliJ IDEAOut of the boxC#, Java, Javascript, PHP, Python, XML, etcSome plugins are paidOthersGithub, Google Analytics, Bitbucket Authentication, Azure AD, LDAPClearCase, Git, SVN, TFCVEtc, etc, etchttps://docs.sonarqube.org/display/PLUG/Plugin+Library</p> <p>SonarQube ConfigurationThe SonarQube server requires at least 2GB of RAM to run efficiently and 1GB of free RAM for the OS.SonarQube 5.6+ requires Java 8.Recommended a SQL serverOn each project create new filesonar-project.propertiesTwo minutes starthttps://docs.sonarqube.org/display/SONAR/Get+Started+in+Two+Minutes</p> <p>Demonstration</p> <p>SonarQube InstallDownloadhttps://www.sonarqube.org/downloads/SonarQube Scannershttps://docs.sonarqube.org/display/SCAN/Analyzing+Source+CodeSonarQube Scanner:Launch analysis of any language from the command lineSonarQube Scanner for MSBuild:Launch analysis of .Net projectsSonarQube Scanner for Ant: Launch analysis from AntSonarQube Scanner for Maven: Launch analysis from Maven with minimal configurationSonarQube Scanner for Gradle:Launch Gradle analysisSonarQube Scanner For Jenkins: Launch analysis from JenkinInstalling the serverhttps://docs.sonarqube.org/display/SONAR/Installing+the+Server</p> <p>Docker InstallRequirementshttps://docs.docker.com/docker-for-mac/install/Downloadhttps://www.docker.com/get-dockerFollow instructions </p> <p>sonar-project.properties# must be unique in a given SonarQube instancesonar.projectKey=my:project# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.sonar.projectName=My projectsonar.projectVersion=1.0# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.# Since SonarQube 4.2, this property is optional if sonar.modules is set.# If not set, SonarQube starts looking for source code from the directory containing# the sonar-project.properties file.sonar.sources=./srcsonar.java.binaries=./target/classes# Encoding of the source code. Default is default system encoding#sonar.sourceEncoding=UTF-8</p> <p>Questions?</p> <p>Contacts</p> <p>Windows 8 Metro Icons by dAKirby309</p> <p>nuno.cancelo@gmail.comhttps://www.linkedin.com/in/nunocancelo@masterzdranhttp://lmgtfy.com/?q=nuno+cancelo</p>