lib/App/gh/Command/Setup.pm

filter: Statementstmt 50.0% 10 / 20 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 15 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 23.2% 13 / 56 CC 10 SCAR 44.4
CC
10
Cov
23%
run
110.0
BEGIN
1.0
BEGIN
1.0
CRAP 84.8
« lib/App/gh/Command/All.pm ↑ Summary lib/App/gh/Utils.pm »
1 package App::gh::Command::Setup;
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use base qw(App::gh::Command);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 0 ▶sub run {
Subroutine run: not called CC=10 SCAR=47.0
Pod undocumented
7 0 my $self = shift;
8 0 my ( $type , $id , $arg ) = @_;
9  
10 0 ▶ print <<'END' unless ( $type && $id && $arg );
Branch: 1 branch
BranchTrueFalseTotal
unless $type and $id and $arg 0 0 0
Condition0%0/6
$type and $id and $arg
!ll&&!rl&&r
000
$type and $id
!ll&&!rl&&r
000
MC/DC0%0/3
$type and $id and $arg
$type $id $arg
Truth table0%0/4
A and B and C
A= $typeB= $idC= $arg
ABCresult
0XX0
10X0
1100
1111
11  
12 Type, id , token|email is required.
13  
14 Setup command usage:
15  
16 \$ gh setup github [id] [token]
17  
18 \$ gh setup git [name] [email]
19  
20 See help:
21  
22 \$ gh help setup
23  
24 END
25 0 ▶ return unless ( $type && $id && $arg );
Branch: 1 branch
BranchTrueFalseTotal
unless $type and $id and $arg 0 0 0
Condition0%0/6
$type and $id and $arg
!ll&&!rl&&r
000
$type and $id
!ll&&!rl&&r
000
MC/DC0%0/3
$type and $id and $arg
$type $id $arg
Truth table0%0/4
A and B and C
A= $typeB= $idC= $arg
ABCresult
0XX0
10X0
1100
1111
26  
27 0 ▶ if( $type eq 'github' || $type eq 'gh' ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($type eq 'github' or $type eq 'gh') { } 0 0 0
elsif ($type eq 'git') { } 0 0 0
Condition0%0/3
$type eq "github" or $type eq "gh"
l!l&&r!l&&!r
000
MC/DC0%0/2
$type eq "github" or $type eq "gh"
$type eq "github" $type eq "gh"
Truth table0%0/3
A or B
A= $type eq "github"B= $type eq "gh"
ABresult
1X1
011
000
28 0 qx(git config --global github.user "$id");
29 0 qx(git config --global github.token "$arg");
30 }
31 elsif( $type eq 'git' ) {
32 0 qx( git config --global user.name "$id" );
33 0 qx( git config --global user.email "$arg" );
34 }
35  
36 0 print "Done\n";
37 }
38  
39  
40  
41  
42 1 1;
43 __END__
« lib/App/gh/Command/All.pm ↑ Summary lib/App/gh/Utils.pm »