blib/lib/XML/IODEF/Simple/Plugin/RI_RESTRICTION.pm

filter: Statementstmt 52.1% 12 / 23 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 44.1% 15 / 34 CC 3 SCAR 17.7
CC
3
Cov
44%
prepare
12.0
convert
2.0
BEGIN
1.0
CRAP 5.9
↑ Summary
1 package XML::IODEF::Simple::Plugin::RI_RESTRICTION;
2  
3 1 ▶use 5.008008;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 our $VERSION = '0.00_01';
8 1 $VERSION = eval $VERSION; # see L<perlmodstyle>
9  
10 # Preloaded methods go here.
11  
12 1 my $map = {
13 limited => 'need-to-know',
14 restricted => 'private',
15 privileged => 'need-to-know',
16 default => 'private',
17 };
18  
19 0 ▶sub prepare {
Subroutine prepare: not called CC=3 SCAR=24.8
Pod undocumented
20 0 my $class = shift;
21 0 my $info = shift;
22 0 ▶ return unless($info->{'restriction'});
Branch: 1 branch
BranchTrueFalseTotal
unless $info->{"restriction"} 0 0 0
23 0 ▶ return unless(exists($map->{lc($info->{'restriction'})}));
Branch: 1 branch
BranchTrueFalseTotal
unless exists $$map{lc $info->{"restriction"}} 0 0 0
24 0 return(1);
25 }
26  
27 0 ▶sub convert {
Subroutine convert: not called CC=1 SCAR=6.9
Pod undocumented
28 0 my $class = shift;
29 0 my $info = shift;
30 0 my $iodef = shift;
31 0 my $r = lc($info->{'restriction'});
32 0 $info->{'restriction'} = $map->{$r};
33  
34 0 return($iodef);
35 }
36  
37 1 1;
38 __END__
↑ Summary