AutoLink/Plugin.pm

filter: Statementstmt 94.4% 17 / 18 Branchbran 100% 4 / 4 Conditioncond 57.1% 4 / 7 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 80.0% 4 / 5 Podpod 100% 3 / 3 totaltotal 80.4% 33 / 41 CC 6 SCAR 12.2
CC
6
Cov
86%
linkfy
5.2
new
2.0
process
2.0
CRAP 3.4
« AutoLink.pm ↑ Summary AutoLink/Plugin/CPAN.pm »
1 package Text::AutoLink::Plugin;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 sub new
6 18 ▶{
Subroutine new: called CC=2 SCAR=6.9
Pod documented
7 18 my $class = shift;
8 18 my %args = @_;
9 my $self = bless {
10 18 ▶ target => $args{target} || '',
Condition100%2/2
$args{'target'} || ''
l!l
117
MC/DC100%1/1
$args{'target'} || ''
$args{'target'}
Truth table100%2/2
A
A= $args{'target'}
Aresult
11
00
11 }, $class;
12 18 return $self;
13 }
14  
15 0 ▶sub process { die }
Subroutine process: not called CC=1 SCAR=6.9
Pod documented
16  
17 sub linkfy
18 11 ▶{
Subroutine linkfy: called CC=5 SCAR=16.5
Pod documented
19 11 my $self = shift;
20 11 my %args = @_;
21  
22 11 ▶ my $target = exists $args{target} ? ($args{target} || '') : $self->{target};
Branch: 1 branch
BranchTrueFalseTotal
exists $args{'target'} ? : 4 7 11
Condition50%1/2
$args{"target"} or ""
l!l
04
MC/DC0%0/1
$args{"target"} or ""
$args{"target"}
Truth table50%1/2
A
A= $args{"target"}
Aresult
11
00
23 11 ▶ if ($target) {
Branch: 1 branch
BranchTrueFalseTotal
if ($target) 2 9 11
24 2 $target = qq| target="$target"|;
25 }
26 return sprintf('<a href="%s"%s>%s</a>',
27 11 ▶ $args{href}, $target, $args{text} || $args{href});
Condition33%1/3
$args{'text'} || $args{'href'}
l!l&&r!l&&!r
0110
MC/DC0%0/2
$args{'text'} || $args{'href'}
$args{'text'} $args{'href'}
Truth table33%1/3
A || B
A= $args{'text'}B= $args{'href'}
ABresult
1X1
011
000
28 }
29  
30 3 1;
31  
32 __END__
« AutoLink.pm ↑ Summary AutoLink/Plugin/CPAN.pm »