ConnectInfo.pm

filter: Statementstmt 71.9% 41 / 57 Branchbran 47.2% 17 / 36 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 64.7% 11 / 17 Podpod 0.0% 0 / 13 totaltotal 56.1% 69 / 123 SCAR 36.4
CC
19
Cov
62%
auth_token
6.0
user
6.0
pass
6.0
CRAP 38.2
« ServerInfo.pm ↑ Summary Message.pm »
1 package Net::NATS2::ConnectInfo;
2  
3 5 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 sub _new {
8 1 ▶ my $class = shift;
Subroutine _new: called CC=1 SCAR=0.0
9 1 return bless {@_}, $class;
10 }
11  
12 sub verbose {
13 4 ▶ my $self = shift;
Subroutine verbose: called CC=2 SCAR=6.9
Pod undocumented
14 4 ▶ $self->{verbose} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 1 3 4
15 4 return $self->{verbose};
16 }
17  
18 sub pedantic {
19 3 ▶ my $self = shift;
Subroutine pedantic: called CC=2 SCAR=6.9
Pod undocumented
20 3 ▶ $self->{pedantic} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 1 2 3
21 3 return $self->{pedantic};
22 }
23  
24 sub ssl_required {
25 0 ▶ goto &tls_required;
Subroutine ssl_required: not called CC=1 SCAR=6.9
Pod undocumented
26 }
27  
28 sub tls_required {
29 5 ▶ my $self = shift;
Subroutine tls_required: called CC=2 SCAR=6.9
Pod undocumented
30 5 ▶ $self->{tls_required} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 2 3 5
31 5 return $self->{tls_required};
32 }
33  
34 sub headers {
35 4 ▶ my $self = shift;
Subroutine headers: called CC=2 SCAR=6.9
Pod undocumented
36 4 ▶ $self->{headers} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 1 3 4
37 4 return $self->{headers};
38 }
39  
40 sub auth_token {
41 0 ▶ my $self = shift;
Subroutine auth_token: not called CC=2 SCAR=17.9
Pod undocumented
42 0 ▶ $self->{auth_token} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
43 0 return $self->{auth_token};
44 }
45  
46 sub user {
47 0 ▶ my $self = shift;
Subroutine user: not called CC=2 SCAR=17.9
Pod undocumented
48 0 ▶ $self->{user} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
49 0 return $self->{user};
50 }
51  
52 sub pass {
53 0 ▶ my $self = shift;
Subroutine pass: not called CC=2 SCAR=17.9
Pod undocumented
54 0 ▶ $self->{pass} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
55 0 return $self->{pass};
56 }
57  
58 sub name {
59 0 ▶ my $self = shift;
Subroutine name: not called CC=2 SCAR=17.9
Pod undocumented
60 0 ▶ $self->{name} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
61 0 return $self->{name};
62 }
63  
64 sub lang {
65 1 ▶ my $self = shift;
Subroutine lang: called CC=2 SCAR=7.1
Pod undocumented
66 1 ▶ $self->{lang} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 1 1
67 1 return $self->{lang};
68 }
69  
70 sub version {
71 0 ▶ my $self = shift;
Subroutine version: not called CC=2 SCAR=17.9
Pod undocumented
72 0 ▶ $self->{version} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
73 0 return $self->{version};
74 }
75  
76 sub new {
77 1 ▶ my $class = shift;
Subroutine new: called CC=5 SCAR=17.0
Pod undocumented
78 1 my $self = $class->_new(@_);
79  
80 1 ▶ $self->verbose(0) unless $self->verbose;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->verbose 1 0 1
81 1 ▶ $self->pedantic(0) unless $self->pedantic;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->pedantic 1 0 1
82 1 ▶ $self->tls_required(0) unless $self->tls_required;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->tls_required 1 0 1
83 1 ▶ $self->headers(0) unless $self->headers;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->headers 1 0 1
84  
85 1 return $self;
86 }
87  
88 sub TO_JSON {
89 1 ▶ my $self = shift;
Subroutine TO_JSON: called CC=5 SCAR=16.8
Pod undocumented
90 1 my $hash = {%{$self}};
91 1 ▶ $hash->{verbose} = $self->verbose ? \1 : \0;
Branch: 1 branch
BranchTrueFalseTotal
$self->verbose ? : 0 1 1
92 1 ▶ $hash->{pedantic} = $self->pedantic ? \1 : \0;
Branch: 1 branch
BranchTrueFalseTotal
$self->pedantic ? : 0 1 1
93 1 ▶ $hash->{tls_required} = $self->tls_required ? \1 : \0;
Branch: 1 branch
BranchTrueFalseTotal
$self->tls_required ? : 1 0 1
94 1 ▶ $hash->{headers} = $self->headers ? \1 : \0;
Branch: 1 branch
BranchTrueFalseTotal
$self->headers ? : 0 1 1
95 1 return $hash;
96 }
97  
98 5 1;
« ServerInfo.pm ↑ Summary Message.pm »