FLAT/Transition/Simple.pm

filter: Statementstmt 92.3% 24 / 26 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 6 totaltotal 75.5% 34 / 45 CC 4 SCAR 7.8
CC
4
Cov
87%
delete
6.0
does
2.0
as_string
2.0
CRAP 2.2
« FLAT/Regex/Util.pm ↑ Summary FLAT/Regex/Op.pm »
1 package FLAT::Transition::Simple;
2  
3 6 ▶use parent 'FLAT::Transition';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 9056 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
9 9056 my ($pkg, @things) = @_;
10 9056 bless {map {$_ => 1} @things}, $pkg;
11 }
12  
13 492742 ▶sub does {
Subroutine does: called CC=2 SCAR=7.1
Pod undocumented
14 492742 my ($self, @things) = @_;
15 492742 ▶ return 1 if @things == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @things == 0 0 492742 492742
16 492742 return !!grep $self->{$_}, @things;
17 }
18  
19 12835 ▶sub add {
Subroutine add: called CC=1 SCAR=0.0
Pod undocumented
20 12835 my ($self, @things) = @_;
21 12835 @$self{@things} = (1) x @things;
22 }
23  
24 0 ▶sub delete {
Subroutine delete: not called CC=2 SCAR=17.9
Pod undocumented
25 0 my ($self, @things) = @_;
26 0 delete $self->{$_} for @things;
27 }
28  
29 20807 ▶sub alphabet {
Subroutine alphabet: called CC=1 SCAR=0.0
Pod undocumented
30 20807 my $self = shift;
31 20807 sort {$a cmp $b} keys %$self;
32 }
33  
34 1246 ▶sub as_string {
Subroutine as_string: called CC=2 SCAR=7.1
Pod undocumented
35 1246 my $self = shift;
36 1246 ▶ join ",", map {length $_ ? $_ : "epsilon"} $self->alphabet;
Branch: 1 branch
BranchTrueFalseTotal
length $_ ? : 1308 0 1308
37 }
38  
39 6 1;
« FLAT/Regex/Util.pm ↑ Summary FLAT/Regex/Op.pm »