| 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
MC/DC0%0/2
ref $this || $this
ref $this
$this
Truth table33%1/3
A || B
A= ref $thisB= $this
| |||||||||||||||||||||||||||||
| 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
Condition33%1/3
$first eq "^" or $first eq "%"
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 "%"
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 38 | 422 | $data; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 9 | 1; | |||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | __END__ | ||||||||||||||||||||||||||||