XPath/Boolean.pm

filter: Statementstmt 50.0% 17 / 34 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 38.4% 5 / 13 Podpod 50.0% 4 / 8 totaltotal 44.0% 26 / 59 CC 3 SCAR 10.1
CC
3
Cov
45%
cmp
6.0
to_literal
6.0
True
2.0
CRAP 2.7
« XPath/Node/Attribute.pm ↑ Summary XPath/Literal.pm »
1 package XML::XPath::Boolean;
2  
3 1 $VERSION = '1.26';
4  
5 1 ▶use XML::XPath::Number;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use XML::XPath::Literal;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 use overload
10 1 '""' => \&value,
11 1 ▶ '<=>' => \&cmp;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub True {
14 0 ▶ my $class = shift;
Subroutine True: not called CC=1 SCAR=6.9
Pod documented
15 0 my $val = 1;
16 0 bless \$val, $class;
17 }
18  
19 sub False {
20 0 ▶ my $class = shift;
Subroutine False: not called CC=1 SCAR=6.9
Pod documented
21 0 my $val = 0;
22 0 bless \$val, $class;
23 }
24  
25 sub value {
26 0 ▶ my $self = shift;
Subroutine value: not called CC=1 SCAR=6.9
Pod documented
27 0 $$self;
28 }
29  
30 sub cmp {
31 0 ▶ my $self = shift;
Subroutine cmp: not called CC=2 SCAR=17.9
Pod undocumented
32 0 my ($other, $swap) = @_;
33 0 ▶ if ($swap) {
Branch: 1 branch
BranchTrueFalseTotal
if ($swap) 0 0 0
34 0 return $other <=> $$self;
35 }
36 0 return $$self <=> $other;
37 }
38  
39 0 ▶sub to_number { XML::XPath::Number->new($_[0]->value); }
Subroutine to_number: not called CC=1 SCAR=6.9
Pod undocumented
40 0 ▶sub to_boolean { $_[0]; }
Subroutine to_boolean: not called CC=1 SCAR=6.9
Pod undocumented
41 0 ▶sub to_literal { XML::XPath::Literal->new($_[0]->value ? "true" : "false"); }
Subroutine to_literal: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->value ? : 0 0 0
42  
43 0 ▶sub string_value { return $_[0]->to_literal->value; }
Subroutine string_value: not called CC=1 SCAR=6.9
Pod undocumented
44  
45 1 1;
46 __END__
« XPath/Node/Attribute.pm ↑ Summary XPath/Literal.pm »