Replace .map() with .forEach() where return value is unused
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -132,7 +132,7 @@ export default {
|
|||||||
inputTimeFields: {
|
inputTimeFields: {
|
||||||
get() {
|
get() {
|
||||||
let paddedTimeFields = [];
|
let paddedTimeFields = [];
|
||||||
this.inputTypes.map(inputTypeUnit => {
|
this.inputTypes.forEach(inputTypeUnit => {
|
||||||
// Pad the dd/hh/mm/ss field string to 2 digits and add it to the list
|
// Pad the dd/hh/mm/ss field string to 2 digits and add it to the list
|
||||||
paddedTimeFields.push(this.tUnits[inputTypeUnit].val.toString().padStart(2, '0'));
|
paddedTimeFields.push(this.tUnits[inputTypeUnit].val.toString().padStart(2, '0'));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ export default function cytoscapeMap(mapData, dataLayerType, dataLayerOption, cu
|
|||||||
}
|
}
|
||||||
//存下此刻剛進入畫面時當前所有節點的座標位置
|
//存下此刻剛進入畫面時當前所有節點的座標位置
|
||||||
const allNodes = cy.nodes();
|
const allNodes = cy.nodes();
|
||||||
allNodes.map(nodeFirstlySave => {
|
allNodes.forEach(nodeFirstlySave => {
|
||||||
cytoscapeStore.saveNodePosition(nodeFirstlySave.id(), nodeFirstlySave.position(), rank);
|
cytoscapeStore.saveNodePosition(nodeFirstlySave.id(), nodeFirstlySave.position(), rank);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export default defineStore('allMapDataStore', {
|
|||||||
},
|
},
|
||||||
filterAttrs: state => {
|
filterAttrs: state => {
|
||||||
if(state.allFilterAttrs !== null){
|
if(state.allFilterAttrs !== null){
|
||||||
state.allFilterAttrs.map(att => {
|
state.allFilterAttrs.forEach(att => {
|
||||||
switch (att.type) {
|
switch (att.type) {
|
||||||
case 'date':
|
case 'date':
|
||||||
att.min = att.min !== null ? moment(att.min).format('YYYY/MM/DD HH:mm') : null;
|
att.min = att.min !== null ? moment(att.min).format('YYYY/MM/DD HH:mm') : null;
|
||||||
@@ -193,10 +193,10 @@ export default defineStore('allMapDataStore', {
|
|||||||
const response = await this.$axios.get(api);
|
const response = await this.$axios.get(api);
|
||||||
this.allTraceTaskSeq = response.data.task_seq;
|
this.allTraceTaskSeq = response.data.task_seq;
|
||||||
this.allCase = response.data.cases;
|
this.allCase = response.data.cases;
|
||||||
this.allCase.map(c => {
|
this.allCase.forEach(c => {
|
||||||
c.started_at = moment(c.started_at).format('YYYY/MM/DD HH:mm');
|
c.started_at = moment(c.started_at).format('YYYY/MM/DD HH:mm');
|
||||||
c.completed_at = moment(c.completed_at).format('YYYY/MM/DD HH:mm');
|
c.completed_at = moment(c.completed_at).format('YYYY/MM/DD HH:mm');
|
||||||
c.attributes.map(att => {
|
c.attributes.forEach(att => {
|
||||||
switch (att.type) {
|
switch (att.type) {
|
||||||
case 'date':
|
case 'date':
|
||||||
att.value = att.value !== null ? moment(att.value).format('YYYY/MM/DD HH:mm') : null;
|
att.value = att.value !== null ? moment(att.value).format('YYYY/MM/DD HH:mm') : null;
|
||||||
@@ -232,10 +232,10 @@ export default defineStore('allMapDataStore', {
|
|||||||
const response = await this.$axios.get(api);
|
const response = await this.$axios.get(api);
|
||||||
this.allBaseTraceTaskSeq = response.data.task_seq;
|
this.allBaseTraceTaskSeq = response.data.task_seq;
|
||||||
this.allBaseCase = response.data.cases;
|
this.allBaseCase = response.data.cases;
|
||||||
this.allBaseCase.map(c => {
|
this.allBaseCase.forEach(c => {
|
||||||
c.started_at = moment(c.started_at).format('YYYY/MM/DD HH:mm');
|
c.started_at = moment(c.started_at).format('YYYY/MM/DD HH:mm');
|
||||||
c.completed_at = moment(c.completed_at).format('YYYY/MM/DD HH:mm');
|
c.completed_at = moment(c.completed_at).format('YYYY/MM/DD HH:mm');
|
||||||
c.attributes.map(att => {
|
c.attributes.forEach(att => {
|
||||||
switch (att.type) {
|
switch (att.type) {
|
||||||
case 'date':
|
case 'date':
|
||||||
att.value = att.value !== null ? moment(att.value).format('YYYY/MM/DD HH:mm') : null;
|
att.value = att.value !== null ? moment(att.value).format('YYYY/MM/DD HH:mm') : null;
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ export default defineStore('conformanceStore', {
|
|||||||
const newData = state.allCases.map(c => {
|
const newData = state.allCases.map(c => {
|
||||||
c.started_at = moment(c.started_at).format('YYYY/MM/DD HH:mm');
|
c.started_at = moment(c.started_at).format('YYYY/MM/DD HH:mm');
|
||||||
c.completed_at = moment(c.completed_at).format('YYYY/MM/DD HH:mm');
|
c.completed_at = moment(c.completed_at).format('YYYY/MM/DD HH:mm');
|
||||||
c.facets.map(fac => {
|
c.facets.forEach(fac => {
|
||||||
switch(fac.type) {
|
switch(fac.type) {
|
||||||
case 'dummy': //sonar-qube
|
case 'dummy': //sonar-qube
|
||||||
case 'duration-list':
|
case 'duration-list':
|
||||||
@@ -135,7 +135,7 @@ export default defineStore('conformanceStore', {
|
|||||||
};
|
};
|
||||||
return fac;
|
return fac;
|
||||||
});
|
});
|
||||||
c.attributes.map(att => {
|
c.attributes.forEach(att => {
|
||||||
switch (att.type) {
|
switch (att.type) {
|
||||||
case 'date':
|
case 'date':
|
||||||
att.value = att.value !== null ? moment(att.value).format('YYYY/MM/DD HH:MM:ss') : null;
|
att.value = att.value !== null ? moment(att.value).format('YYYY/MM/DD HH:MM:ss') : null;
|
||||||
@@ -165,7 +165,7 @@ export default defineStore('conformanceStore', {
|
|||||||
const newData = state.allLoopCases.map(c => {
|
const newData = state.allLoopCases.map(c => {
|
||||||
c.started_at = moment(c.started_at).format('YYYY/MM/DD HH:mm');
|
c.started_at = moment(c.started_at).format('YYYY/MM/DD HH:mm');
|
||||||
c.completed_at = moment(c.completed_at).format('YYYY/MM/DD HH:mm');
|
c.completed_at = moment(c.completed_at).format('YYYY/MM/DD HH:mm');
|
||||||
c.attributes.map(att => {
|
c.attributes.forEach(att => {
|
||||||
switch (att.type) {
|
switch (att.type) {
|
||||||
case 'date':
|
case 'date':
|
||||||
att.value = att.value !== null ? moment(att.value).format('YYYY/MM/DD HH:mm:ss') : null;
|
att.value = att.value !== null ? moment(att.value).format('YYYY/MM/DD HH:mm:ss') : null;
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export default defineStore('filesStore', {
|
|||||||
const response = await axios.get(api);
|
const response = await axios.get(api);
|
||||||
|
|
||||||
this.allEventFiles = response.data;
|
this.allEventFiles = response.data;
|
||||||
this.allEventFiles.map(o => {
|
this.allEventFiles.forEach(o => {
|
||||||
switch (o.type) {
|
switch (o.type) {
|
||||||
case 'log':
|
case 'log':
|
||||||
icon = 'work_history';
|
icon = 'work_history';
|
||||||
|
|||||||
@@ -266,10 +266,10 @@ export default defineStore('useMapPathStore', {
|
|||||||
},
|
},
|
||||||
async highlightMostFrequentPath() {
|
async highlightMostFrequentPath() {
|
||||||
const LIST_INDEX = 0;
|
const LIST_INDEX = 0;
|
||||||
this.insightWithPath['most_freq_traces'][LIST_INDEX].nodes.map(nodeToHighlight => {
|
this.insightWithPath['most_freq_traces'][LIST_INDEX].nodes.forEach(nodeToHighlight => {
|
||||||
nodeToHighlight.data('nodeImageUrl', ImgCapsulesGlow[nodeToHighlight.data('level')]);
|
nodeToHighlight.data('nodeImageUrl', ImgCapsulesGlow[nodeToHighlight.data('level')]);
|
||||||
});
|
});
|
||||||
this.insightWithPath['most_freq_traces'][LIST_INDEX].edges.map(edgeToHighlight =>
|
this.insightWithPath['most_freq_traces'][LIST_INDEX].edges.forEach(edgeToHighlight =>
|
||||||
edgeToHighlight.addClass('highlight-edge'));
|
edgeToHighlight.addClass('highlight-edge'));
|
||||||
},
|
},
|
||||||
async highlightMostFrequentPathUnused() {
|
async highlightMostFrequentPathUnused() {
|
||||||
|
|||||||
@@ -384,7 +384,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
mapData.edges = [];
|
mapData.edges = [];
|
||||||
this[mapType].edges.map(edge => {
|
this[mapType].edges.forEach(edge => {
|
||||||
mapData.edges.push({
|
mapData.edges.push({
|
||||||
data: {
|
data: {
|
||||||
source:edge.tail,
|
source:edge.tail,
|
||||||
@@ -426,7 +426,7 @@
|
|||||||
// 找出 type activity's node
|
// 找出 type activity's node
|
||||||
const activityNodeArray = nodes.filter(node => node.data.type === 'activity');
|
const activityNodeArray = nodes.filter(node => node.data.type === 'activity');
|
||||||
// 找出除了 start, end 以外所有的 node 的 option value
|
// 找出除了 start, end 以外所有的 node 的 option value
|
||||||
activityNodeArray.map(node => nodeOptionArr.push(node.data[this.dataLayerType][this.dataLayerOption]));
|
activityNodeArray.forEach(node => nodeOptionArr.push(node.data[this.dataLayerType][this.dataLayerOption]));
|
||||||
// 將node的option值從小到大排序(映對色階淺到深)
|
// 將node的option值從小到大排序(映對色階淺到深)
|
||||||
nodeOptionArr = nodeOptionArr.sort((a, b) => a - b);
|
nodeOptionArr = nodeOptionArr.sort((a, b) => a - b);
|
||||||
for(let i = 0; i < ImgCapsules.length; i++) {
|
for(let i = 0; i < ImgCapsules.length; i++) {
|
||||||
@@ -435,10 +435,10 @@
|
|||||||
leveledGroups.push(nodeOptionArr.slice(startIdx, endIdx));
|
leveledGroups.push(nodeOptionArr.slice(startIdx, endIdx));
|
||||||
}
|
}
|
||||||
for(let level = 0; level < leveledGroups.length; level++) {
|
for(let level = 0; level < leveledGroups.length; level++) {
|
||||||
leveledGroups[level].map(option => {
|
leveledGroups[level].forEach(option => {
|
||||||
// 考慮可能有名次一樣的情形
|
// 考慮可能有名次一樣的情形
|
||||||
const curNodes = activityNodeArray.filter(activityNode => activityNode.data[this.dataLayerType][this.dataLayerOption] === option);
|
const curNodes = activityNodeArray.filter(activityNode => activityNode.data[this.dataLayerType][this.dataLayerOption] === option);
|
||||||
curNodes.map(curNode => {
|
curNodes.forEach(curNode => {
|
||||||
curNode.data = {
|
curNode.data = {
|
||||||
...curNode.data,
|
...curNode.data,
|
||||||
nodeImageUrl: ImgCapsules[level],
|
nodeImageUrl: ImgCapsules[level],
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
mapData.edges = [];
|
mapData.edges = [];
|
||||||
this[mapType].edges.map(edge => {
|
this[mapType].edges.forEach(edge => {
|
||||||
mapData.edges.push({
|
mapData.edges.push({
|
||||||
data: {
|
data: {
|
||||||
source: edge.tail,
|
source: edge.tail,
|
||||||
@@ -444,7 +444,7 @@ export default {
|
|||||||
// 找出 type activity's node
|
// 找出 type activity's node
|
||||||
const activityNodeArray = nodes.filter(node => node.data.type === 'activity');
|
const activityNodeArray = nodes.filter(node => node.data.type === 'activity');
|
||||||
// 找出除了 start, end 以外所有的 node 的 option value
|
// 找出除了 start, end 以外所有的 node 的 option value
|
||||||
activityNodeArray.map(node => nodeOptionArr.push(node.data[this.dataLayerType][this.dataLayerOption]));
|
activityNodeArray.forEach(node => nodeOptionArr.push(node.data[this.dataLayerType][this.dataLayerOption]));
|
||||||
// 將node的option值從小到大排序(映對色階淺到深)
|
// 將node的option值從小到大排序(映對色階淺到深)
|
||||||
nodeOptionArr = nodeOptionArr.sort((a, b) => a - b);
|
nodeOptionArr = nodeOptionArr.sort((a, b) => a - b);
|
||||||
for (let i = 0; i < ImgCapsules.length; i++) {
|
for (let i = 0; i < ImgCapsules.length; i++) {
|
||||||
@@ -453,10 +453,10 @@ export default {
|
|||||||
leveledGroups.push(nodeOptionArr.slice(startIdx, endIdx));
|
leveledGroups.push(nodeOptionArr.slice(startIdx, endIdx));
|
||||||
}
|
}
|
||||||
for (let level = 0; level < leveledGroups.length; level++) {
|
for (let level = 0; level < leveledGroups.length; level++) {
|
||||||
leveledGroups[level].map(option => {
|
leveledGroups[level].forEach(option => {
|
||||||
// 考慮可能有名次一樣的情形
|
// 考慮可能有名次一樣的情形
|
||||||
const curNodes = activityNodeArray.filter(activityNode => activityNode.data[this.dataLayerType][this.dataLayerOption] === option);
|
const curNodes = activityNodeArray.filter(activityNode => activityNode.data[this.dataLayerType][this.dataLayerOption] === option);
|
||||||
curNodes.map(curNode => {
|
curNodes.forEach(curNode => {
|
||||||
curNode.data = {
|
curNode.data = {
|
||||||
...curNode.data,
|
...curNode.data,
|
||||||
nodeImageUrl: ImgCapsules[level],
|
nodeImageUrl: ImgCapsules[level],
|
||||||
|
|||||||
Reference in New Issue
Block a user