BlankOnDev/Form/github.pm

filter: Statementstmt 38.6% 17 / 44 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 31.8% 22 / 69 CC 7 SCAR 35.0
CC
7
Cov
29%
form_config_github
56.0
BEGIN
1.0
BEGIN
1.0
CRAP 33.1
« BlankOnDev/system.pm ↑ Summary BlankOnDev/Form.pm »
1 package BlankOnDev::Form::github;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # Import :
6 1 ▶use Term::ReadKey;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use BlankOnDev::Rilis;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use BlankOnDev::command;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 # Version :
11 1 our $VERSION = '0.1005';
12  
13 # Subroutine for config github :
14 # ------------------------------------------------------------------------
15 0 ▶sub form_config_github {
Subroutine form_config_github: not called CC=7 SCAR=40.3
Pod undocumented
16 0 my ($self, $name, $email) = @_;
17  
18 # Prepare form :
19 0 my $confirmation;
20 0 my $home_dir = $ENV{"HOME"};
21 0 my $r_gitset;
22  
23 # Get Command :
24 # ----------------------------------------------------------------
25 0 my $get_cmd = BlankOnDev::command::github();
26 0 my $getGit_cmd = $get_cmd->{'git'};
27 0 my $gitCmd_name = $getGit_cmd->{'cfg-name'};
28 0 my $gitCmd_email = $getGit_cmd->{'cfg-email'};
29  
30 # Check file config github :
31 0 ▶ if (-e $home_dir.'/.gitconfig') {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $home_dir . '/.gitconfig') { } 0 0 0
32 # Form Confirmation :
33 0 print "\n\n";
34 0 print "You want reconfig github ? [y or n] ";
35 0 chomp($confirmation = <STDIN>);
36 0 ▶ if ($confirmation eq 'y') {
Branch: 1 branch
BranchTrueFalseTotal
if ($confirmation eq "y") 0 0 0
37  
38 0 ▶ if ($name ne '' and $email ne '') {
Branch: 1 branch
BranchTrueFalseTotal
if ($name ne '' and $email ne '') { } 0 0 0
Condition0%0/3
$name ne "" and $email ne ""
!ll&&!rl&&r
000
MC/DC0%0/2
$name ne "" and $email ne ""
$name ne "" $email ne ""
Truth table0%0/3
A and B
A= $name ne ""B= $email ne ""
ABresult
0X0
100
111
39 0 system("$gitCmd_name \"$name\"");
40 0 system("$gitCmd_email \"$email\"");
41 0 $r_gitset = 1;
42 } else {
43 0 $r_gitset = 0;
44 0 print "git user.name or user.email not enter\n";
45 0 exit 0;
46 }
47 }
48 } else {
49 0 ▶ if ($name ne '' and $email ne '') {
Branch: 1 branch
BranchTrueFalseTotal
if ($name ne '' and $email ne '') { } 0 0 0
Condition0%0/3
$name ne "" and $email ne ""
!ll&&!rl&&r
000
MC/DC0%0/2
$name ne "" and $email ne ""
$name ne "" $email ne ""
Truth table0%0/3
A and B
A= $name ne ""B= $email ne ""
ABresult
0X0
100
111
50 0 system("$gitCmd_name \"$name\"");
51 0 system("$gitCmd_email \"$email\"");
52 0 $r_gitset = 1;
53 } else {
54 0 $r_gitset = 0;
55 0 print "git user.name or user.email not enter\n";
56 0 exit 0;
57 }
58 }
59 }
60 1 1;
« BlankOnDev/system.pm ↑ Summary BlankOnDev/Form.pm »