blib/lib/Pod/Weaver/Section/Bugs/DefaultRT.pm

filter: Statementstmt 39.3% 13 / 33 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 30.1% 16 / 53 CC 8 SCAR 39.6
CC
8
Cov
28%
weave_section
72.0
BEGIN
1.0
BEGIN
1.0
CRAP 52.6
↑ Summary
1 package Pod::Weaver::Section::Bugs::DefaultRT;
2  
3 1 our $DATE = '2016-10-07'; # DATE
4 1 our $VERSION = '0.06'; # VERSION
5  
6 1 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 #use Text::Wrap ();
9 1 with 'Pod::Weaver::Role::Section';
10 1 with 'Pod::Weaver::Role::AddTextToSection';
11  
12 0 ▶sub weave_section {
Subroutine weave_section: not called CC=8 SCAR=42.8
Pod undocumented
13 0 my ($self, $document, $input) = @_;
14  
15 0 my ($web,$mailto);
16 0 for my $meta_key (qw(distmeta meta)){
17 0 ▶ if ($input->{$meta_key}{resources}{bugtracker}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($input->{$meta_key}{"resources"}{"bugtracker"}) 0 0 0
18 0 my $bugtracker = $input->{$meta_key}{resources}{bugtracker};
19 0 ($web,$mailto) = @{$bugtracker}{qw/web mailto/};
20 0 last;
21 }
22 }
23  
24 0 ▶ if (!$web && !$mailto) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($web or $mailto) 0 0 0
Condition0%0/3
$web or $mailto
l!l&&r!l&&!r
000
MC/DC0%0/2
$web or $mailto
$web $mailto
Truth table0%0/3
A or B
A= $webB= $mailto
ABresult
1X1
011
000
25 0 my $name = $input->{zilla}->name;
26 0 $web = "http://rt.cpan.org/Public/Dist/Display.html?Name=$name";
27 }
28 0 my $text = "Please report any bugs or feature requests ";
29  
30 0 ▶ if (defined $web) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $web) 0 0 0
31 0 $text .= "on the bugtracker website L<$web>";
32 0 ▶ $text .= defined $mailto ? " or " : "\n";
Branch: 1 branch
BranchTrueFalseTotal
defined $mailto ? : 0 0 0
33 }
34  
35 0 ▶ if (defined $mailto) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $mailto) 0 0 0
36 0 $text .= "by email to L<mailto:$mailto>\.\n";
37 }
38  
39 # disabled temporarily, Text::Wrap wraps "L<blah" + ">". a better wrapping
40 # module is needed.
41 # $text = Text::Wrap::wrap(q{}, q{}, $text);
42  
43 0 $text .= <<'HERE';
44  
45 When submitting a bug or request, please include a test-file or a
46 patch to an existing test-file that illustrates the bug or desired
47 feature.
48 HERE
49  
50 0 $text .= "\n\n";
51  
52 0 $self->add_text_to_section($document, $text, 'BUGS',
53 {ignore=>1});
54 }
55  
56 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
57 1 1;
58 # ABSTRACT: Add a BUGS section to refer to bugtracker (or RT as default)
59  
60 __END__
↑ Summary