CLI/Command.pm

filter: Statementstmt 100% 26 / 26 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 82.9% 34 / 41 CC 3 SCAR 4.1
CC
3
Cov
90%
new
2.0
parse
2.0
BEGIN
1.0
CRAP 1.5
« t.pl ↑ Summary
1 package CLI::Command;
2 1 ▶use CLI::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 @ISA = ("CLI::Base");
4  
5 1 ▶use CLI qw(TIME);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.1
Pod undocumented
11 4 my $proto = shift;
12 4 ▶ my $class = ref($proto) || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
040
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
13  
14 4 my $name = shift;
15 4 my $func = shift;
16  
17 4 my $self = {
18 NAME => $name,
19 TYPE => undef,
20 VALUE => undef,
21 MIN => undef,
22 MAX => undef,
23 FUNC => $func
24 };
25 4 bless ($self, $class);
26 4 return $self;
27 }
28  
29 2 ▶sub parse {
Subroutine parse: called CC=2 SCAR=7.0
Pod undocumented
30 2 my $self = shift;
31 2 my $value = shift;
32  
33 2 ▶ if (defined $self->function()) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->function) 2 0 2
34 2 &{$self->function()}($value);
35 }
36 }
37  
38 1 1;
39  
« t.pl ↑ Summary