<强> 强>
<强> 强>
程序中包含大量复制粘贴的代码是质量低下的表现
统计并展示单元测试覆盖率
通过Findbugs, PMD, CheckStyle等规范代码编写
少了可读性差,多了看起来费劲
通过Findbugs, PMD, CheckStyle等检测潜在的错误
依赖,耦合等
强>
,,数据库:存放SonarQube的配置数据,代码质量的快照数据
,,Web服务:用于查看SonarQube的配置数据,代码质量的快照数据
,,分析器:对项目代码进行分析,生成质量结果数据并存入数据库中(分析器有多种,我们选用SonarQube Maven插件)
<强> 强>
强>
,,,,mysql>, show 发动机;
,,,,
,,,,mysql>, show variables like % storage_engine %的;
,,,,
,,,,【root@localhost ~】#,。vi /etc/my . cnf中所做 ,,,(mysqld) ,,,datadir=/var/lib/mysql ,,,套接字=/var/lib/mysql/mysql.sock ,,,用户=mysql ,,,#,Disabling symbolic-links is recommended 用prevent assorted security 风险 ,,,符号链接=0 ,,,#加入这条default-storage-engine=INNODB ,,,default-storage-engine=INNODB ,,,(mysqld_safe) ,,,日志错误=/var/log/mysqld.log ,,,pid文件=/var/run/mysqld/mysqld.pid
,,设置得尽可能大一点,这个参数主要作用是缓存innodb表的索引,数据,插入数据时的缓冲
,,默认值:128,专用mysql服务器设置的大小:操作系统内存的70% - -80%最佳。
,,,,【root@localhost ~】#,。vi /etc/my . cnf中所做 ,,,(mysqld) ,,,datadir=/var/lib/mysql ,,,套接字=/var/lib/mysql/mysql.sock ,,,用户=mysql ,,,#,Disabling symbolic-links is recommended 用prevent assorted security 风险 ,,,符号链接=0 ,,,default-storage-engine=INNODB ,,,#加入这条innodb_buffer_pool_size =256 ,,,innodb_buffer_pool_size =256 ,,,(mysqld_safe) ,,,日志错误=/var/log/mysqld.log ,,,pid文件=/var/run/mysqld/mysqld。pid
,,,,【root@localhost ~】#,。vi /etc/my . cnf中所做 ,,,(mysqld) ,,,datadir=/var/lib/mysql ,,,套接字=/var/lib/mysql/mysql.sock ,,,用户=mysql ,,,#,Disabling symbolic-links is recommended 用prevent assorted security 风险 ,,,符号链接=0 ,,,default-storage-engine=INNODB ,,,innodb_buffer_pool_size =256 ,,,#加入下面两条query_cache_type=1, query_cache_size=32米 ,,,query_cache_type=1 ,,query_cache_size=32 m ,,,(mysqld_safe) ,,,日志错误=/var/log/mysqld.log ,,,pid文件=/var/run/mysqld/mysqld。pid
,重启后,验证缓存设置是否生效
,,,,mysql>, show variables like % query_cache %的;
<强> <强> 强> 2.2创建sonarqube数据库(UTF8编码)强>
<强> 强> 强>
,,,,,(root@localhost 选择),unzip sonarqube-4.5.4.zip ,,,,(root@localhost 选择),mv sonarqube-4.5.4/, sonarqube
,
,,,,【root@localhost sonarqube】#, cd /opt/sonarqube/conf/,,,(root@localhost conf) #, vi sonar.properties ,,,#数据库用户名和密码 ,,,sonar.jdbc.username=根 ,,,sonar.jdbc.password=123456 ,,,, ,,,#——安康;MySQL 5. x ,,,sonar.jdbc.url=jdbc: mysql://localhost: 3306/sonarqube ? useUnicode=true& characterEncoding=utf8& rewriteBatchedStatements=true& useConfigs=maxPerformance ,,,, ,,,sonar.web.host=0.0.0.0 ,,,sonar.web.context=/sonarqube ,,sonar.web。null null null null null null null null null null null null null null null null null null null nulllinux学习:持续集成篇——sonarqube代码质量管理平台的介绍与安装-04