ModuleSymbol.pm

filter: Statementstmt 19.4% 7 / 36 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 12.5% 1 / 8 Podpod 0.0% 0 / 7 totaltotal 12.1% 8 / 66 CC 7 SCAR 16.8
CC
7
Cov
14%
new
6.0
scannedpackages
6.0
text_symbols
6.0
CRAP 5.4
« Module.pm ↑ Summary SymbolRef.pm »
1 package Lib::ModuleSymbol;
2 # $Id: ModuleSymbol.pm,v 1.7 2004/03/28 00:27:53 kiesling Exp $
3  
4 # Copyright © 2001-2004 Robert Kiesling, rkies@cpan.org.
5 #
6 # Licensed under the same terms as Perl. Refer to the file,
7 # "Artistic," for information.
8  
9 1 $VERSION=0.54;
10 1 ▶use vars qw( @ISA @EXPORT @EXPORT_OK $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 push @ISA, qw( Exporter DB );
12  
13 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
14 0 my $proto = shift;
15 0 ▶ my $class = ref( $proto ) || $proto;
Condition0%0/3
ref $proto || $proto
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
16 0 my $self = {
17 pathname => undef,
18 packagename => undef,
19 version => undef,
20 };
21 0 bless( $self, $class);
22 0 return $self;
23  
24 }
25  
26 1 my @scannedpackages;
27  
28 0 ▶sub scannedpackages {
Subroutine scannedpackages: not called CC=2 SCAR=17.9
Pod undocumented
29 0 ▶ if( @_ ) { @scannedpackages = @_ }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
30 0 return @scannedpackages;
31 }
32  
33 0 ▶sub array_as_str {
Subroutine array_as_str: not called CC=1 SCAR=6.9
Pod undocumented
34 0 my @a = $_[0];
35 0 return (join ("\n", @a));
36 }
37  
38 0 ▶sub text_symbols {
Subroutine text_symbols: not called CC=2 SCAR=17.9
Pod undocumented
39 0 my $p = shift;
40 0 my (@text) = @_;
41 0 my $text = array_as_str (@text);
42 0 my (@ver) = grep /VERSION.*\=/, @text;
43 0 my ($package) = ($text =~ /^package\s+(.*?)\;/ms);
44 0 ▶ $p -> {packagename} = $package if $package;
Branch: 1 branch
BranchTrueFalseTotal
if $package 0 0 0
45 0 $p -> {version} = $ver[0];
46 }
47  
48 0 ▶sub pathname {
Subroutine pathname: not called CC=2 SCAR=17.9
Pod undocumented
49 0 my $self = shift;
50 0 ▶ if (@_) { $self -> {pathname} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
51 return $self -> {pathname}
52 0 }
53  
54 0 ▶sub packagename {
Subroutine packagename: not called CC=2 SCAR=17.9
Pod undocumented
55 0 my $self = shift;
56 0 ▶ if (@_) { $self -> {packagename} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
57 return $self -> {packagename}
58 0 }
59  
60 0 ▶sub version {
Subroutine version: not called CC=2 SCAR=17.9
Pod undocumented
61 0 my $self = shift;
62 0 ▶ if (@_) { $self -> {version} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
63 return $self -> {version}
64 0 }
65  
66  
67 1 1;
68  
« Module.pm ↑ Summary SymbolRef.pm »