Element/Link.pm

filter: Statementstmt 100% 25 / 25 Branchbran 83.3% 5 / 6 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 5 / 5 Podpod 100% 2 / 2 totaltotal 93.0% 40 / 43 CC 5 SCAR 9.6
CC
5
Cov
94%
as_string
4.1
as_text
2.0
BEGIN
1.0
CRAP 2.6
« Element/TimeRange.pm ↑ Summary Element/TableRow.pm »
1 package Org::Element::Link;
2  
3 6 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use locale;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 extends 'Org::Element';
7 6 with 'Org::ElementRole';
8 6 with 'Org::ElementRole::Inline';
9  
10 6 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
11 6 our $DATE = '2026-07-21'; # DATE
12 6 our $DIST = 'Org-Parser'; # DIST
13 6 our $VERSION = '0.563'; # VERSION
14  
15 6 has link => (is => 'rw');
16 6 has description => (is => 'rw');
17 6 has from_radio_target => (is => 'rw');
18  
19 2 ▶sub as_string {
Subroutine as_string: called CC=4 SCAR=14.2
Pod documented
20 2 my ($self) = @_;
21 2 ▶ return $self->_str if defined $self->_str;
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->_str 0 2 2
22 2 ▶ join("",
Branch: 1 branch
BranchTrueFalseTotal
defined $self->description && length $self->description ? : 1 1 2
Condition66%2/3
defined $self->description and length $self->description
!ll&&!rl&&r
101
MC/DC50%1/2
defined $self->description and length $self->description
defined $self->description length $self->description
Truth table66%2/3
A and B
A= defined $self->descriptionB= length $self->description
ABresult
0X0
100
111
23 "[",
24 "[", $self->link, "]",
25 (defined($self->description) && length($self->description) ?
26 ("[", $self->description->as_string, "]") : ()),
27 "]");
28 }
29  
30 2 ▶sub as_text {
Subroutine as_text: called CC=2 SCAR=6.9
Pod documented
31 2 my $self = shift;
32 2 my $desc = $self->description;
33 2 ▶ defined($desc) ? $desc->as_text : $self->link;
Branch: 1 branch
BranchTrueFalseTotal
defined $desc ? : 1 1 2
34 }
35  
36 6 1;
37 # ABSTRACT: Represent Org hyperlink
38  
39 __END__
« Element/TimeRange.pm ↑ Summary Element/TableRow.pm »