Perl/Lint/Policy/Miscellanea/ProhibitTies.pm

filter: Statementstmt 95.4% 21 / 22 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 84.2% 32 / 38 CC 4 SCAR 8.8
CC
4
Cov
90%
evaluate
4.2
BEGIN
1.0
BEGIN
1.0
CRAP 2.4
« Perl/Lint/Policy/References/ProhibitDoubleSigils.pm ↑ Summary Perl/Lint/Policy/Miscellanea/ProhibitUnrestrictedNoLint.pm »
1 package Perl::Lint::Policy::Miscellanea::ProhibitTies;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Perl::Lint::Constants::Type;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use parent "Perl::Lint::Policy";
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 DESC => 'Tied variable used',
9 EXPL => [451],
10 3 };
11  
12 2 ▶sub evaluate {
Subroutine evaluate: called CC=4 SCAR=14.3
Pod undocumented
13 2 my ($class, $file, $tokens, $args) = @_;
14  
15 2 my @violations;
16 2 ▶ for (my $i = 0; my $token = $tokens->[$i]; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $token = $tokens->[$i]) 51 2 53
17 51 ▶ if ($token->{type} == BUILTIN_FUNC && $token->{data} eq 'tie') {
Branch: 1 branch
BranchTrueFalseTotal
if ($token->{"type"} == 70 and $token->{"data"} eq "tie") 0 51 51
Condition66%2/3
$token->{"type"} == 70 and $token->{"data"} eq "tie"
!ll&&!rl&&r
5010
MC/DC0%0/2
$token->{"type"} == 70 and $token->{"data"} eq "tie"
$token->{"type"} == 70 $token->{"data"} eq "tie"
Truth table66%2/3
A and B
A= $token->{"type"} == 70B= $token->{"data"} eq "tie"
ABresult
0X0
100
111
18 push @violations, {
19 filename => $file,
20 line => $token->{line},
21 0 description => DESC,
22 explanation => EXPL,
23 policy => __PACKAGE__,
24 };
25 }
26 }
27  
28 2 return \@violations;
29 }
30  
31 3 1;
32  
« Perl/Lint/Policy/References/ProhibitDoubleSigils.pm ↑ Summary Perl/Lint/Policy/Miscellanea/ProhibitUnrestrictedNoLint.pm »