ChatBots/Weak.pm

filter: Statementstmt 100% 31 / 31 Branchbran 83.3% 5 / 6 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 9 / 9 Podpod 100% 6 / 6 totaltotal 98.2% 56 / 57 CC 5 SCAR 9.3
CC
5
Cov
98%
set
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.5
« ChatBots/MojoPlugin.pm ↑ Summary ChatBots/Role/Sender.pm »
1 package Bot::ChatBots::Weak;
2 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 { our $VERSION = '0.014'; }
5  
6 6 ▶use Scalar::Util qw< weaken >;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶sub clone {
Subroutine clone: called CC=1 SCAR=0.0
Pod documented
9 1 my $self = shift;
10 1 return ref($self)->new($self);
11 }
12  
13 1 ▶sub get {
Subroutine get: called CC=1 SCAR=0.0
Pod documented
14 1 my ($self, $key) = @_;
15 1 return $self->{$key};
16 }
17  
18 1 ▶sub get_multiple {
Subroutine get_multiple: called CC=1 SCAR=0.0
Pod documented
19 1 my $self = shift;
20 1 return @{$self}{@_};
21 }
22  
23 8 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
24 8 my $package = shift;
25 8 my $self = bless {}, $package;
26 8 return $self->set(@_);
27 }
28  
29 26 ▶sub set {
Subroutine set: called CC=5 SCAR=16.1
Pod documented
30 26 my $self = shift;
31 26 ▶ my @args = (@_ && ref($_[0])) ? %{$_[0]} : @_;
Branch: 1 branch
BranchTrueFalseTotal
@_ && ref $_[0] ? : 1 25 26
Condition100%3/3
@_ and ref $_[0]
!ll&&!rl&&r
6191
MC/DC100%2/2
@_ and ref $_[0]
@_ ref $_[0]
Truth table100%3/3
A and B
A= @_B= ref $_[0]
ABresult
0X0
100
111
32 26 ▶ while (@args) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args) 23 26 49
33 23 my ($key, $value) = splice @args, 0, 2;
34 23 $self->{$key} = $value;
35 23 ▶ weaken($self->{$key}) if ref $value;
Branch: 1 branch
BranchTrueFalseTotal
if ref $value 23 0 23
36 }
37 26 return $self;
38 } ## end sub set
39  
40 1 ▶sub TO_JSON { return undef }
Subroutine TO_JSON: called CC=1 SCAR=0.0
Pod documented
41  
42 6 1;
« ChatBots/MojoPlugin.pm ↑ Summary ChatBots/Role/Sender.pm »