web/cgi-bin/yatt.lib/YATT/Util/Taint.pm

filter: Statementstmt 80.0% 16 / 20 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 60.9% 25 / 41 CC 3 SCAR 8.3
CC
3
Cov
67%
untaint_any
4.1
__ANON__
2.0
BEGIN
1.0
CRAP 2.3
« web/cgi-bin/yatt.lib/YATT/Util/Symbol.pm ↑ Summary misc/cpan/MyBuilder.pm »
1 # -*- mode: perl; coding: utf-8 -*-
2 package YATT::Util::Taint;
3 13 ▶use base qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 13 ▶use warnings qw(FATAL all NONFATAL misc);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 13 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
8 13 our @EXPORT_OK = qw(&untaint_any &is_tainted);
9 13 our @EXPORT = @EXPORT_OK;
10 }
11  
12 13 ▶if (eval {require Scalar::Util} and not $@) {
Branch: 1 branch
BranchTrueFalseTotal
if (eval { do { require Scalar::Util } } and not $@) { } 13 0 13
Condition33%1/3
eval { do { require Scalar::Util } } and not $@
!ll&&!rl&&r
0013
MC/DC0%0/2
eval { do { require Scalar::Util } } and not $@
eval { do { require Scalar::Util } } not $@
Truth table33%1/3
A and not(B)
A= eval { do { require Scalar::Util } }B= not $@
ABresult
0X0
100
111
13 13 *is_tainted = \&Scalar::Util::tainted;
14 } else {
15 0 ▶ *is_tainted = sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
16 0 return not eval { eval("#" . substr(join("", @_), 0, 0)); 1 };
17 0 };
18 }
19  
20 558 ▶sub untaint_any ($) {
Subroutine untaint_any: called CC=3 SCAR=14.2
Pod undocumented
21 558 ▶ $1 if defined $_[0] && $_[0] =~ m{(.*)}s;
Branch: 1 branch
BranchTrueFalseTotal
if defined $_[0] and $_[0] =~ /(.*)/s 558 0 558
Condition33%1/3
defined $_[0] and $_[0] =~ /(.*)/s
!ll&&!rl&&r
00558
MC/DC0%0/2
defined $_[0] and $_[0] =~ /(.*)/s
defined $_[0] $_[0] =~ /(.*)/s
Truth table33%1/3
A and B
A= defined $_[0]B= $_[0] =~ /(.*)/s
ABresult
0X0
100
111
22 }
23  
24 13 1;
« web/cgi-bin/yatt.lib/YATT/Util/Symbol.pm ↑ Summary misc/cpan/MyBuilder.pm »