Dumbbench/Result.pm

filter: Statementstmt 97.0% 33 / 34 Branchbran 83.3% 5 / 6 Conditioncond 44.4% 4 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 80.6% 50 / 62 CC 7 SCAR 15.2
CC
7
Cov
86%
new
7.6
BEGIN
1.0
BEGIN
1.0
CRAP 4.6
« Dumbbench/CPUFrequencyPinner.pm ↑ Summary Dumbbench/Instance/PerlSub.pm »
1 package Dumbbench::Result;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use Number::WithError;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use parent 'Number::WithError';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶use Class::XSAccessor {
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 getters => {
11 nsamples => '_dbr_nsamples',
12 },
13 3 };
14  
15  
16 22 ▶sub new {
Subroutine new: called CC=7 SCAR=20.3
Pod documented
17 22 my $proto = shift;
18 22 ▶ my $class = ref($proto)||$proto;
Condition66%2/3
ref $proto || $proto
l!l&&r!l&&!r
1480
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table66%2/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
19  
20 22 my $self;
21 22 ▶ if (not grep {$_ eq 'timing'} @_) {
Branch: 1 branch
BranchTrueFalseTotal
unless (grep {$_ eq "timing";} @_) 12 10 22
22 12 ▶ push @_, 0 if @_ == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 8 4 12
23 12 $self = $proto->SUPER::new(@_);
24 12 $self->{_dbr_nsamples} = $proto->nsamples;
25 12 return $self;
26 }
27  
28 10 my %opt = @_;
29 10 ▶ if (not defined $opt{timing} or not defined $opt{uncertainty}
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $opt{"timing"} and defined $opt{"uncertainty"} and defined $opt{"nsamples"}) 0 10 10
Condition33%2/6
defined $opt{"timing"} and defined $opt{"uncertainty"} and defined $opt{"nsamples"}
!ll&&!rl&&r
0010
defined $opt{"timing"} and defined $opt{"uncertainty"}
!ll&&!rl&&r
0010
MC/DC0%0/3
defined $opt{"timing"} and defined $opt{"uncertainty"} and defined $opt{"nsamples"}
defined $opt{"timing"} defined $opt{"uncertainty"} defined $opt{"nsamples"}
Truth table25%1/4
A and B and C
A= defined $opt{"timing"}B= defined $opt{"uncertainty"}C= defined $opt{"nsamples"}
ABCresult
0XX0
10X0
1100
1111
30 or not defined $opt{nsamples}) {
31 0 Carp::croak("Need 'timing', 'uncertainty', and 'nsamples' parameters");
32 }
33 10 $self = $class->SUPER::new($opt{timing}, $opt{uncertainty});
34 10 $self->{_dbr_nsamples} = $opt{nsamples};
35  
36 10 return $self;
37 }
38  
39  
40  
41  
42  
43 3 1;
« Dumbbench/CPUFrequencyPinner.pm ↑ Summary Dumbbench/Instance/PerlSub.pm »