Passed
Push — develop ( 31af39...1ae34d )
by Andrew
26:09 queued 20:25
created

src/web/assets/src/js/errors-index.js   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 25
Function Count 4

Duplication

Duplicated Lines 25
Ratio 100 %

Importance

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

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 VueEvents from 'vue-events';
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
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);
0 ignored issues
show
Bug introduced by
The variable Vue seems to be never declared. If this is a global, consider adding a /** global: Vue */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
7
// Create our vue instance
8
const vm = new Vue({
0 ignored issues
show
Unused Code introduced by
The constant vm seems to be never used. Consider removing it.
Loading history...
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
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());
0 ignored issues
show
Bug introduced by
The variable Vue seems to be never declared. If this is a global, consider adding a /** global: Vue */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
20
        }
21
    },
22
    mounted() {
23
        this.$events.$on('refresh-table', eventData => this.onTableRefresh(eventData));
24
    },
25
});
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...
26