Passed
Branch master (27f176)
by refat
18:17
created

gitty.js   A

Complexity

Total Complexity 6
Complexity/F 2

Size

Lines of Code 31
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 20
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 6
mnd 3
bc 3
fnc 3
bpm 1
cpm 2
noi 3

3 Functions

Rating   Name   Duplication   Size   Complexity  
A ➔ cbpush 0 7 2
A ➔ cbcommit 0 7 2
A ➔ cbadd 0 7 2
1
const { exec } = require('child_process');
2
3
const args = process.argv;
4
process.argv.splice(0, 2);
5
const str = args.join(' ');
6
7
function cbpush(err) {
8
  if (err) {
9
    console.log(err);
1 ignored issue
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
10
    return;
11
  }
12
  console.log('done');
13
}
14
15
function cbcommit(err) {
16
  if (err) {
17
    console.log(err);
1 ignored issue
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
18
    return;
19
  }
20
  exec('git push', cbpush);
21
}
22
23
function cbadd(err) {
24
  if (err) {
25
    console.log(err);
1 ignored issue
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
26
    return;
27
  }
28
  exec(`git commit -m "${str}"`, cbcommit);
29
}
30
31
exec('git add .', cbadd);
32