lib/XML/XMetaL/Utilities/Abstract.pm

filter: Statementstmt 95.4% 21 / 22 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 89.6% 26 / 29 CC 2 SCAR 3.5
CC
2
Cov
92%
abstract
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« lib/XML/XMetaL/Mock/DOMText.pm ↑ Summary lib/XML/XMetaL/Mock/DOMElement.pm »
1 #! perl
2
3 package XML::XMetaL::Utilities::Abstract;
4
5 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8
9 3 require Exporter;
10
11 3 our @ISA = qw(Exporter);
12 3 our @EXPORT = qw(Abstract);
13
14 3 our @parameters = qw(package symbol referent attr data phase);
15
16 1 ▶sub abstract {
Subroutine abstract: called CC=2 SCAR=7.1
Pod undocumented
17 1 my ($self) = @_;
18 1 my $strCallerClass = ref($self);
19 1 my $strAbstractClass = (caller 0)[0];
20 1 my $strMethod = (caller 1)[3];
21 1 $strMethod =~ s/.*::(.*)/$1/;
22
23 1 ▶ if ($strCallerClass eq $strAbstractClass) {
Branch: 1 branch
BranchTrueFalseTotal
if ($strCallerClass eq $strAbstractClass) { } 1 0 1
24 1 croak "$strAbstractClass is an abstract base class.".
25 " Attempt to call non-existent method $strMethod";
26 } else {
27 0 die "Class $strCallerClass inherited the abstract base class $strAbstractClass ".
28 "but did not redefine the $strMethod method. ".
29 "Attempt to call non-existent method $strAbstractClass::$strMethod";
30 }
31 }
32
33 3 1;
« lib/XML/XMetaL/Mock/DOMText.pm ↑ Summary lib/XML/XMetaL/Mock/DOMElement.pm »