VCI/Abstract/History.pm

filter: Statementstmt 38.8% 14 / 36 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod n/a totaltotal 41.4% 17 / 41 CC 5 SCAR 21.2
CC
5
Cov
39%
__ANON__
12.0
union
12.0
BEGIN
1.0
CRAP 8.3
« VCI/Abstract/Diff.pm ↑ Summary VCI/VCS/Hg/Repository.pm »
1 package VCI::Abstract::History;
2 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use MooseX::Method;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use VCI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 with 'VCI::Abstract::ProjectItem';
7  
8 # XXX Will also need some sort of graph view of commits for things like Git
9 # and Hg.
10  
11 3 has 'commits' => (is => 'ro', isa => 'ArrayRef[VCI::Abstract::Commit]',
12 required => 1);
13  
14 method 'union' => named (
15 # XXX Should be ArrayRef[VCI::Abstract::History]
16 histories => { isa => 'ArrayRef', required => 1 },
17 project => { isa => 'VCI::Abstract::Project', required => 1 },
18 0 ▶) => sub {
Subroutine union: not called CC=3 SCAR=24.8
Subroutine __ANON__: not called CC=3 SCAR=24.8
19 0 my $class = shift;
20 0 my $params = shift;
21 0 my $histories = $params->{histories};
22
23 0 my %commits;
24 0 foreach my $history (@$histories) {
25 0 foreach my $commit (@{ $history->commits }) {
26 0 $commits{$commit->revision} = $commit;
27 }
28 }
29
30 0 my @result = sort { $a->time <=> $b->time } (values %commits);
31
32 0 return $class->new(commits => \@result, project => $params->{project});
33 3 };
34  
35 3 __PACKAGE__->meta->make_immutable;
36  
37 3 1;
38  
39 __END__
« VCI/Abstract/Diff.pm ↑ Summary VCI/VCS/Hg/Repository.pm »