sonar 11 left. super-linear fixed
This commit is contained in:
1 parent
1e0796e56e
commit
699d7a4f6b
2 files changed
+20
-10
No files matched your search
@@ -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