Promise/Headers/StrictTransportSecurity.pm

filter: Statementstmt 97.6% 42 / 43 Branchbran 50.0% 5 / 10 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 93.3% 14 / 15 Podpod 100% 9 / 9 totaltotal 87.8% 72 / 82 CC 8 SCAR 12.3
CC
8
Cov
88%
init
7.1
property
6.0
BEGIN
1.0
CRAP 3.4
« Promise/Headers/ExpectCT.pm ↑ Summary Promise/Headers/KeepAlive.pm »
1 ##----------------------------------------------------------------------------
2 ## Asynchronous HTTP Request and Promise - ~/lib/HTTP/Promise/Headers/StrictTransportSecurity.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::StrictTransportSecurity;
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 5 ▶{
Subroutine init: called CC=7 SCAR=19.7
Pod documented
29 5 my $self = shift( @_ );
30 5 $self->{properties} = {};
31 5 $self->{params} = [];
32 5 ▶ @_ = () if( @_ == 1 && $self->_is_a( $_[0] => 'Module::Generic::Null' ) );
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 and $self->_is_a($_[0], "Module::Generic::Null") 0 5 5
Condition66%2/3
@_ == 1 and $self->_is_a($_[0], "Module::Generic::Null")
!ll&&!rl&&r
230
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
33 5 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 3 2 5
34 {
35 3 my $this = shift( @_ );
36 3 ▶ my $ref = $self->new_array( $self->_is_array( $this ) ? $this : [split( /[[:blank:]\h]*(?<!\\)\;[[:blank:]\h]*/, "$this" )] );
Branch: 1 branch
BranchTrueFalseTotal
$self->_is_array($this) ? : 0 3 3
37 3 my $params = $self->params;
38 3 my $props = $self->properties;
39 3 foreach my $pair ( @$ref )
40 {
41 9 my( $prop, $val ) = split( /=/, $pair, 2 );
42 9 $props->{ $prop } = $val;
43 9 $params->push( $prop );
44 }
45 }
46 5 $self->{_init_strict_use_sub} = 1;
47 5 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 5 0 5
48 5 $self->_field_name( 'Strict-Transport-Security' );
49 5 return( $self );
50 }
51  
52 7 ▶sub as_string { return( shift->_set_get_properties_as_string( sep => ';' ) ); }
Subroutine as_string: called CC=1 SCAR=0.0
Pod documented
53  
54 7 ▶sub include_subdomains { return( shift->_set_get_property_boolean( 'includeSubDomains', @_ ) ); }
Subroutine include_subdomains: called CC=1 SCAR=0.0
Pod documented
55  
56 7 ▶sub max_age { return( shift->_set_get_property_number( 'max-age', @_ ) ); }
Subroutine max_age: called CC=1 SCAR=0.0
Pod documented
57  
58 32 ▶sub params { return( shift->_set_get_array_as_object( 'params', @_ ) ); }
Subroutine params: called CC=1 SCAR=0.0
Pod documented
59  
60 0 ▶sub property { return( shift->_set_get_property_value( @_, ( @_ > 1 ? { needs_quotes => 1 } : () ) ) ); }
Subroutine property: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
@_ > 1 ? : 0 0 0
61  
62 1 ▶sub property_boolean { return( shift->_set_get_property_boolean( @_ ) ); }
Subroutine property_boolean: called CC=1 SCAR=0.0
Pod documented
63  
64 32 ▶sub properties { return( shift->_set_get_hash_as_mix_object( 'properties', @_ ) ); }
Subroutine properties: called CC=1 SCAR=0.0
Pod documented
65  
66 7 ▶sub preload { return( shift->_set_get_property_boolean( 'preload', @_ ) ); }
Subroutine preload: called CC=1 SCAR=0.0
Pod documented
67  
68 3 1;
69 # NOTE: POD
70 __END__
« Promise/Headers/ExpectCT.pm ↑ Summary Promise/Headers/KeepAlive.pm »