tasks/bin.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 3

Size

Lines of Code 19
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 11
c 0
b 0
f 0
dl 0
loc 19
rs 10
mnd 2
bc 2
fnc 1
bpm 2
cpm 3
noi 3
1
var hasbin = require('hasbin');
2
var fs = require('fs');
3
var path = require('path');
4
5
module.exports = {
6
    path: function() {
7
        if (fs.existsSync('./vendor/bin/jigsaw')) {
8
            return path.normalize('./vendor/bin/jigsaw')
9
        }
10
11
        if (hasbin.sync('jigsaw')) {
12
            return 'jigsaw';
13
        }
14
15
        console.log('Could not find Jigsaw; please install it via Composer, either locally or globally.');
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
16
17
        process.exit();
0 ignored issues
show
Compatibility Debugging Code Best Practice introduced by
Use of process.exit() is discouraged as it will potentially stop the complete node.js application. Consider quitting gracefully instead by throwing an Error.
Loading history...
Best Practice introduced by
There is no return statement in this branch, but you do return something in other branches. Did you maybe miss it? If you do not want to return anything, consider adding return undefined; explicitly.
Loading history...
18
    }
19
};
20