V3/Recording/File.pm

filter: Statementstmt 70.0% 28 / 40 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 13 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 87.5% 7 / 8 Podpod 100% 1 / 1 totaltotal 47.3% 36 / 76 CC 9 SCAR 36.9
CC
9
Cov
47%
convert_recording
70.4
BEGIN
1.1
BEGIN
1.0
CRAP 40.0
« V3/Recording.pm ↑ Summary V3.pm »
1 package Bb::Collaborate::V3::Recording::File;
2 1 ▶use warnings; use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 extends 'Bb::Collaborate::V3';
7  
8 1 ▶use Scalar::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use Elive::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 =head1 NAME
14  
15 Bb::Collaborate::V3::Recording::File - Collaborate Recording File response class
16  
17 =head1 DESCRIPTION
18  
19 This class is used to return responses to recording conversion requests.
20  
21 =cut
22  
23 1 has 'recordingId' => (is => 'rw', isa => 'Int', required => 1);
24 1 __PACKAGE__->primary_key('recordingId');
25 1 __PACKAGE__->entity_name('RecordingFile');
26 1 __PACKAGE__->params(format => 'Str');
27  
28 1 has 'recordingStatus' => (is => 'rw', isa => 'Str', required => 1);
29  
30 =head2 convert_recording
31  
32 Bb::Collaborate::V3::RecordingFile->convert_recording( recording_id => $recording_id, format => 'mp4' );
33  
34 =cut
35  
36 0 ▶sub convert_recording {
Subroutine convert_recording: not called CC=9 SCAR=42.5
Pod documented
37 0 my ($class, %opt) = @_;
38  
39 0 ▶ my $connection = $opt{connection} || $class->connection
Branch: 1 branch
BranchTrueFalseTotal
my $connection = $opt{"connection"} || $class->connection or croak("Not connected") 0 0 0
Condition0%0/3
$opt{'connection'} || $class->connection
l!l&&r!l&&!r
000
MC/DC0%0/2
$opt{'connection'} || $class->connection
$opt{'connection'} $class->connection
Truth table0%0/3
A || B
A= $opt{'connection'}B= $class->connection
ABresult
1X1
011
000
40 or croak "Not connected";
41  
42 0 ▶ my $recording_id = $opt{recording_id} || $opt{recordingId};
Condition0%0/3
$opt{'recording_id'} || $opt{'recordingId'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$opt{'recording_id'} || $opt{'recordingId'}
$opt{'recording_id'} $opt{'recordingId'}
Truth table0%0/3
A || B
A= $opt{'recording_id'}B= $opt{'recordingId'}
ABresult
1X1
011
000
43  
44 0 ▶ $recording_id ||= $class->recordingId
Branch: 1 branch
BranchTrueFalseTotal
if ref $class 0 0 0
Condition0%0/3
$recording_id ||= $class->recordingId
l!l&&r!l&&!r
000
MC/DC0%0/2
$recording_id ||= $class->recordingId
$recording_id $class->recordingId
Truth table0%0/3
A ||= B
A= $recording_idB= $class->recordingId
ABresult
1X1
011
000
45 if ref($class);
46  
47 0 ▶ croak "unable to determine recording_id"
Branch: 1 branch
BranchTrueFalseTotal
unless $recording_id 0 0 0
48 unless $recording_id;
49  
50 0 ▶ my $format = $opt{format} || 'mp3';
Condition0%0/2
$opt{'format'} || 'mp3'
l!l
00
MC/DC0%0/1
$opt{'format'} || 'mp3'
$opt{'format'}
Truth table0%0/2
A
A= $opt{'format'}
Aresult
11
00
51  
52 0 ▶ my $command = $opt{command} || 'ConvertRecording';
Condition0%0/2
$opt{'command'} || 'ConvertRecording'
l!l
00
MC/DC0%0/1
$opt{'command'} || 'ConvertRecording'
$opt{'command'}
Truth table0%0/2
A
A= $opt{'command'}
Aresult
11
00
53  
54 0 my $params = $class->_freeze({recordingId => $recording_id, format => $format});
55 0 my $som = $connection->call( $command, => %$params);
56  
57 0 my $results = $class->_get_results( $som, $connection );
58  
59 0 ▶ use YAML::Syck; die "thats all I've got @{[ YAML::Syck::Dump($results) ]}";
Subroutine BEGIN: called CC=1 SCAR=0.6
60 }
61  
62 1 1;
« V3/Recording.pm ↑ Summary V3.pm »