Object/DOM/VideoTrack.pm

filter: Statementstmt 55.8% 24 / 43 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 8 / 12 Podpod 100% 3 / 3 totaltotal 49.3% 35 / 71 CC 6 SCAR 20.2
CC
6
Cov
44%
init
20.0
__ANON__
12.0
selected
2.0
CRAP 7.5
« Object/DOM/VTTCue.pm ↑ Summary Object/Event.pm »
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/DOM/VideoTrack.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2021 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2021/12/28
7 ## Modified 2022/09/18
8 ## All rights reserved.
9 ##
10 ##
11 ## This program is free software; you can redistribute it and/or modify it
12 ## under the same terms as Perl itself.
13 ##----------------------------------------------------------------------------
14 package HTML::Object::DOM::VideoTrack;
15 BEGIN
16 1 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 warnings::register_categories( 'HTML::Object' );
20 1 ▶ use parent qw( HTML::Object::EventTarget );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶ use HTML::Object::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 our $VERSION = 'v0.2.0';
24 };
25  
26 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 sub init
30 0 ▶{
Subroutine init: not called CC=4 SCAR=30.0
Pod documented
31 0 my $self = shift( @_ );
32 0 ▶ return( $self->error({
Branch: 1 branch
BranchTrueFalseTotal
if scalar @_ < 3 0 0 0
33 message => sprintf( "At least 1 argument required, but only %d passed", scalar( @_ ) ),
34 class => 'HML::Object::TypeError',
35 }) ) if( scalar( @_ ) < 3 );
36 0 my $kind = shift( @_ );
37 0 my $label = shift( @_ );
38 0 my $lang = shift( @_ );
39 0 ▶ return( $self->error({
Branch: 1 branch
BranchTrueFalseTotal
unless $kind =~ /^\w+$/ 0 0 0
40 message => "kind argument provided is not a string",
41 class => 'HML::Object::TypeError',
42 }) ) if( $kind !~ /^\w+$/ );
43 # If set, this should be the same as the id in HTML::Object::DOM::Element::Track
44 0 $self->{id} = undef;
45 0 $self->{kind} = $kind;
46 0 $self->{label} = $label;
47 0 $self->{language} = $lang;
48 0 $self->{_init_strict_use_sub} = 1;
49 0 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 0 0
50 0 return( $self );
51 }
52  
53 # Note: property id inherited
54  
55 # Note: property kind inherited
56  
57 # Note: property label inherited
58  
59 # Note: property language inherited
60  
61 # Note: property
62 0 ▶sub selected : lvalue { return( shift->_set_get_boolean({
Subroutine selected: not called CC=1 SCAR=6.9
Pod documented
63 field => 'selected',
64 callbacks =>
65 {
66 add => sub
67 0 ▶ {
Subroutine __ANON__: not called CC=3 SCAR=24.8
68 0 my $me = shift( @_ );
69 0 my $parent;
70 0 ▶ if( ( $parent = $me->parent ) && ( my $coderef = $parent->can( '_update_selected' ) ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($parent = $me->parent and my $coderef = $parent->can("_update_selected")) 0 0 0
Condition0%0/3
$parent = $me->parent and my $coderef = $parent->can("_update_selected")
!ll&&!rl&&r
000
MC/DC0%0/2
$parent = $me->parent and my $coderef = $parent->can("_update_selected")
$parent = $me->parent my $coderef = $parent->can("_update_selected")
Truth table0%0/3
A and B
A= $parent = $me->parentB= my $coderef = $parent->can("_update_selected")
ABresult
0X0
100
111
71 {
72 0 $coderef->( $parent, $me );
73 }
74 }
75 }
76 0 }, @_ ) ); }
77  
78 # Note: property
79 0 ▶sub sourceBuffer { return; }
Subroutine sourceBuffer: not called CC=1 SCAR=6.9
Pod documented
80  
81 1 1;
82 # NOTE: POD
83 __END__
« Object/DOM/VTTCue.pm ↑ Summary Object/Event.pm »