GitGot/Command/chdir.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran 75.0% 3 / 4 Conditioncond 44.4% 4 / 9 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 78.7% 37 / 47 CC 5 SCAR 12.6
CC
5
Cov
81%
_execute
6.1
BEGIN
1.0
BEGIN
1.0
CRAP 3.5
« GitGot/Repo.pm ↑ Summary GitGot/Repo/Git.pm »
1 package App::GitGot::Command::chdir;
2 16 our $AUTHORITY = 'cpan:GENEHACK';
3 16 $App::GitGot::Command::chdir::VERSION = '1.339';
4 # ABSTRACT: open a subshell in a selected project
5 16 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 16 ▶use App::GitGot -command;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 16 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 16 extends 'App::GitGot::Command';
11 16 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 44 ▶sub command_names { qw/ chdir cd / }
Subroutine command_names: called CC=1 SCAR=0.0
Pod documented
14  
15 2 ▶sub _execute {
Subroutine _execute: called CC=5 SCAR=18.0
16 2 my( $self, $opt, $args ) = @_;
17  
18 2 ▶ unless ( $self->active_repos and $self->active_repos == 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->active_repos and $self->active_repos == 1) 1 1 2
Condition66%2/3
$self->active_repos and $self->active_repos == 1
!ll&&!rl&&r
011
MC/DC50%1/2
$self->active_repos and $self->active_repos == 1
$self->active_repos $self->active_repos == 1
Truth table66%2/3
A and B
A= $self->active_reposB= $self->active_repos == 1
ABresult
0X0
100
111
19 1 say STDERR 'ERROR: You need to select a single repo';
20 1 exit(1);
21 }
22  
23 1 my( $repo ) = $self->active_repos;
24  
25 1 ▶ chdir $repo->path
Branch: 1 branch
BranchTrueFalseTotal
chdir $repo->path or say STDERR "ERROR: Failed to chdir to repo ($!)" and exit 1 0 1 1
Condition33%2/6
chdir $repo->path || say(STDERR "ERROR: Failed to chdir to repo ($!)") && exit 1
l!l&&r!l&&!r
010
say STDERR "ERROR: Failed to chdir to repo ($!)" and exit 1
!ll
010
MC/DC0%0/2
chdir $repo->path || say(STDERR "ERROR: Failed to chdir to repo ($!)") && exit 1
chdir $repo->path say STDERR "ERROR: Failed to chdir to repo ($!)"
Truth table33%1/3
A || B
A= chdir $repo->pathB= say STDERR "ERROR: Failed to chdir to repo ($!)"
ABresult
1X1
011
000
26 or say STDERR "ERROR: Failed to chdir to repo ($!)" and exit(1);
27  
28 0 exec $ENV{SHELL};
29 }
30  
31 16 1;
32  
33 ### FIXME docs
34  
35 __END__
« GitGot/Repo.pm ↑ Summary GitGot/Repo/Git.pm »