| 1 | package Enbld::Condition; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | sub new { | ||||||||||||||||||||||||||||||||||||||||||
| 7 | 100 | ▶ | my $class = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 100 | my $self = { | |||||||||||||||||||||||||||||||||||||||||
| 10 | version => 'latest', | ||||||||||||||||||||||||||||||||||||||||||
| 11 | make_test => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 12 | modules => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 13 | arguments => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 14 | annotation => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 15 | @_, | ||||||||||||||||||||||||||||||||||||||||||
| 16 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 100 | bless $self, $class; | |||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 100 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | sub name { | ||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | return $_[0]->{name}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | sub version { | ||||||||||||||||||||||||||||||||||||||||||
| 28 | 38 | ▶ | return $_[0]->{version}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
version: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | sub make_test { | ||||||||||||||||||||||||||||||||||||||||||
| 32 | 44 | ▶ | return $_[0]->{make_test}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
make_test: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | sub modules { | ||||||||||||||||||||||||||||||||||||||||||
| 36 | 42 | ▶ | return $_[0]->{modules}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
modules: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | sub arguments { | ||||||||||||||||||||||||||||||||||||||||||
| 40 | 40 | ▶ | return $_[0]->{arguments}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
arguments: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | sub annotation { | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 11 | ▶ | return $_[0]->{annotation}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
annotation: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | sub serialize { | ||||||||||||||||||||||||||||||||||||||||||
| 48 | 52 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
serialize: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||
| 50 | 52 | my %serialized; | |||||||||||||||||||||||||||||||||||||||||
| 51 | 52 | foreach my $key ( sort keys %{ $self } ) { | |||||||||||||||||||||||||||||||||||||||||
| 52 | 264 | ▶ | next if ( ! $self->{$key} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 60 | $serialized{$key} = $self->{$key}; | |||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | 52 | return \%serialized; | |||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||
| 60 | sub is_equal_to { | ||||||||||||||||||||||||||||||||||||||||||
| 61 | 12 | ▶ | my ( $self, $condition ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_equal_to: called CC=6 SCAR=18.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | 12 | ▶ | return unless ( _is_equal( $self->{version}, $condition->version )); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 64 | 9 | ▶ | return unless ( _is_equal( $self->{make_test}, $condition->make_test )); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | 7 | ▶ | return unless ( _is_equal( $self->{arguments}, $condition->arguments )); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 66 | 7 | ▶ | return unless ( _is_equal( $self->{annotation}, $condition->annotation )); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | 7 | ▶ | return unless ( _is_equal_hash( $self->{modules}, $condition->modules )); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||
| 69 | 4 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||
| 72 | sub _is_equal { | ||||||||||||||||||||||||||||||||||||||||||
| 73 | 35 | ▶ | my ( $val1, $val2 ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_is_equal: called CC=6 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||
| 75 | 35 | ▶ | return 1 if ( ( ! defined $val1 ) && ( ! defined $val2 ) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $val1 or defined $val2
MC/DC100%2/2
defined $val1 or defined $val2
defined $val1
defined $val2
Truth table100%3/3
A or B
A= defined $val1B= defined $val2
| |||||||||||||||||||||||||||||||||||||||||||
| 76 | 15 | ▶ | return 1 if ( ( defined $val1 ) && ( defined $val2 ) && $val1 eq $val2 ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
defined $val1 and defined $val2 and $val1 eq $val2
defined $val1 and defined $val2
MC/DC100%3/3
defined $val1 and defined $val2 and $val1 eq $val2
defined $val1
defined $val2
$val1 eq $val2
Truth table100%4/4
A and B and C
A= defined $val1B= defined $val2C= $val1 eq $val2
| |||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | 5 | return; | |||||||||||||||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||
| 81 | sub _is_equal_hash { | ||||||||||||||||||||||||||||||||||||||||||
| 82 | 7 | ▶ | my ( $val1, $val2 ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_is_equal_hash: called CC=8 SCAR=20.8
| |||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | 7 | ▶ | return 1 if ( ( ! defined $val1 ) && ( ! defined $val2 ) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $val1 or defined $val2
MC/DC100%2/2
defined $val1 or defined $val2
defined $val1
defined $val2
Truth table100%3/3
A or B
A= defined $val1B= defined $val2
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||
| 86 | 4 | ▶ | my $str1 = join( '', keys %{ $val1 } ) if ( defined $val1 ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 87 | 4 | ▶ | my $str2 = join( '', keys %{ $val2 } ) if ( defined $val2 ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||
| 89 | 4 | ▶ | return 1 if ( ( defined $val1 ) && ( defined $val2 ) && $str1 eq $str2 ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
defined $val1 and defined $val2 and $str1 eq $str2
defined $val1 and defined $val2
MC/DC100%3/3
defined $val1 and defined $val2 and $str1 eq $str2
defined $val1
defined $val2
$str1 eq $str2
Truth table100%4/4
A and B and C
A= defined $val1B= defined $val2C= $str1 eq $str2
| |||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||
| 91 | 3 | return; | |||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||
| 94 | 5 | 1; | |||||||||||||||||||||||||||||||||||||||||