Nostr/_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
« Nostr/Identifier.pm ↑ Summary Nostr/RelayInfo.pm »
1 package Net::Nostr::_ConstructorArgs;
2  
3 119 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 119 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 sub normalize {
8 172 ▶ my (@args) = @_;
Subroutine normalize: called CC=5 SCAR=17.8
Pod undocumented
9 172 ▶ return () if !@args;
Branch: 1 branch
BranchTrueFalseTotal
unless @args 39 133 172
10 133 ▶ 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 133 133
Condition33%1/3
@args == 1 and ref $args[0] eq "HASH"
!ll&&!rl&&r
13300
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 133 ▶ croak "constructor arguments must be a hash or hash reference" if @args % 2;
Branch: 1 branch
BranchTrueFalseTotal
if @args % 2 0 133 133
12 133 return @args;
13 }
14  
15 119 1;
« Nostr/Identifier.pm ↑ Summary Nostr/RelayInfo.pm »