Circle/TaggedString.pm

filter: Statementstmt 81.8% 18 / 22 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 2 totaltotal 66.6% 26 / 39 CC 4 SCAR 7.7
CC
4
Cov
72%
squash
3.4
__ANON__
2.1
new_from_formatting
2.0
CRAP 2.2
« Circle/Net/Raw.pm ↑ Summary Circle/Widget.pm »
1 # You may distribute under the terms of the GNU General Public License
2 #
3 # (C) Paul Evans, 2008-2010 -- leonerd@leonerd.org.uk
4  
5 package Circle::TaggedString;
6  
7 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 ▶use base qw( String::Tagged );
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 String::Tagged->VERSION( '0.11' );
11  
12 4 our $VERSION = '0.173320';
13  
14 sub new_from_formatting
15 0 ▶{
Subroutine new_from_formatting: not called CC=1 SCAR=6.9
Pod undocumented
16 0 my $class = shift;
17 0 my ( $orig ) = @_;
18  
19 0 return $class->clone( $orig,
20 only_tags => [qw( bold under italic reverse monospace blockquote )],
21 convert_tags => {
22 bold => "b",
23 under => "u",
24 italic => "i",
25 reverse => "rv",
26 monospace => "m",
27 blockquote => "bq",
28 # TODO: fg/bg
29 },
30 );
31 }
32  
33 sub squash
34 3 ▶{
Subroutine squash: called CC=3 SCAR=12.3
Pod undocumented
35 3 my $self = shift;
36  
37 3 my @output;
38 3 ▶ $self->iter_substr_nooverlap( sub {
Subroutine __ANON__: called CC=2 SCAR=7.2
39 3 my ( $str, %format ) = @_;
40 3 ▶ push @output, %format ? [ $str, %format ] : $str;
Branch: 1 branch
BranchTrueFalseTotal
%format ? : 0 3 3
41 3 } );
42  
43 3 ▶ return $output[0] if @output == 1 and !ref $output[0];
Branch: 1 branch
BranchTrueFalseTotal
if @output == 1 and not ref $output[0] 3 0 3
Condition33%1/3
@output == 1 and not ref $output[0]
!ll&&!rl&&r
003
MC/DC0%0/2
@output == 1 and not ref $output[0]
@output == 1 not ref $output[0]
Truth table33%1/3
A and not(B)
A= @output == 1B= not ref $output[0]
ABresult
0X0
100
111
44 0 return \@output;
45 }
46  
47 4 0x55AA;
« Circle/Net/Raw.pm ↑ Summary Circle/Widget.pm »