Patch/Command/Clone.pm

filter: Statementstmt 78.3% 29 / 37 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 77.7% 7 / 9 Podpod n/a totaltotal 67.9% 36 / 53 CC 3 SCAR 14.1
CC
3
Cov
69%
__ANON__
12.0
__ANON__
2.0
BEGIN
1.0
CRAP 4.1
« Patch/Role/Patch.pm ↑ Summary Patch/Role/Git.pm »
1 package Git::CPAN::Patch::Command::Clone;
2 2 our $AUTHORITY = 'cpan:YANICK';
3 #ABSTRACT: Clone a CPAN module's history into a new git repository
4 2 $Git::CPAN::Patch::Command::Clone::VERSION = '2.5.2';
5 2 ▶use 5.20.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use autodie;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use Path::Tiny qw(path);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 2 ▶use MooseX::App::Command;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 extends 'Git::CPAN::Patch::Command::Import';
15  
16 2 ▶use experimental 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 2 parameter target => (
19 is => 'rw',
20 isa => 'Str',
21 required => 0,
22 );
23  
24 2 has _seen_imports => (
25 is => 'rw',
26 isa => 'Bool',
27 default => 0,
28 );
29  
30  
31 0 ▶before [ qw/import_release clone_git_repo /] => sub($self,$release,@) {
Subroutine __ANON__: not called CC=3 SCAR=24.8
32 0 ▶ return if $self->_seen_imports;
Branch: 1 branch
BranchTrueFalseTotal
if $self->_seen_imports 0 0 0
33 0 $self->_set_seen_imports(1);
34  
35 0 ▶ my $target = $self->target || $release->dist_name;
Condition0%0/3
$self->target || $release->dist_name
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->target || $release->dist_name
$self->target $release->dist_name
Truth table0%0/3
A || B
A= $self->targetB= $release->dist_name
ABresult
1X1
011
000
36  
37 0 say "creating $target";
38  
39 0 path($target)->mkdir;
40 0 Git::Repository->run( init => $target );
41 0 $self->set_root($target);
42 2 };
43  
44 0 ▶after [ qw/ clone_git_repo import_release /] => sub($self,@) {
Subroutine __ANON__: not called CC=1 SCAR=6.9
45 0 $self->git_run( 'reset', '--hard', $self->last_commit );
46 2 };
47  
48 2 __PACKAGE__->meta->make_immutable;
49  
50 2 1;
51  
52 __END__
« Patch/Role/Patch.pm ↑ Summary Patch/Role/Git.pm »