Boolean/Value.pm

filter: Statementstmt 69.7% 30 / 43 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 47.0% 8 / 17 Podpod 0.0% 0 / 3 totaltotal 55.0% 38 / 69 CC 4 SCAR 10.4
CC
4
Cov
61%
__ANON__
6.0
__ANON__
6.0
TO_JSON
6.0
CRAP 2.8
↑ Summary Boolean.pm »
1 package Attribute::Boolean::Value;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings; # FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use 5.14.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 Attribute::Boolean::Value - An overridden class for a boolean value
11  
12 =head1 USAGE
13  
14 This is a private class for use only by Attribute::Boolean
15  
16 =cut
17  
18 2 ▶use parent 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶use version;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 2 our $VERSION = version->declare('v1.0.7');
23 2 our @EXPORT = qw(true false);
24  
25 sub true();
26 sub false();
27  
28 use overload
29 0 ▶ "0+" => sub { ${$_[0]} },
Subroutine BEGIN: called CC=1 SCAR=4.4
Subroutine __ANON__: not called CC=1 SCAR=6.9
30 0 ▶ "bool" => sub { ${$_[0]} },
Subroutine __ANON__: not called CC=1 SCAR=6.9
31 0 ▶ '""' => sub { ${$_[0]} ? 'true' : 'false'},
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
${$_[0];} ? : 0 0 0
32 0 ▶ '!' => sub { ${$_[0]} ? false : true},
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
${$_[0];} ? : 0 0 0
33 0 ▶ '-' => sub { croak 'subtraction not possible'},
Subroutine __ANON__: not called CC=1 SCAR=6.9
34 0 ▶ '+' => sub { croak 'addition not possible'},
Subroutine __ANON__: not called CC=1 SCAR=6.9
35 2 fallback => 1
36 2 ;
37  
38 2 my $true = do { bless \(my $dummy = 1), __PACKAGE__ };
39 2 my $false = do { bless \(my $dummy = 0), __PACKAGE__ };
40  
41 0 ▶sub true() { $true }
Subroutine true: not called CC=1 SCAR=6.9
Pod undocumented
42 0 ▶sub false() { $false }
Subroutine false: not called CC=1 SCAR=6.9
Pod undocumented
43  
44 0 ▶sub TO_JSON($) {
Subroutine TO_JSON: not called CC=2 SCAR=17.9
Pod undocumented
45 0 ▶ return $_[0] ? \1 : \0;
Branch: 1 branch
BranchTrueFalseTotal
$_[0] ? : 0 0 0
46 }
47  
48 2 1;
↑ Summary Boolean.pm »