blib/lib/Pod/Weaver/Section/Author/GETTY/Legal.pm

filter: Statementstmt 100% 31 / 31 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 97.5% 39 / 40 CC 3 SCAR 6.2
CC
3
Cov
97%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« .github/dzil-binary/win-dlls.pl ↑ Summary blib/lib/Pod/Weaver/PluginBundle/Author/GETTY.pm »
1 package Pod::Weaver::Section::Author::GETTY::Legal;
2 # ABSTRACT: Copyright and license section with a link to the author's site
3 4 our $VERSION = '0.328';
4 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 extends 'Pod::Weaver::Section::Legal';
6  
7 4 ▶use Pod::Elemental::Element::Nested;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use Pod::Elemental::Element::Pod5::Ordinary;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11  
12 4 has url => (
13 is => 'ro',
14 isa => 'Str',
15 default => 'https://raudssus.de/',
16 );
17  
18  
19 65 ▶around weave_section => sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
20 65 my ($orig, $self, $document, $input) = @_;
21  
22 65 my $before = scalar @{ $document->children };
23 65 $self->$orig($document, $input);
24 65 ▶ return if @{ $document->children } == $before;
Branch: 1 branch
BranchTrueFalseTotal
if @{$document->children;} == $before 0 65 65
25  
26 65 my $section = $document->children->[-1];
27 65 my $url = $self->url;
28 65 ▶ return if grep { index($_->content, $url) >= 0 } @{ $section->children };
Branch: 1 branch
BranchTrueFalseTotal
if grep {index($_->content, $url) != -1;} @{$section->children;} 1 64 65
29  
30 64 push @{ $section->children }, Pod::Elemental::Element::Pod5::Ordinary->new({
31 content => "L<$url>",
32 });
33 4 };
34  
35 4 __PACKAGE__->meta->make_immutable;
36  
37 4 1;
38  
39 __END__
« .github/dzil-binary/win-dlls.pl ↑ Summary blib/lib/Pod/Weaver/PluginBundle/Author/GETTY.pm »