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