resources/assets/js/profile/autoloader.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 24
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 15
c 0
b 0
f 0
dl 0
loc 24
rs 10
wmc 3
mnd 1
bc 1
fnc 2
bpm 0.5
cpm 1.5
noi 1

2 Functions

Rating   Name   Duplication   Size   Complexity  
A Autoloader.constructor 0 3 1
A Autoloader.lazyLoad 0 13 2
1
import { Detail } from './detail'
2
import { Edit } from './edit'
3
4
class Autoloader {
5
    constructor() {
6
        this.lazyLoad()
7
    }
8
9
    lazyLoad() {
10
        let page = $('meta[name="page"]').attr('content')
11
12
        switch (page) {
13
            case 'detail':
14
                new Detail()
15
                break;
16
17
            case 'edit':
18
                new Edit()
19
                break;
20
        }
21
    }
22
}
23
24
new Autoloader()
0 ignored issues
show
Unused Code Best Practice introduced by
The object created with new Autoloader() is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...