|
|
|
@ -8,6 +8,7 @@ import net.educoder.ecsonar.model.TaskInfoDetail;
|
|
|
|
|
import net.educoder.ecsonar.model.vo.QualityInspectUserDataVO;
|
|
|
|
|
import net.educoder.ecsonar.services.DbOperateService;
|
|
|
|
|
import net.educoder.ecsonar.services.SonarService;
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.apache.tomcat.util.http.fileupload.FileUtils;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
@ -64,15 +65,16 @@ public class QualityInspectRunnable implements Runnable {
|
|
|
|
|
List<Long> codeIds = userData.getCodeIds();
|
|
|
|
|
List<Long> shiXunCodeIds = userData.getStudentWorkShixunCodeIds();
|
|
|
|
|
|
|
|
|
|
for (Long codeId : codeIds) {
|
|
|
|
|
processCodeId(codeId, path, projectName, dbOperateService::queryGameCodesById);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (Long codeId : shiXunCodeIds) {
|
|
|
|
|
processCodeId(codeId, path, projectName, dbOperateService::queryShiXunCodesById);
|
|
|
|
|
if(CollectionUtils.isNotEmpty(shiXunCodeIds)){
|
|
|
|
|
for (Long codeId : shiXunCodeIds) {
|
|
|
|
|
processCodeId(codeId, path, projectName, dbOperateService::queryShiXunCodesById);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
for (Long codeId : codeIds) {
|
|
|
|
|
processCodeId(codeId, path, projectName, dbOperateService::queryGameCodesById);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 写完所有文件开始用sonar进行质量分析
|
|
|
|
|
SonarScannerParam param = new SonarScannerParam(projectName, path);
|
|
|
|
|
if (Constant.C.equalsIgnoreCase(language) || Constant.CXX.equalsIgnoreCase(language)) {
|
|
|
|
|