Total Complexity | 4 |
Complexity/F | 1 |
Lines of Code | 27 |
Function Count | 4 |
Duplicated Lines | 27 |
Ratio | 100 % |
Changes | 0 |
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | View Code Duplication | import VueEvents from 'vue-events'; |
|
|
|||
2 | import PerformanceIndexTable from '@/vue/tables/performance/PerformanceIndexTable.vue'; |
||
3 | import SampleRangePicker from '@/vue/common/SampleRangePicker.vue'; |
||
4 | import PerformanceDetailAreaChart from '@/vue/charts/performance/PerformanceDetailAreaChart.vue'; |
||
5 | import RecommendationsList from '@/vue/common/RecommendationsList.vue'; |
||
6 | |||
7 | Vue.use(VueEvents); |
||
8 | // Create our vue instance |
||
9 | const vm = new Vue({ |
||
10 | el: "#cp-nav-content", |
||
11 | components: { |
||
12 | 'performance-index-table': PerformanceIndexTable, |
||
13 | 'sample-range-picker': SampleRangePicker, |
||
14 | 'performance-detail-area-chart': PerformanceDetailAreaChart, |
||
15 | 'recommendations-list': RecommendationsList, |
||
16 | }, |
||
17 | data: { |
||
18 | }, |
||
19 | methods: { |
||
20 | onTableRefresh(vuetable) { |
||
21 | Vue.nextTick(() => vuetable.refresh()); |
||
22 | } |
||
23 | }, |
||
24 | mounted() { |
||
25 | this.$events.$on('refresh-table', eventData => this.onTableRefresh(eventData)); |
||
26 | }, |
||
27 | }); |
||
28 |