Completed
Push — master ( 5c721a...2d59ae )
by Elbert
56s
created

src/drivers/npm/index.js   A

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 25
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
c 2
b 0
f 0
nc 2
dl 0
loc 25
rs 10
wmc 3
mnd 1
bc 3
fnc 2
bpm 1.5
cpm 1.5
noi 3

1 Function

Rating   Name   Duplication   Size   Complexity  
A index.js ➔ ??? 0 5 1
1
'use strict';
2
3
const wappalyzer = require('./driver');
4
5
const args = process.argv.slice(2);
6
7
const url = args[0] || '';
8
9
if ( !url ) {
10
  process.stderr.write('No URL specified\n');
11
12
  process.exit(1);
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...
13
}
14
15
wappalyzer.analyze(url)
16
  .then(json => {
17
    process.stdout.write(JSON.stringify(json, null, 2) + '\n')
18
19
    process.exit(0);
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...
20
  })
21
  .catch(error => {
22
    process.stderr.write(error + '\n')
23
24
    process.exit(1);
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...
25
  });
26