DWH_File/Value/Plain.pm

filter: Statementstmt 96.9% 32 / 33 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 5 totaltotal 73.7% 45 / 61 CC 5 SCAR 6.5
CC
5
Cov
84%
from_input
3.6
new
2.1
actual_value
2.0
CRAP 1.9
« DWH_File/Aware.pm ↑ Summary DWH_File/Tie.pm »
1 package DWH_File::Value::Plain;
2  
3 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 9 ▶use vars qw( @ISA $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
6 use overload
7 9 ▶ '""' => \&store_string,
Subroutine BEGIN: called CC=1 SCAR=0.0
8 9 fallback => 1;
9  
10 9 @ISA = qw( DWH_File::Value );
11 9 $VERSION = 0.01;
12  
13 1859 ▶sub new {
Subroutine new: called CC=2 SCAR=7.2
Pod undocumented
14 1859 my ( $this, $data ) = @_;
15 1859 ▶ my $class = ref $this || $this;
Condition33%1/3
ref $this || $this
l!l&&r!l&&!r
018590
MC/DC0%0/2
ref $this || $this
ref $this $this
Truth table33%1/3
A || B
A= ref $thisB= $this
ABresult
1X1
011
000
16 1859 my $self = \$data;
17 1859 bless $self, $class;
18 1859 return $self;
19 }
20  
21 676 ▶sub from_input {
Subroutine from_input: called CC=3 SCAR=12.7
Pod undocumented
22 676 my ( $this, $data ) = @_;
23 676 my $first = substr $data, 0, 1;
24 0 ▶ if ( $first eq '^' or $first eq '%' ) { substr( $data, 0, 0 ) = '%' }
Branch: 1 branch
BranchTrueFalseTotal
if ($first eq "^" or $first eq "%") 0 676 676
Condition33%1/3
$first eq "^" or $first eq "%"
l!l&&r!l&&!r
00676
MC/DC0%0/2
$first eq "^" or $first eq "%"
$first eq "^" $first eq "%"
Truth table33%1/3
A or B
A= $first eq "^"B= $first eq "%"
ABresult
1X1
011
000
25 676 return $this->new( $data );
26 }
27  
28 1183 ▶sub from_stored {
Subroutine from_stored: called CC=1 SCAR=0.0
Pod undocumented
29 1183 my ( $this, $data ) = @_;
30 1183 return $this->new( $data );
31 }
32  
33 3100 ▶sub store_string { ${ $_[ 0 ] } }
Subroutine store_string: called CC=1 SCAR=0.0
Pod undocumented
34  
35 422 ▶sub actual_value {
Subroutine actual_value: called CC=2 SCAR=7.0
Pod undocumented
36 422 my $data = ${ $_[ 0 ] };
37 422 ▶ '%' eq substr $data, 0, 1 and substr( $data, 0, 1 ) = '';
Branch: 1 branch
BranchTrueFalseTotal
"%" eq substr($data, 0, 1) and substr($data, 0, 1) = "" 0 422 422
38 422 $data;
39 }
40  
41 9 1;
42  
43 __END__
« DWH_File/Aware.pm ↑ Summary DWH_File/Tie.pm »