|
|
@@ -598,11 +598,17 @@ public class DevcloudDataAnalysisServiceImpl implements DevcloudDataAnalysisServ
|
|
|
Commit commit = new Commit();
|
|
|
Test test = new Test();
|
|
|
Pipeline pipeline = new Pipeline();
|
|
|
+ //新增
|
|
|
+ Bug bugList = new Bug();
|
|
|
+ TreeNode treeNode = new TreeNode();
|
|
|
|
|
|
Integer commit_times=0,valid_commit_time=0,buglist_commit=0,feature_commit=0;
|
|
|
List<String> commit_msg_overview = new ArrayList<>();
|
|
|
Integer test_success=0,test_failure=0,test_times=0,test_concurrency_count=0;
|
|
|
Integer pipeline_deploy=0,pipeline_pass=0,pipeline_failure=0;
|
|
|
+ //新增bugList和TreeNode
|
|
|
+ Integer bug_times=0,high_times=0,finished_times=0;
|
|
|
+ Integer treeNode_times=0,high_treeNode_times=0,finished_treeNode_times=0;
|
|
|
//遍历所有相关项目
|
|
|
for(int i=0;i<projectList.size();i++){
|
|
|
Integer projectId = projectList.get(i);
|
|
|
@@ -661,6 +667,36 @@ public class DevcloudDataAnalysisServiceImpl implements DevcloudDataAnalysisServ
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ //遍历devInfo中的bugList信息
|
|
|
+ List<BugInfo> bugInfos = devcloudInfo.getBugList();
|
|
|
+ for(BugInfo bugInfo : bugInfos){
|
|
|
+ if(bugInfo.getUserId() == null){
|
|
|
+ continue;
|
|
|
+ }else if(bugInfo.getUserId().equals(user_id)){
|
|
|
+ bug_times++;
|
|
|
+ if(bugInfo.getPriority().toLowerCase().equals("high")){
|
|
|
+ high_times++;
|
|
|
+ }
|
|
|
+ if(bugInfo.getBugState().toLowerCase().equals("finished")){
|
|
|
+ finished_times++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //遍历devInfo的treeNode信息
|
|
|
+ List<TreeNodeInfo> treeNodeInfos = devcloudInfo.getTreeNodeList();
|
|
|
+ for(TreeNodeInfo treeNodeInfo : treeNodeInfos){
|
|
|
+ if(treeNodeInfo.getUserId() == null){
|
|
|
+ continue;
|
|
|
+ }else if(treeNodeInfo.getUserId().equals(user_id)){
|
|
|
+ treeNode_times++;
|
|
|
+ if(treeNodeInfo.getPriority().toLowerCase().equals("high")){
|
|
|
+ high_treeNode_times++;
|
|
|
+ }
|
|
|
+ if(treeNodeInfo.getState().toLowerCase().equals("finished")){
|
|
|
+ finished_treeNode_times++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//commit
|
|
|
@@ -678,10 +714,20 @@ public class DevcloudDataAnalysisServiceImpl implements DevcloudDataAnalysisServ
|
|
|
pipeline.setPipeline_deploy(pipeline_deploy);
|
|
|
pipeline.setPipeline_pass(pipeline_pass);
|
|
|
pipeline.setPipline_failure(pipeline_failure);
|
|
|
+ //bugList
|
|
|
+ bugList.setBug_times(bug_times);
|
|
|
+ bugList.setHigh_times(high_times);
|
|
|
+ bugList.setFinished_times(finished_times);
|
|
|
+ //treeNode
|
|
|
+ treeNode.setTreeNode_times(treeNode_times);
|
|
|
+ treeNode.setHigh_treeNode_times(high_treeNode_times);
|
|
|
+ treeNode.setFinished_treeNode_times(finished_treeNode_times);
|
|
|
|
|
|
formatStudent.setCommit(commit);
|
|
|
formatStudent.setTest(test);
|
|
|
formatStudent.setPipeline(pipeline);
|
|
|
+ formatStudent.setBuglist(bugList);
|
|
|
+ formatStudent.setTreeNode(treeNode);
|
|
|
|
|
|
return formatStudent;
|
|
|
}
|
|
|
@@ -730,6 +776,9 @@ public class DevcloudDataAnalysisServiceImpl implements DevcloudDataAnalysisServ
|
|
|
Commit commit = new Commit();
|
|
|
Test test = new Test();
|
|
|
Pipeline pipeline = new Pipeline();
|
|
|
+ //新增
|
|
|
+ Bug bugList = new Bug();
|
|
|
+ TreeNode treeNode = new TreeNode();
|
|
|
|
|
|
Integer commit_times=0,valid_commit_time=0,buglist_commit=0,feature_commit=0;
|
|
|
//记录小组不同成员的commit贡献
|
|
|
@@ -741,6 +790,13 @@ public class DevcloudDataAnalysisServiceImpl implements DevcloudDataAnalysisServ
|
|
|
Integer pipeline_deploy=0,pipeline_pass=0,pipeline_failure=0;
|
|
|
//记录小组不同成员的deploy贡献
|
|
|
int[] pipeTimes = new int[n];
|
|
|
+ //新增bugList,treeNode
|
|
|
+ Integer bug_times=0,high_times=0,finished_times=0;
|
|
|
+ //记录小组不同成员的bugList贡献
|
|
|
+ int[] bugTimes = new int[n];
|
|
|
+ Integer treeNode_times=0,high_treeNode_times=0,finished_treeNode_times=0;
|
|
|
+ //记录小组不同成员的treeNode贡献
|
|
|
+ int[] treeNodeTimes = new int[n];
|
|
|
|
|
|
//
|
|
|
for(int i=0;i<projects.size();i++){
|
|
|
@@ -820,6 +876,46 @@ public class DevcloudDataAnalysisServiceImpl implements DevcloudDataAnalysisServ
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //遍历devInfo中的bugList信息
|
|
|
+ List<BugInfo> bugInfos = devcloudInfo.getBugList();
|
|
|
+ for(BugInfo bugInfo : bugInfos){
|
|
|
+ for(int j=0;j<userIds.size();j++){
|
|
|
+ Integer user_id = userIds.get(j);
|
|
|
+ if(bugInfo.getUserId() == null){
|
|
|
+ continue;
|
|
|
+ }else if(bugInfo.getUserId().equals(user_id)){
|
|
|
+ bugTimes[j]++;
|
|
|
+ bug_times++;
|
|
|
+ if(bugInfo.getPriority().toLowerCase().equals("high")){
|
|
|
+ high_times++;
|
|
|
+ }
|
|
|
+ if(bugInfo.getBugState().toLowerCase().equals("finished")){
|
|
|
+ finished_times++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //遍历devInfo的treeNode信息
|
|
|
+ List<TreeNodeInfo> treeNodeInfos = devcloudInfo.getTreeNodeList();
|
|
|
+ for(TreeNodeInfo treeNodeInfo : treeNodeInfos){
|
|
|
+ for(int j=0;j<userIds.size();j++){
|
|
|
+ Integer user_id = userIds.get(j);
|
|
|
+ if(treeNodeInfo.getUserId() == null){
|
|
|
+ continue;
|
|
|
+ }else if(treeNodeInfo.getUserId().equals(user_id)){
|
|
|
+ treeNodeTimes[j]++;
|
|
|
+ treeNode_times++;
|
|
|
+ if(treeNodeInfo.getPriority().toLowerCase().equals("high")){
|
|
|
+ high_treeNode_times++;
|
|
|
+ }
|
|
|
+ if(treeNodeInfo.getState().toLowerCase().equals("finished")){
|
|
|
+ finished_treeNode_times++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
DecimalFormat df = new DecimalFormat("#.00");
|
|
|
@@ -883,10 +979,50 @@ public class DevcloudDataAnalysisServiceImpl implements DevcloudDataAnalysisServ
|
|
|
deployContribution.add(contribution);
|
|
|
}
|
|
|
pipeline.setPipeline_contribution(deployContribution);
|
|
|
+ //bugList
|
|
|
+ bugList.setBug_times(bug_times);
|
|
|
+ bugList.setHigh_times(high_times);
|
|
|
+ bugList.setFinished_times(finished_times);
|
|
|
+ List<Contribution> bugContribution = new ArrayList<>();
|
|
|
+ for(int i=0;i<userIds.size();i++){
|
|
|
+ Contribution contribution = new Contribution();
|
|
|
+ contribution.setName(users.get(i).getName());
|
|
|
+ contribution.setTimes(bugTimes[i]);
|
|
|
+ Double value;
|
|
|
+ if(bug_times == 0){
|
|
|
+ value = 0.0;
|
|
|
+ }else {
|
|
|
+ value = (double)bugTimes[i]/(double)bug_times;
|
|
|
+ }
|
|
|
+ contribution.setProportion(Double.valueOf(df.format(value)));
|
|
|
+ bugContribution.add(contribution);
|
|
|
+ }
|
|
|
+ bugList.setBug_contribution(bugContribution);
|
|
|
+ //treeNode
|
|
|
+ treeNode.setTreeNode_times(treeNode_times);
|
|
|
+ treeNode.setHigh_treeNode_times(high_treeNode_times);
|
|
|
+ treeNode.setFinished_treeNode_times(finished_treeNode_times);
|
|
|
+ List<Contribution> treeNodeContribution = new ArrayList<>();
|
|
|
+ for(int i=0;i<userIds.size();i++){
|
|
|
+ Contribution contribution = new Contribution();
|
|
|
+ contribution.setName(users.get(i).getName());
|
|
|
+ contribution.setTimes(treeNodeTimes[i]);
|
|
|
+ Double value;
|
|
|
+ if(bug_times == 0){
|
|
|
+ value = 0.0;
|
|
|
+ }else {
|
|
|
+ value = (double)treeNodeTimes[i]/(double)treeNode_times;
|
|
|
+ }
|
|
|
+ contribution.setProportion(Double.valueOf(df.format(value)));
|
|
|
+ treeNodeContribution.add(contribution);
|
|
|
+ }
|
|
|
+ treeNode.setTreeNode_contribution(treeNodeContribution);
|
|
|
|
|
|
formatGroup.setCommit(commit);
|
|
|
formatGroup.setTest(test);
|
|
|
formatGroup.setPipeline(pipeline);
|
|
|
+ formatGroup.setBuglist(bugList);
|
|
|
+ formatGroup.setTreeNode(treeNode);
|
|
|
|
|
|
return formatGroup;
|
|
|
}
|