I was thinking of using a static analysis tool to get my source reviewed. I estimated that it would take time to introduce it, so I tried to challenge it on the last day of the New Year holidays, so I will summarize it.
date | Contents |
---|---|
2017.01.03 | First edition |
2018.02.27 | Reinstalled due to OS replacement |
~~ As of January 03, 2017, it was executed in the following environment ~~ Executed in the following environment as of 2018/02/27 ・ MacOs Sierra-> High Sierra ・ Cake Brew ・ Gradle 3.2.1-> 4.5.1 ・ SonarQube 6.1-> 7.0 ・ MySql 5.7.16 → 5.7.17 ・ IntelliJ IDEA
Static analysis of PHP code with SonarQube Start quality control of programs with SonarQube (installation)
MySql
Start MySql from the terminal and log in to the database. After logging in, create a user and database.
command
CREATE DATABASE sonar;
CREATE USER 'sonar'@'localhost' IDENTIFIED by 'sonar';
GRANT ALL PRIVILEGES ON sonar.* TO 'sonar'@'localhost';
FLUSH PRIVILEGES;
I want to follow the file through Finder, so enter the following command in the terminal
command
open -a Finder /usr/local/Cellar/sonarqube/
lang:/usr/local/Cellar/sonarqube/7.0/libexec/conf/sonar.properties
Enable and modify the following settings.
sonar.jdbc.username
sonar.jdbc.password
sonar.jdbc.url
build.gradle
build.gradle
plugins {
id "org.sonarqube" version "2.6.2"
}
sonarqube {
properties {
property "sonar.host.url", "http://localhost:9000/"
property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver"
property "sonar.jacoco.reportPath", "${project.buildDir}/jacoco/test.exec"
}
}
command
sonar start
You can access it at [http: // localhost: 9000](http: // localhost: 9000)
Initial user & path is admin / admin
IntelliJ IDEA → Gradle → SonarQube
Double-click sonarqube from the Gradle tool in IntelliJ IDEA
SonarQube 6.1 can now parse C, Java, javascript by default. → You can analyze other languages by installing a plug-in.
The following plug-ins have been added
Plugin name |
---|
CSS / Less |
Checkstyle |
Findbugs |
Groovy |
JSON |
Japanese Pack |
Java Properties |
Web |
XML |
The installation method is login with administrator privileges (admin, admin by default) Install the plugin in the Update Center from the system settings and restart SonarQube
When I raised MySql to 5.7.17, I fell into a situation where MySql did not start up obediently. Even now, we are launching by taking unnecessary steps. What should I do? .. ..