Promise/Headers/Forwarded.pm

filter: Statementstmt 97.6% 41 / 42 Branchbran 62.5% 5 / 8 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 92.8% 13 / 14 Podpod 100% 8 / 8 totaltotal 89.6% 69 / 77 CC 7 SCAR 11.6
CC
7
Cov
91%
init
7.1
host
2.0
BEGIN
1.0
CRAP 3.2
« Promise/Headers/Cookie.pm ↑ Summary Promise/Headers/CacheControl.pm »
1 ##----------------------------------------------------------------------------
2 ## Asynchronous HTTP Request and Promise - ~/lib/HTTP/Promise/Headers/Forwarded.pm
3 ## Version v0.1.0
4 ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2022/05/08
7 ## Modified 2022/05/08
8 ## All rights reserved.
9 ##
10 ##
11 ## This program is free software; you can redistribute it and/or modify it
12 ## under the same terms as Perl itself.
13 ##----------------------------------------------------------------------------
14 package HTTP::Promise::Headers::Forwarded;
15 BEGIN
16 3 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.0
17 3 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 3 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 3 warnings::register_categories( 'HTTP::Promise' );
20 3 ▶ use parent qw( HTTP::Promise::Headers::Generic );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 3 our $VERSION = 'v0.1.0';
22 };
23  
24 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 sub init
28 4 ▶{
Subroutine init: called CC=7 SCAR=19.7
Pod documented
29 4 my $self = shift( @_ );
30 4 $self->{params} = [];
31 4 $self->{properties} = {};
32 # Works like HTTP::Promise::Headers::CacheControl
33 4 ▶ @_ = () if( @_ == 1 && $self->_is_a( $_[0] => 'Module::Generic::Null' ) );
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 and $self->_is_a($_[0], "Module::Generic::Null") 0 4 4
Condition66%2/3
@_ == 1 and $self->_is_a($_[0], "Module::Generic::Null")
!ll&&!rl&&r
130
MC/DC0%0/2
@_ == 1 and $self->_is_a($_[0], "Module::Generic::Null")
@_ == 1 $self->_is_a($_[0], "Module::Generic::Null")
Truth table66%2/3
A and B
A= @_ == 1B= $self->_is_a($_[0], "Module::Generic::Null")
ABresult
0X0
100
111
34 4 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 3 1 4
35 {
36 3 my $this = shift( @_ );
37 3 ▶ my $ref = $self->_is_array( $this ) ? $this : [split( /(?<!\\)\;[[:blank:]\h]*/, "$this" )];
Branch: 1 branch
BranchTrueFalseTotal
$self->_is_array($this) ? : 0 3 3
38 3 my $params = $self->params;
39 3 my $props = $self->properties;
40 3 foreach my $pair ( @$ref )
41 {
42 9 my( $prop, $val ) = split( /=/, $pair, 2 );
43 9 $props->{ $prop } = $val;
44 9 $params->push( $prop );
45 }
46 }
47 4 $self->{_init_strict_use_sub} = 1;
48 4 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 4 0 4
49 4 $self->_field_name( 'Forwarded' );
50 4 return( $self );
51 }
52  
53 5 ▶sub as_string { return( shift->_set_get_properties_as_string( sep => ';' ) ); }
Subroutine as_string: called CC=1 SCAR=0.0
Pod documented
54  
55 5 ▶sub by { return( shift->_set_get_property_value( 'by', @_ ) ); }
Subroutine by: called CC=1 SCAR=0.0
Pod documented
56  
57 5 ▶sub for { return( shift->_set_get_property_value( 'for', @_ ) ); }
Subroutine for: called CC=1 SCAR=0.0
Pod documented
58  
59 0 ▶sub host { return( shift->_set_get_property_value( 'host', @_ ) ); }
Subroutine host: not called CC=1 SCAR=6.9
Pod documented
60  
61 23 ▶sub params { return( shift->_set_get_array_as_object( 'params', @_ ) ); }
Subroutine params: called CC=1 SCAR=0.0
Pod documented
62  
63 23 ▶sub properties { return( shift->_set_get_hash_as_mix_object( 'properties', @_ ) ); }
Subroutine properties: called CC=1 SCAR=0.0
Pod documented
64  
65 5 ▶sub proto { return( shift->_set_get_property_value( 'proto', @_ ) ); }
Subroutine proto: called CC=1 SCAR=0.0
Pod documented
66  
67 3 1;
68 # NOTE: POD
69 __END__
« Promise/Headers/Cookie.pm ↑ Summary Promise/Headers/CacheControl.pm »