Agent/Content/ToolResult.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 4 / 4 Conditioncond 66.6% 6 / 9 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 89.8% 44 / 49 CC 7 SCAR 14.6
CC
7
Cov
92%
text
7.1
BEGIN
1.0
BEGIN
1.0
CRAP 4.3
« Agent/Message/System.pm ↑ Summary Agent/Client.pm »
1 package Claude::Agent::Content::ToolResult;
2  
3 12 ▶use 5.020;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 12 ▶use Object::Proto ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8 12 ▶use Claude::Agent::Types;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 12 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
11 12 Object::Proto::define('Claude::Agent::Content::ToolResult',
12 'type:Str:readonly:default(tool_result)',
13 'tool_use_id:Str:required',
14 'content:StrOrArrayRef:required',
15 'is_error:predicate',
16 'raw:HashRef:predicate',
17 );
18 }
19  
20 6 ▶sub text {
Subroutine text: called CC=7 SCAR=19.7
Pod documented
21 6 my ($self) = @_;
22 6 my $content = $self->content;
23  
24 6 ▶ return $content unless ref $content;
Branch: 1 branch
BranchTrueFalseTotal
unless ref $content 1 5 6
25  
26 5 my @texts;
27 5 for my $block (@$content) {
28 9 ▶ if (ref $block eq 'HASH' && defined $block->{type} && $block->{type} eq 'text' && defined $block->{text}) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $block eq "HASH" and defined $block->{"type"} and $block->{"type"} eq "text" and defined $block->{"text"}) 6 3 9
Condition66%6/9
ref $block eq "HASH" and defined $block->{"type"} and $block->{"type"} eq "text" and defined $block->{"text"}
!ll&&!rl&&r
126
ref $block eq "HASH" and defined $block->{"type"} and $block->{"type"} eq "text"
!ll&&!rl&&r
018
ref $block eq "HASH" and defined $block->{"type"}
!ll&&!rl&&r
009
MC/DC50%2/4
ref $block eq "HASH" and defined $block->{"type"} and $block->{"type"} eq "text" and defined $block->{"text"}
ref $block eq "HASH" defined $block->{"type"} $block->{"type"} eq "text" defined $block->{"text"}
Truth table60%3/5
A and B and C and D
A= ref $block eq "HASH"B= defined $block->{"type"}C= $block->{"type"} eq "text"D= defined $block->{"text"}
ABCDresult
0XXX0
10XX0
110X0
11100
11111
29 6 push @texts, $block->{text};
30 }
31 }
32 5 return join("\n", @texts);
33 }
34  
35 12 1;
36  
37 __END__
« Agent/Message/System.pm ↑ Summary Agent/Client.pm »