blib/lib/HTML/Acronyms.pm

filter: Statementstmt 96.0% 24 / 25 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 94.4% 34 / 36 SCAR 11.0
CC
3
Cov
93%
abbr
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« Build ↑ Summary
1 package HTML::Acronyms;
2 2 $HTML::Acronyms::VERSION = '0.0.3';
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 has 'dict' => (
12 is => 'ro',
13 required => 1,
14 );
15  
16 sub abbr
17 {
18 2 ▶ my ( $self, $args ) = @_;
Subroutine abbr: called CC=3 SCAR=11.1
Pod documented
19  
20 2 my $key = $args->{key};
21 2 my $no_link = $args->{no_link};
22  
23 2 my $rec = $self->dict->{$key};
24  
25 2 ▶ if ( !defined $rec )
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $rec) 0 2 2
26 {
27 0 Carp::confess("unknown key '$key'!");
28 }
29  
30 2 my $tag = qq{<abbr title="$rec->{title}">$rec->{abbr}</abbr>};
31  
32 2 ▶ return +{ html => ( $no_link ? $tag : qq{<a href="$rec->{url}">$tag</a>} ),
Branch: 1 branch
BranchTrueFalseTotal
$no_link ? : 1 1 2
33 };
34 }
35  
36 2 1;
37  
38 __END__
« Build ↑ Summary