blib/lib/Config/Tiny/Singleton.pm

filter: Statementstmt 72.2% 13 / 18 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod n/a totaltotal 70.8% 17 / 24 CC 2 SCAR 5.2
CC
2
Cov
70%
_new_instance
2.2
_error
2.0
BEGIN
1.0
CRAP 1.7
↑ Summary
1 package Config::Tiny::Singleton;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 2 our $VERSION = 0.02;
5  
6 2 ▶use base qw|
Subroutine BEGIN: called CC=1 SCAR=0.0
7 Config::Tiny
8 Class::Singleton
9 Class::Data::Inheritable
10 2 |;
11  
12 2 __PACKAGE__->mk_classdata($_) for qw/file errstr/;
13  
14 1 ▶sub _new_instance {
Subroutine _new_instance: called CC=2 SCAR=7.9
15 1 my $class = shift;
16 1 my $file = $class->file;
17 1 ▶ unless($file){
Branch: 1 branch
BranchTrueFalseTotal
unless ($file) 0 1 1
18 0 require Carp;
19 0 Carp::croak "set file before creating instance.";
20 }
21 1 return $class->read($file);
22 }
23  
24 0 ▶sub _error {
Subroutine _error: not called CC=1 SCAR=6.9
25 0 my($self, $msg) = @_;
26 0 $self->errstr($msg);
27 0 undef;
28 }
29  
30 2 1;
31 __END__
↑ Summary