PurePerl/Object/Tag.pm

filter: Statementstmt 57.8% 22 / 38 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 47.2% 26 / 55 CC 5 SCAR 28.4
CC
5
Cov
47%
BUILD
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 17.1
« PurePerl/Protocol.pm ↑ Summary PurePerl/Pack.pm »
1 package Git::PurePerl::Object::Tag;
2 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 extends 'Git::PurePerl::Object';
8  
9 4 has 'kind' =>
10 ( is => 'ro', isa => 'ObjectKind', required => 1, default => 'tag' );
11 4 has 'object' => ( is => 'rw', isa => 'Str', required => 0 );
12 4 has 'tag' => ( is => 'rw', isa => 'Str', required => 0 );
13 4 has 'tagger' => ( is => 'rw', isa => 'Git::PurePerl::Actor', required => 0 );
14 4 has 'tagged_time' => ( is => 'rw', isa => 'DateTime', required => 0 );
15 4 has 'comment' => ( is => 'rw', isa => 'Str', required => 0 );
16 4 has 'object_kind' =>
17 ( is => 'rw', isa => 'ObjectKind', required => 0);
18  
19 4 my %method_map = (type => 'object_kind');
20  
21 0 ▶sub BUILD {
Subroutine BUILD: not called CC=5 SCAR=34.0
Pod undocumented
22 0 my $self = shift;
23 0 my @lines = split "\n", $self->content;
24 0 ▶ while ( my $line = shift @lines ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $line = shift @lines) 0 0 0
25 0 ▶ last unless $line;
Branch: 1 branch
BranchTrueFalseTotal
unless $line 0 0 0
26 0 my ( $key, $value ) = split ' ', $line, 2;
27
28 0 ▶ if ($key eq 'tagger') {
Branch: 1 branch
BranchTrueFalseTotal
if ($key eq 'tagger') { } 0 0 0
29 0 my @data = split ' ', $value;
30 0 my ($email, $epoch, $tz) = splice(@data, -3);
31 0 my $name = join(' ', @data);
32 0 my $actor =
33 Git::PurePerl::Actor->new( name => $name, email => $email );
34 0 $self->tagger($actor);
35 0 my $dt= DateTime->from_epoch( epoch => $epoch, time_zone => $tz );
36 0 $self->tagged_time($dt);
37 } else {
38 0 ▶ my $method = $method_map{$key} || $key;
Condition0%0/3
$method_map{$key} || $key
l!l&&r!l&&!r
000
MC/DC0%0/2
$method_map{$key} || $key
$method_map{$key} $key
Truth table0%0/3
A || B
A= $method_map{$key}B= $key
ABresult
1X1
011
000
39 0 $self->$method($value);
40 }
41 }
42 0 $self->comment( join "\n", @lines );
43 }
44  
45 4 __PACKAGE__->meta->make_immutable;
46  
« PurePerl/Protocol.pm ↑ Summary PurePerl/Pack.pm »