Managing your project code quality

Download Managing your project code quality

Post on 05-Apr-2017




1 download


Managing your Project Code Qualitynuno.cancelo@gmail.comManaging your Project Code QualityNuno Canceloe.Sponsors.ApplyThanks ( )Managing your Project Code QualityAgendaWho Am IWhy, When, Who and HowSonarQubeCreate your own InfrastruturewhoamiFounder of Fundisk EntertainmentAuthor @ Revista ProgramarMember @ Comunidade NetpontoProfessional Code JanitorWhat?Why?When?Who?How?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." 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)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 projectsWhen should we do it?Anytime is a good enoughSoon as possible is even betterIs hard to maintain the projectWho should be doing it?Developers should analyze their codeIntegration InfrastructureTeam leadersProjects ManagersApplication ownersEveryone How to do it?Most IDEs have tools for code analysisThird parties tools Quality Management PlatformsSonarqubeCodacySQuORETeamscaleEtc. Create your own Infrastruture+DockerDockerDocker 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: FeaturesCommunity Edition (Free)Continuous Code Quality PlatformWrite Clean CodeMultiple languages supportDetect bugsDevops integrationCentralize QualitySonarQube 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, etc 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 start InstallDownload Scanners 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 server InstallRequirements instructions 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 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 file.sonar.sources=./ Encoding of the source code. Default is default system encoding#sonar.sourceEncoding=UTF-8Questions?ContactsWindows 8 Metro Icons by dAKirby309nuno.cancelo@gmail.com