PluginCatalog/Entry.pm

filter: Statementstmt 62.9% 17 / 27 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 3 / 6 Podpod 50.0% 1 / 2 totaltotal 50.0% 21 / 42 CC 4 SCAR 22.7
CC
4
Cov
53%
BUILD
20.0
__ANON__
2.0
other_tags
2.0
CRAP 9.7
« PluginCatalog.pm ↑ Summary
1 #---------------------------------------------------------------------
2 package Pod::PluginCatalog::Entry;
3 #
4 # Copyright 2012 Christopher J. Madsen
5 #
6 # Author: Christopher J. Madsen <perl@cjmweb.net>
7 # Created: 20 Jul 2012
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the same terms as Perl itself.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the
15 # GNU General Public License or the Artistic License for more details.
16 #
17 # ABSTRACT: An entry in a PluginCatalog
18 #---------------------------------------------------------------------
19  
20 1 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 1 our $VERSION = '0.02'; #VERSION
24 # This file is part of Pod-PluginCatalog 0.02 (January 3, 2015)
25  
26 #=====================================================================
27  
28  
29 1 has name => (
30 is => 'ro',
31 isa => 'Str',
32 required => 1,
33 );
34  
35 1 has module => (
36 is => 'ro',
37 isa => 'Str',
38 required => 1,
39 );
40  
41 1 has description => (
42 is => 'ro',
43 isa => 'Str',
44 required => 1,
45 );
46  
47 1 has author => (
48 is => 'ro',
49 isa => 'Str',
50 );
51  
52 1 has source_file => (
53 is => 'ro',
54 isa => 'Str',
55 );
56  
57 has _tags => (
58 is => 'ro',
59 isa => 'HashRef',
60 0 ▶ default => sub { {} },
Subroutine __ANON__: not called CC=1 SCAR=6.9
61 1 traits => ['Hash'],
62 handles => {
63 has_tag => 'exists',
64 tags => 'keys',
65 },
66 );
67  
68  
69 sub other_tags
70 0 ▶{
Subroutine other_tags: not called CC=1 SCAR=6.9
Pod documented
71 0 my ($self, $tag) = @_;
72  
73 0 grep { $_ ne $tag } sort $self->tags;
74 } # end other_tags
75  
76 #---------------------------------------------------------------------
77 sub BUILD
78 0 ▶{
Subroutine BUILD: not called CC=4 SCAR=30.0
Pod undocumented
79 0 my ($self, $args) = @_;
80  
81 0 my $tags = $self->_tags;
82  
83 0 ▶ confess 'tags is required' unless ref $args->{tags} and @{ $args->{tags} };
Branch: 1 branch
BranchTrueFalseTotal
unless ref $args->{"tags"} and @{$args->{"tags"};} 0 0 0
Condition0%0/3
ref $args->{"tags"} and @{$args->{"tags"};}
!ll&&!rl&&r
000
MC/DC0%0/2
ref $args->{"tags"} and @{$args->{"tags"};}
ref $args->{"tags"} @{$args->{"tags"};}
Truth table0%0/3
A and B
A= ref $args->{"tags"}B= @{$args->{"tags"};}
ABresult
0X0
100
111
84  
85 0 $tags->{$_} = undef for @{ $args->{tags} };
86 } # end BUILD
87  
88 #=====================================================================
89 # Package Return Value:
90  
91 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
92 1 __PACKAGE__->meta->make_immutable;
93 1 1;
94  
95 __END__
« PluginCatalog.pm ↑ Summary