| 1 | package Perl::Critic::Policy::References::ProhibitRefChecks; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 11 | ▶ | use 5.010001; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 11 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 11 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 11 | ▶ | use Readonly; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 11 | ▶ | use Perl::Critic::Utils qw/:severities :classification precedence_of/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 11 | ▶ | use base 'Perl::Critic::Policy'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 11 | our $VERSION = '0.1.4'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 11 | Readonly::Scalar my $DESC => q{Do not perform manual ref checks}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 11 | Readonly::Scalar my $EXPL => undef; # [ ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 11 | Readonly::Scalar my $UPREC => precedence_of('-e'); # named unary function precedence | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | ####----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 11 | ▶ | sub supported_parameters { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
supported_parameters: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 11 | name => 'eq', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | description => 'Reference types that may be checked via string equality.', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | default_string => '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | behavior => 'string list', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | name => 'ne', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | description => 'Reference types that may be checked via string inequality.', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | default_string => '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | behavior => 'string list', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | name => 'regexp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | description => 'Permit regular expression comparisons.', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | default_string => '0', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | behavior => 'boolean', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | name => 'bareref', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | description => 'Permit a bare if(ref) style check.', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | default_string => '0', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | behavior => 'boolean', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 7818 | ▶ | sub applies_to { return 'PPI::Token::Word' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
applies_to: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 5768 | ▶ | sub default_severity { return $SEVERITY_MEDIUM } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
default_severity: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 1 | ▶ | sub default_themes { return qw/cosmetic maintenance performance/ } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
default_themes: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 5768 | ▶ | sub invalid { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
invalid: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 5768 | my ($self,$elem,$note)=@_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 5768 | ▶ | $note//=''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$note //= ""
MC/DC100%1/1
$note //= ""
$note
Truth table100%2/2
A
A= $note
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 5768 | ▶ | if($note) { $note=" ($note)" } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 5768 | return $self->violation(sprintf("%s%s",$DESC,$note),$EXPL,$elem); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 9225 | ▶ | sub eqne { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
eqne: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 9225 | my ($node)=@_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 9225 | ▶ | if(!$node) { return } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 2309 | ▶ | if(!$node->isa('PPI::Token::Operator')) { return } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 2308 | my $op=$node->content(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 2308 | ▶ | if(($op eq 'eq')||($op eq 'ne')) { return 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$op eq "eq" or $op eq "ne"
MC/DC100%2/2
$op eq "eq" or $op eq "ne"
$op eq "eq"
$op eq "ne"
Truth table100%3/3
A or B
A= $op eq "eq"B= $op eq "ne"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 2051 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 9000 | ▶ | sub decompose { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
decompose: called CC=10 SCAR=23.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 9000 | my ($elem)=@_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 9000 | my %operator=map {$_=>undef} (qw/eq ne !~ =~ cmp/); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 9000 | my ($node,$operator,$rhs)=($elem,undef,undef); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 9000 | ▶ | while($node) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 31620 | ▶ | if($node->isa('PPI::Token::Operator') && exists($operator{$node->content()})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
$node->isa("PPI::Token::Operator") and exists $operator{$node->content}
MC/DC100%2/2
$node->isa("PPI::Token::Operator") and exists $operator{$node->content}
$node->isa("PPI::Token::Operator")
exists $operator{$node->content}
Truth table100%3/3
A and B
A= $node->isa("PPI::Token::Operator")B= exists $operator{$node->content}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 7964 | $operator=$node->content(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 7964 | $rhs=$node->snext_sibling(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 7964 | $node=0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 516 | ▶ | elsif($node->isa('PPI::Token::Operator') && (precedence_of($node)>$UPREC)) { $node=0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$node->isa("PPI::Token::Operator") and precedence_of($node) > $UPREC
MC/DC100%2/2
$node->isa("PPI::Token::Operator") and precedence_of($node) > $UPREC
$node->isa("PPI::Token::Operator")
precedence_of($node) > $UPREC
Truth table100%3/3
A and B
A= $node->isa("PPI::Token::Operator")B= precedence_of($node) > $UPREC
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 23140 | else { $node=$node->snext_sibling() } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 9000 | ▶ | if(!$rhs) { return ($operator) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 7964 | ▶ | if($rhs->isa('PPI::Token::Quote')) { return ($operator,lc($rhs->string())) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 1037 | ▶ | if($rhs->isa('PPI::Token::Word') && ($rhs->content() eq 'ref')) { return ($operator,'ref') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$rhs->isa("PPI::Token::Word") and $rhs->content eq "ref"
MC/DC50%1/2
$rhs->isa("PPI::Token::Word") and $rhs->content eq "ref"
$rhs->isa("PPI::Token::Word")
$rhs->content eq "ref"
Truth table66%2/3
A and B
A= $rhs->isa("PPI::Token::Word")B= $rhs->content eq "ref"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 777 | return ($operator,$rhs->content()); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 13576 | ▶ | sub violates { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
violates: called CC=27 SCAR=33.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 13576 | my ($self,$elem,undef)=@_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 13576 | ▶ | if(!$elem->isa('PPI::Token::Word')) { return } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 13575 | ▶ | if(!is_perl_builtin($elem)) { return } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 9230 | ▶ | if(!is_function_call($elem)) { return } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 9228 | ▶ | if($elem->content() ne 'ref') { return } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | # Already handled. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | # No support for ('quoted' eq ref($x)) at this time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 9225 | ▶ | if(eqne($elem->sprevious_sibling())){ return } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 8968 | ▶ | $$self{_eq} //={}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->{"_eq"} //= {}
MC/DC0%0/1
$self->{"_eq"} //= {}
$self->{"_eq"}
Truth table50%1/2
A
A= $self->{"_eq"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 8968 | ▶ | $$self{_ne} //={}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->{"_ne"} //= {}
MC/DC0%0/1
$self->{"_ne"} //= {}
$self->{"_ne"}
Truth table50%1/2
A
A= $self->{"_ne"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 8968 | ▶ | $$self{_regexp} //=0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->{"_regexp"} //= 0
MC/DC0%0/1
$self->{"_regexp"} //= 0
$self->{"_regexp"}
Truth table50%1/2
A
A= $self->{"_regexp"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 8968 | ▶ | $$self{_bareref}//=0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->{"_bareref"} //= 0
MC/DC0%0/1
$self->{"_bareref"} //= 0
$self->{"_bareref"}
Truth table50%1/2
A
A= $self->{"_bareref"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | # Without options, 'ref' should never be called. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 8968 | ▶ | if(!%{$$self{_eq}} && !%{$$self{_ne}} && !$$self{_regexp} && !$$self{_bareref}) { return $self->invalid($elem) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%9/9
%{$self->{"_eq"};} or %{$self->{"_ne"};} or $self->{"_regexp"} or $self->{"_bareref"}
%{$self->{"_eq"};} or %{$self->{"_ne"};} or $self->{"_regexp"}
%{$self->{"_eq"};} or %{$self->{"_ne"};}
MC/DC100%4/4
%{$self->{"_eq"};} or %{$self->{"_ne"};} or $self->{"_regexp"} or $self->{"_bareref"}
%{$self->{"_eq"};}
%{$self->{"_ne"};}
$self->{"_regexp"}
$self->{"_bareref"}
Truth table100%5/5
A or B or C or D
A= %{$self->{"_eq"};}B= %{$self->{"_ne"};}C= $self->{"_regexp"}D= $self->{"_bareref"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 8967 | my ($operator,$rhs)=decompose($elem); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 8967 | ▶ | if(!$operator) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 1028 | ▶ | if(!$$self{_bareref}) { return $self->invalid($elem,'bare ref check') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 768 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | elsif($operator eq 'eq') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 3586 | ▶ | $$self{_eqfold}//={map {lc($_)=>undef} keys(%{$$self{_eq}//{}})}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition75%3/4
$self->{"_eqfold"} //= {map({lc $_, undef;} keys %{$self->{"_eq"} // {};})}
$self->{"_eq"} // {}
MC/DC100%1/1
$self->{"_eqfold"} //= {map({lc $_, undef;} keys %{$self->{"_eq"} // {};})}
$self->{"_eqfold"}
MC/DC0%0/1
$self->{"_eq"} // {}
$self->{"_eq"}
Truth table100%2/2
A
A= $self->{"_eqfold"}
Truth table50%1/2
A
A= $self->{"_eq"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 3586 | ▶ | if(!exists($$self{_eqfold}{$rhs})) { return $self->invalid($elem,$rhs) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 1024 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | elsif($operator eq 'ne') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 3584 | ▶ | $$self{_nefold}//={map {lc($_)=>undef} keys(%{$$self{_ne}//{}})}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition75%3/4
$self->{"_nefold"} //= {map({lc $_, undef;} keys %{$self->{"_ne"} // {};})}
$self->{"_ne"} // {}
MC/DC100%1/1
$self->{"_nefold"} //= {map({lc $_, undef;} keys %{$self->{"_ne"} // {};})}
$self->{"_nefold"}
MC/DC0%0/1
$self->{"_ne"} // {}
$self->{"_ne"}
Truth table100%2/2
A
A= $self->{"_nefold"}
Truth table50%1/2
A
A= $self->{"_ne"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 3584 | ▶ | if(!exists($$self{_nefold}{$rhs})) { return $self->invalid($elem,$rhs) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 1024 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | ▶ | elsif(($operator eq '=~')||($operator eq '!~')) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$operator eq "=~" or $operator eq "!~"
MC/DC100%2/2
$operator eq "=~" or $operator eq "!~"
$operator eq "=~"
$operator eq "!~"
Truth table100%3/3
A or B
A= $operator eq "=~"B= $operator eq "!~"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 768 | ▶ | if(!$$self{_regexp}) { return $self->invalid($elem,$rhs) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 384 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 1 | return $self->invalid($elem,$rhs); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 11 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||