sonar 11 left. super-linear fixed
This commit is contained in:
@@ -247,8 +247,10 @@ export default {
|
||||
/**
|
||||
* @param {number} time use timeLabel.js
|
||||
*/
|
||||
timeLabel(time){
|
||||
let result = getTimeLabel(time).match(/(\d+)\s*([a-zA-Z]+)/);
|
||||
timeLabel(time){ // sonar-qube prevent super-linear runtime due to backtracking; change * to ?
|
||||
//
|
||||
const label = getTimeLabel(time).replace(/\s+/g, ' '); // 將所有連續空白字符壓縮為一個空白
|
||||
const result = label.match(/^(\d+)\s?([a-zA-Z]+)$/); // add ^ and $ to meet sonar-qube need
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user