| 1 | package App::Saisons::Adapter::Codex; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use App::Saisons (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use JSON::PP (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use POSIX qw(); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use App::Saisons::Launcher (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | sub new { bless {}, shift } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | ▶ | sub name { 'Codex' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
name: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | ▶ | sub tag { "\x{2601} Cdx" } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
tag: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | ▶ | sub tag_color { 'bold cyan' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
tag_color: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | ▶ | sub find_sessions { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
find_sessions: called CC=5 SCAR=16.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | ▶ | my $root = $ENV{CODEX_HOME} // "$ENV{HOME}/.codex"; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$ENV{"CODEX_HOME"} // qq[$ENV{"HOME"}/.codex]
MC/DC0%0/1
$ENV{"CODEX_HOME"} // qq[$ENV{"HOME"}/.codex]
$ENV{"CODEX_HOME"}
Truth table50%1/2
A
A= $ENV{"CODEX_HOME"}
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 1 | my $sessions_dir = "$root/sessions"; | |||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | ▶ | return () unless -d $sessions_dir; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | my @files = _find_session_files($sessions_dir); | |||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | my @sessions; | |||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | for my $file (@files) { | |||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | my $s = _parse_session($file, $self) or next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | push @sessions, $s; | |||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | return @sessions; | |||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | ▶ | sub running { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
running: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | return (); | |||||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | sub launch { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
launch: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | my ($self, $sessions, $launcher) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | for my $s (@$sessions) { | |||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | my $cmd = "cd \Q$s->{cwd}\E && codex resume \Q$s->{_file}\E"; | |||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | App::Saisons::Launcher::launch_cmd($cmd, $s->{cwd}, $launcher, $s->{title}); | |||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | sub delete_session { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_session: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | my ($self, $session) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | return unlink $session->{_file}; | |||||||||||||||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 1 | ▶ | sub load_messages { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
load_messages: called CC=15 SCAR=29.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | 1 | my ($self, $session) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 41 | 1 | my @messages; | |||||||||||||||||||||||||||||||||||||||||
| 42 | 1 | ▶ | open my $fh, '<:utf8', $session->{_file} or return @messages; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 43 | 1 | ▶ | while (my $line = <$fh>) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 44 | 3 | ▶ | my $obj = eval { JSON::PP::decode_json($line) } or next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | 3 | ▶ | my $type = $obj->{type} // ''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$obj->{"type"} // ""
MC/DC0%0/1
$obj->{"type"} // ""
$obj->{"type"}
Truth table50%1/2
A
A= $obj->{"type"}
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | 3 | ▶ | my $payload = $obj->{payload} // {}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$obj->{"payload"} // {}
MC/DC0%0/1
$obj->{"payload"} // {}
$obj->{"payload"}
Truth table50%1/2
A
A= $obj->{"payload"}
| |||||||||||||||||||||||||||||||||||||||||||
| 47 | 3 | ▶ | if ($type eq 'event_msg' && ($payload->{type} // '') eq 'user_message') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition60%3/5
$type eq "event_msg" and ($payload->{"type"} // "") eq "user_message"
$payload->{"type"} // ""
MC/DC50%1/2
$type eq "event_msg" and ($payload->{"type"} // "") eq "user_message"
$type eq "event_msg"
$payload->{"type"}
Truth table66%2/3
A and B
A= $type eq "event_msg"B= $payload->{"type"}
| |||||||||||||||||||||||||||||||||||||||||||
| 48 | 1 | ▶ | my $text = $payload->{message} // ''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$payload->{"message"} // ""
MC/DC0%0/1
$payload->{"message"} // ""
$payload->{"message"}
Truth table50%1/2
A
A= $payload->{"message"}
| |||||||||||||||||||||||||||||||||||||||||||
| 49 | 1 | ▶ | push @messages, { role => 'user', text => $text } if length $text; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||
| 51 | ▶ | elsif ($type eq 'response_item' && ($payload->{role} // '') eq 'assistant') { | |||||||||||||||||||||||||||||||||||||||||
|
Condition60%3/5
$type eq "response_item" and ($payload->{"role"} // "") eq "assistant"
$payload->{"role"} // ""
MC/DC50%1/2
$type eq "response_item" and ($payload->{"role"} // "") eq "assistant"
$type eq "response_item"
$payload->{"role"}
Truth table66%2/3
A and B
A= $type eq "response_item"B= $payload->{"role"}
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | 1 | my $text = _extract_text($payload->{content}); | |||||||||||||||||||||||||||||||||||||||||
| 53 | 1 | ▶ | push @messages, { role => 'assistant', text => $text } if length $text; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||
| 56 | 1 | close $fh; | |||||||||||||||||||||||||||||||||||||||||
| 57 | 1 | return @messages; | |||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||
| 59 | 1 | ▶ | sub _find_session_files { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_find_session_files: called CC=17 SCAR=31.2
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | 1 | my ($root) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 61 | 1 | my @files; | |||||||||||||||||||||||||||||||||||||||||
| 62 | 1 | ▶ | opendir my $dh, $root or return @files; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 63 | 1 | for my $year (sort readdir $dh) { | |||||||||||||||||||||||||||||||||||||||||
| 64 | 3 | ▶ | next unless $year =~ /^\d{4}$/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | 1 | my $ydir = "$root/$year"; | |||||||||||||||||||||||||||||||||||||||||
| 66 | 1 | ▶ | opendir my $mdh, $ydir or next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | 1 | for my $month (sort readdir $mdh) { | |||||||||||||||||||||||||||||||||||||||||
| 68 | 3 | ▶ | next unless $month =~ /^\d{2}$/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 1 | my $mdir = "$ydir/$month"; | |||||||||||||||||||||||||||||||||||||||||
| 70 | 1 | ▶ | opendir my $ddh, $mdir or next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 71 | 1 | for my $day (sort readdir $ddh) { | |||||||||||||||||||||||||||||||||||||||||
| 72 | 3 | ▶ | next unless $day =~ /^\d{2}$/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 73 | 1 | my $ddir = "$mdir/$day"; | |||||||||||||||||||||||||||||||||||||||||
| 74 | 1 | ▶ | opendir my $fdh, $ddir or next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 75 | 1 | for my $file (sort readdir $fdh) { | |||||||||||||||||||||||||||||||||||||||||
| 76 | 3 | ▶ | next unless $file =~ /^rollout-.*\.jsonl$/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 77 | 1 | push @files, "$ddir/$file"; | |||||||||||||||||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||||||||||||||||
| 79 | 1 | closedir $fdh; | |||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||
| 81 | 1 | closedir $ddh; | |||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||
| 83 | 1 | closedir $mdh; | |||||||||||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||||||||||||
| 85 | 1 | closedir $dh; | |||||||||||||||||||||||||||||||||||||||||
| 86 | 1 | my $archived = "$root/archived_sessions"; | |||||||||||||||||||||||||||||||||||||||||
| 87 | 1 | ▶ | if (-d $archived) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | ▶ | opendir my $adh, $archived or return @files; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | for my $file (sort readdir $adh) { | |||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | next unless $file =~ /^rollout-.*\.jsonl$/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | push @files, "$archived/$file"; | |||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | closedir $adh; | |||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||
| 95 | 1 | return @files; | |||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||
| 97 | 1 | ▶ | sub _parse_session { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_parse_session: called CC=21 SCAR=36.8
| |||||||||||||||||||||||||||||||||||||||||||
| 98 | 1 | my ($file, $adapter) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 99 | 1 | ▶ | open my $fh, '<:utf8', $file or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 100 | 1 | my ($id, $cwd, $title); | |||||||||||||||||||||||||||||||||||||||||
| 101 | 1 | ▶ | while (my $line = <$fh>) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 102 | 2 | ▶ | my $obj = eval { JSON::PP::decode_json($line) } or next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 103 | 2 | ▶ | my $type = $obj->{type} // ''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$obj->{"type"} // ""
MC/DC0%0/1
$obj->{"type"} // ""
$obj->{"type"}
Truth table50%1/2
A
A= $obj->{"type"}
| |||||||||||||||||||||||||||||||||||||||||||
| 104 | 2 | ▶ | my $payload = $obj->{payload} // {}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$obj->{"payload"} // {}
MC/DC0%0/1
$obj->{"payload"} // {}
$obj->{"payload"}
Truth table50%1/2
A
A= $obj->{"payload"}
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | 2 | ▶ | if ($type eq 'session_meta') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | 1 | ▶ | $id //= $payload->{id}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$id //= $payload->{"id"}
MC/DC0%0/2
$id //= $payload->{"id"}
$id
$payload->{"id"}
Truth table33%1/3
A //= B
A= $idB= $payload->{"id"}
| |||||||||||||||||||||||||||||||||||||||||||
| 107 | 1 | ▶ | $cwd //= $payload->{cwd}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$cwd //= $payload->{"cwd"}
MC/DC0%0/2
$cwd //= $payload->{"cwd"}
$cwd
$payload->{"cwd"}
Truth table33%1/3
A //= B
A= $cwdB= $payload->{"cwd"}
| |||||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||
| 109 | ▶ | elsif ($type eq 'event_msg' && ($payload->{type} // '') eq 'user_message') { | |||||||||||||||||||||||||||||||||||||||||
|
Condition40%2/5
$type eq "event_msg" and ($payload->{"type"} // "") eq "user_message"
$payload->{"type"} // ""
MC/DC0%0/2
$type eq "event_msg" and ($payload->{"type"} // "") eq "user_message"
$type eq "event_msg"
$payload->{"type"}
Truth table33%1/3
A and B
A= $type eq "event_msg"B= $payload->{"type"}
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | 1 | ▶ | $title //= $payload->{message}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$title //= $payload->{"message"}
MC/DC0%0/2
$title //= $payload->{"message"}
$title
$payload->{"message"}
Truth table33%1/3
A //= B
A= $titleB= $payload->{"message"}
| |||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||
| 112 | 2 | ▶ | last if $id && $cwd && $title; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
$id and $cwd and $title
$id and $cwd
MC/DC33%1/3
$id and $cwd and $title
$id
$cwd
$title
Truth table50%2/4
A and B and C
A= $idB= $cwdC= $title
| |||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | 1 | close $fh; | |||||||||||||||||||||||||||||||||||||||||
| 115 | 1 | ▶ | return undef unless $id; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 116 | 1 | ▶ | $cwd //= $ENV{HOME}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$cwd //= $ENV{"HOME"}
MC/DC0%0/2
$cwd //= $ENV{"HOME"}
$cwd
$ENV{"HOME"}
Truth table33%1/3
A //= B
A= $cwdB= $ENV{"HOME"}
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | 1 | ▶ | $title //= '(no title)'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$title //= "(no title)"
MC/DC0%0/1
$title //= "(no title)"
$title
Truth table50%1/2
A
A= $title
| |||||||||||||||||||||||||||||||||||||||||||
| 118 | 1 | my ($date_str, $epoch) = ('0000-00-00', 0); | |||||||||||||||||||||||||||||||||||||||||
| 119 | 1 | ▶ | if ($file =~ /rollout-(\d{4})-(\d{2})-(\d{2})T(\d{2})-(\d{2})-(\d{2})/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 1 | $date_str = "$1-$2-$3T$4:$5:$6"; | |||||||||||||||||||||||||||||||||||||||||
| 121 | 1 | $epoch = POSIX::mktime($6, $5, $4, $3, $2 - 1, $1 - 1900); | |||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||
| 123 | return { | ||||||||||||||||||||||||||||||||||||||||||
| 124 | 1 | ▶ | id => $id, | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
-s $file // 0
MC/DC0%0/1
-s $file // 0
-s $file
Truth table50%1/2
A
A= -s $file
| |||||||||||||||||||||||||||||||||||||||||||
| 125 | title => $title, | ||||||||||||||||||||||||||||||||||||||||||
| 126 | date => $date_str, | ||||||||||||||||||||||||||||||||||||||||||
| 127 | epoch => $epoch, | ||||||||||||||||||||||||||||||||||||||||||
| 128 | cwd => $cwd, | ||||||||||||||||||||||||||||||||||||||||||
| 129 | project => $cwd, | ||||||||||||||||||||||||||||||||||||||||||
| 130 | _file => $file, | ||||||||||||||||||||||||||||||||||||||||||
| 131 | _size => (-s $file) // 0, | ||||||||||||||||||||||||||||||||||||||||||
| 132 | _adapter => $adapter, | ||||||||||||||||||||||||||||||||||||||||||
| 133 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||||||||||
| 135 | 1 | ▶ | sub _extract_text { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_extract_text: called CC=7 SCAR=22.9
| |||||||||||||||||||||||||||||||||||||||||||
| 136 | 1 | my ($content) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 137 | 1 | ▶ | return '' unless defined $content; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 138 | 1 | ▶ | return $content unless ref $content; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 139 | 1 | ▶ | return join '', map { ref $_ eq 'HASH' && ($_->{type}//'') eq 'text' ? $_->{text} : '' } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition40%2/5
ref $_ eq "HASH" and ($_->{"type"} // "") eq "text"
$_->{"type"} // ""
MC/DC0%0/2
ref $_ eq "HASH" and ($_->{"type"} // "") eq "text"
ref $_ eq "HASH"
$_->{"type"}
Truth table33%1/3
A and B
A= ref $_ eq "HASH"B= $_->{"type"}
| |||||||||||||||||||||||||||||||||||||||||||
| 140 | ref $content eq 'ARRAY' ? @$content : (); | ||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||
| 142 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||