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