Passed
Push — v1 ( 052770...2288f4 )
by Andrew
35:50 queued 27:05
created

src/web/assets/src/js/performance-detail.js   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 32
Function Count 4

Duplication

Duplicated Lines 32
Ratio 100 %

Importance

Changes 0
Metric Value
wmc 4
eloc 25
c 0
b 0
f 0
dl 32
loc 32
rs 10
mnd 0
bc 0
fnc 4
bpm 0
cpm 1
noi 3

How to fix   Duplicated Code   

Duplicated Code

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';
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
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({
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Unused Code Best Practice introduced by
The object created with new Vue({IdentifierNode(...one)),false,false))))}) is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...
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
});
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
33