GitGot/Repositories.pm

filter: Statementstmt 68.5% 24 / 35 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 63.6% 7 / 11 Podpod 100% 2 / 2 totaltotal 68.7% 33 / 48 CC 2 SCAR 6.9
CC
2
Cov
69%
tags
6.0
__ANON__
2.0
name
2.0
CRAP 2.0
« GitGot/Command/gc.pm ↑ Summary GitGot/Outputter.pm »
1 package App::GitGot::Repositories;
2 40 our $AUTHORITY = 'cpan:GENEHACK';
3 40 $App::GitGot::Repositories::VERSION = '1.339';
4 # ABSTRACT: Object holding a collection of repositories
5 40 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 40 ▶use Types::Standard -types;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 40 ▶use App::GitGot::Types qw/ GotRepo /;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 40 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 40 ▶use MooX::HandlesVia;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 40 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 0 ▶use overload '@{}' => sub { $_[0]->all };
Subroutine BEGIN: called CC=1 SCAR=0.2
Subroutine __ANON__: not called CC=1 SCAR=0.2
16  
17  
18 has repos => (
19 is => 'ro',
20 isa => ArrayRef[GotRepo],
21 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
22 40 required => 1,
23 handles_via => 'Array' ,
24 handles => {
25 all => 'elements'
26 }
27 );
28  
29  
30 0 ▶sub name {
Subroutine name: not called CC=1 SCAR=6.9
Pod documented
31 0 my( $self, $name ) = @_;
32  
33 return App::GitGot::Repositories->new( repos => [
34 0 grep { $_->{name} eq $name } $self->all
35 ]);
36 }
37  
38  
39 0 ▶sub tags {
Subroutine tags: not called CC=2 SCAR=17.9
Pod documented
40 0 my( $self, @tags ) = @_;
41  
42 0 my @repos = $self->all;
43  
44 0 for my $tag ( @tags ) {
45 0 @repos = grep { $_->tags =~ /\b$tag\b/ } @repos;
46 }
47  
48 0 return App::GitGot::Repositories->new( repos => \@repos );
49 }
50  
51 40 1;
52  
53 __END__
« GitGot/Command/gc.pm ↑ Summary GitGot/Outputter.pm »