Total Complexity | 4 |
Complexity/F | 1 |
Lines of Code | 32 |
Function Count | 4 |
Duplicated Lines | 32 |
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 Vue from 'vue'; |
|
|
|||
2 | import VueEvents from 'vue-events'; |
||
3 | import PerformanceDetailAreaChart from '@/vue/charts/performance/PerformanceDetailAreaChart.vue'; |
||
4 | import PerformanceDetailTable from '@/vue/tables/performance/PerformanceDetailTable.vue'; |
||
5 | import RadialBarChart from '@/vue/charts/common/RadialBarChart.vue'; |
||
6 | import SimpleBarChart from '@/vue/charts/common/SimpleBarChart.vue'; |
||
7 | import SampleRangePicker from '@/vue/common/SampleRangePicker.vue'; |
||
8 | import SamplePaneFooter from '@/vue/common/SamplePaneFooter.vue'; |
||
9 | import RecommendationsList from '@/vue/common/RecommendationsList.vue'; |
||
10 | |||
11 | Vue.use(VueEvents); |
||
12 | // Create our vue instance |
||
13 | new Vue({ |
||
14 | el: "#cp-nav-content", |
||
15 | components: { |
||
16 | PerformanceDetailAreaChart, |
||
17 | PerformanceDetailTable, |
||
18 | RadialBarChart, |
||
19 | SimpleBarChart, |
||
20 | SampleRangePicker, |
||
21 | SamplePaneFooter, |
||
22 | RecommendationsList, |
||
23 | }, |
||
24 | mounted() { |
||
25 | this.$events.$on('refresh-table', eventData => this.onTableRefresh(eventData)); |
||
26 | }, |
||
27 | methods: { |
||
28 | onTableRefresh(vuetable) { |
||
29 | Vue.nextTick(() => vuetable.refresh()); |
||
30 | } |
||
31 | }, |
||
32 | }); |
||
33 |