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 sub new {
9 8716 ▶ my ($pkg, @things) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
10 8716 bless {map {$_ => 1} @things}, $pkg;
11 }
12  
13 sub does {
14 476727 ▶ my ($self, @things) = @_;
Subroutine does: called CC=2 SCAR=7.1
Pod undocumented
15 476727 ▶ return 1 if @things == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @things == 0 0 476727 476727
16 476727 return !!grep $self->{$_}, @things;
17 }
18  
19 sub add {
20 12569 ▶ my ($self, @things) = @_;
Subroutine add: called CC=1 SCAR=0.0
Pod undocumented
21 12569 @$self{@things} = (1) x @things;
22 }
23  
24 sub delete {
25 0 ▶ my ($self, @things) = @_;
Subroutine delete: not called CC=2 SCAR=17.9
Pod undocumented
26 0 delete $self->{$_} for @things;
27 }
28  
29 sub alphabet {
30 20477 ▶ my $self = shift;
Subroutine alphabet: called CC=1 SCAR=0.0
Pod undocumented
31 20477 sort {$a cmp $b} keys %$self;
32 }
33  
34 sub as_string {
35 1126 ▶ my $self = shift;
Subroutine as_string: called CC=2 SCAR=7.1
Pod undocumented
36 1126 ▶ join ",", map {length $_ ? $_ : "epsilon"} $self->alphabet;
Branch: 1 branch
BranchTrueFalseTotal
length $_ ? : 1220 0 1220
37 }
38  
39 6 1;
« FLAT/Regex/Util.pm ↑ Summary FLAT/Regex/Op.pm »