_ConstructorArgs.pm

filter: Statementstmt 92.3% 12 / 13 Branchbran 66.6% 4 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 71.4% 20 / 28 CC 5 SCAR 15.1
CC
5
Cov
77%
normalize
5.9
BEGIN
1.0
BEGIN
1.0
CRAP 4.5
« Identifier.pm ↑ Summary RelayInfo.pm »
1 package Net::Nostr::_ConstructorArgs;
2  
3 99 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 99 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 188 ▶sub normalize {
Subroutine normalize: called CC=5 SCAR=17.8
Pod undocumented
8 188 my (@args) = @_;
9 188 ▶ return () if !@args;
Branch: 1 branch
BranchTrueFalseTotal
unless @args 41 147 188
10 0 ▶ return %{$args[0]} if @args == 1 && ref($args[0]) eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
if @args == 1 and ref $args[0] eq "HASH" 0 147 147
Condition33%1/3
@args == 1 and ref $args[0] eq "HASH"
!ll&&!rl&&r
14700
MC/DC0%0/2
@args == 1 and ref $args[0] eq "HASH"
@args == 1 ref $args[0] eq "HASH"
Truth table33%1/3
A and B
A= @args == 1B= ref $args[0] eq "HASH"
ABresult
0X0
100
111
11 147 ▶ croak "constructor arguments must be a hash or hash reference" if @args % 2;
Branch: 1 branch
BranchTrueFalseTotal
if @args % 2 0 147 147
12 147 return @args;
13 }
14  
15 99 1;
« Identifier.pm ↑ Summary RelayInfo.pm »