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