Passed
Push — v3 ( 932184...c18a4a )
by Andrew
16:41 queued 09:38
created

src/web/assets/src/js/Shortlinks.js   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 20
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 13
c 0
b 0
f 0
dl 0
loc 20
rs 10
mnd 0
bc 0
fnc 4
bpm 0
cpm 1
noi 22
1
import Vue from 'vue';
2
import VueEvents from 'vue-events';
3
import ShortlinksTable from '@/vue/ShortlinksTable.vue';
4
5
Vue.use(VueEvents);
6
// Create our vue instance
7
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...
8
  el: "#cp-nav-content",
0 ignored issues
show
Coding Style introduced by
This line of the multi-line function call does not seem to be indented correctly. Expected 4 spaces, but found 2.
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
9
  components: {
0 ignored issues
show
Coding Style introduced by
This line of the multi-line function call does not seem to be indented correctly. Expected 4 spaces, but found 2.
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
10
    'shortlinks-table': ShortlinksTable,
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 4
Loading history...
11
  },
0 ignored issues
show
Coding Style introduced by
This line of the multi-line function call does not seem to be indented correctly. Expected 4 spaces, but found 2.
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
12
  mounted() {
0 ignored issues
show
Coding Style introduced by
This line of the multi-line function call does not seem to be indented correctly. Expected 4 spaces, but found 2.
Loading history...
Coding Style introduced by
Line indented incorrectly; expected at least 4 spaces, found 2
Loading history...
13
    this.$events.$on('refresh-table', eventData => this.onTableRefresh(eventData));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 8 spaces, found 4
Loading history...
14
  },
0 ignored issues
show
Coding Style introduced by
This line of the multi-line function call does not seem to be indented correctly. Expected 4 spaces, but found 2.
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
15
  methods: {
0 ignored issues
show
Coding Style introduced by
This line of the multi-line function call does not seem to be indented correctly. Expected 4 spaces, but found 2.
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
16
    onTableRefresh(vuetable) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 8 spaces, found 4
Loading history...
17
      Vue.nextTick(() => vuetable.refresh());
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 12 spaces, found 6
Loading history...
18
    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 4
Loading history...
19
  },
0 ignored issues
show
Coding Style introduced by
This line of the multi-line function call does not seem to be indented correctly. Expected 4 spaces, but found 2.
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
20
});
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...
21
22
// Accept HMR as per: https://vitejs.dev/guide/api-hmr.html
23
if (import.meta.hot) {
24
  import.meta.hot.accept(() => {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 4 spaces, found 2
Loading history...
Coding Style introduced by
Opening statement of multi-line function call not indented correctly; expected 0 spaces but found 2
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...
25
    console.log("HMR")
0 ignored issues
show
Coding Style introduced by
This line of the multi-line function call does not seem to be indented correctly. Expected 6 spaces, but found 4.
Loading history...
Coding Style introduced by
Line indented incorrectly; expected at least 8 spaces, found 4
Loading history...
26
  });
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 4 spaces, found 2
Loading history...
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...
27
}
28