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