Data/Sah/Compiler/human/TH/Comparable.pm

filter: Statementstmt 100% 29 / 29 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 95.1% 39 / 41 CC 3 SCAR 5.1
CC
3
Cov
97%
superclause_comparable
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« Data/Sah/Compiler/Prog/TH.pm ↑ Summary Data/Sah/Compiler/human/TH.pm »
1 package Data::Sah::Compiler::human::TH::Comparable;
2  
3 36 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 36 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 36 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 #use Log::Any '$log';
7  
8 36 ▶use Mo qw(build default);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 36 ▶use Role::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 36 ▶use Role::Tiny::With;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 36 with 'Data::Sah::Type::Comparable';
13  
14 36 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
15 36 our $DATE = '2024-02-16'; # DATE
16 36 our $DIST = 'Data-Sah'; # DIST
17 36 our $VERSION = '0.917'; # VERSION
18  
19 1753 ▶sub superclause_comparable {
Subroutine superclause_comparable: called CC=3 SCAR=11.0
Pod undocumented
20 1753 my ($self, $which, $cd) = @_;
21 1753 my $c = $self->compiler;
22  
23 1753 my $fmt;
24 1753 ▶ if ($which eq 'is') {
Branch: 2 branches
BranchTrueFalseTotal
if ($which eq 'is') { } 909 844 1753
elsif ($which eq 'in') { } 844 0 844
25 909 $c->add_ccl($cd, {expr=>1, multi=>1,
26 fmt => '%(modal_verb)s have the value %s'});
27 } elsif ($which eq 'in') {
28 844 $c->add_ccl($cd, {expr=>1, multi=>1,
29 fmt => '%(modal_verb)s be one of %s'});
30 }
31 }
32 36 1;
33 # ABSTRACT: human's type handler for role "Comparable"
34  
35 __END__
« Data/Sah/Compiler/Prog/TH.pm ↑ Summary Data/Sah/Compiler/human/TH.pm »