lib/TUI/Objects/SortedCollection.pm

filter: Statementstmt 96.7% 59 / 61 Branchbran 50.0% 5 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 89.4% 17 / 19 Podpod 12.5% 1 / 8 totaltotal 83.6% 82 / 98 CC 6 SCAR 5.8
CC
6
Cov
90%
build
4.2
write
2.0
read
2.0
CRAP 1.8
« lib/TUI/StdDlg/Dos.pm ↑ Summary lib/TUI/Objects/StringCollection.pm »
1 package TUI::Objects::SortedCollection;
2 # ABSTRACT: sorted collection base class
3
4 42 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 42 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 42 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 42 our $VERSION = '2.000003';
9 42 $VERSION =~ tr/_//d;
10 42 our $AUTHORITY = 'cpan:BRICKPOOL';
11
12 42 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 42 our @EXPORT = qw(
14 TSortedCollection
15 new_TSortedCollection
16 );
17
18 42 ▶use Storable;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 42 ▶use TUI::toolkit;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 42 ▶use TUI::toolkit::Types qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
21 is_Str
22 Object
23 42 );
24
25 42 ▶use TUI::Objects::Stream;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 42 ▶use TUI::Objects::Streamable;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 42 ▶use TUI::Objects::Collection;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 42 ▶use TUI::Objects::NSSortedCollection;
Subroutine BEGIN: called CC=1 SCAR=0.0
29
30 sub TSortedCollection() { __PACKAGE__ }
31 sub name() { 'TSortedCollection' };
32 1 ▶sub new_TSortedCollection { __PACKAGE__->from(@_) }
Subroutine new_TSortedCollection: called CC=1 SCAR=0.0
Pod documented
33
34 42 extends TNSSortedCollection;
35
36 2 ▶sub STORABLE_freeze { # @list ($cloning)
Subroutine STORABLE_freeze: called CC=1 SCAR=0.0
Pod undocumented
37 2 goto &TUI::Objects::Collection::STORABLE_freeze;
38 }
39
40 2 ▶sub STORABLE_attach { # $obj ($cloning, $serialized)
Subroutine STORABLE_attach: called CC=1 SCAR=0.0
Pod undocumented
41 2 goto &TUI::Objects::Collection::STORABLE_attach;
42 }
43
44 0 ▶sub writeItem { # void ($item, $os)
Subroutine writeItem: not called CC=1 SCAR=6.9
Pod undocumented
45 0 goto &TUI::Objects::Collection::writeItem;
46 }
47
48 0 ▶sub readItem { # $item|undef ($is)
Subroutine readItem: not called CC=1 SCAR=6.9
Pod undocumented
49 0 goto &TUI::Objects::Collection::readItem;
50 }
51
52 2 ▶sub write :method { # void ($os)
Subroutine write: called CC=2 SCAR=7.0
Pod undocumented
53 2 state $sig = signature(
54 method => Object,
55 pos => [Object],
56 );
57 2 my ( $self, $os ) = $sig->( @_ );
58 2 $self->TUI::Objects::Collection::write( $os );
59 2 ▶ $os->put( $self->{duplicates} ? 1 : 0 );
Branch: 1 branch
BranchTrueFalseTotal
$self->{'duplicates'} ? : 0 2 2
60 2 return;
61 }
62
63 2 ▶sub read :method { # $self ($is)
Subroutine read: called CC=2 SCAR=7.0
Pod undocumented
64 2 state $sig = signature(
65 method => Object,
66 pos => [Object],
67 );
68 2 my ( $self, $is ) = $sig->( @_ );
69 2 $self->TUI::Objects::Collection::read( $is );
70 2 ▶ $self->{duplicates} = $is->get() ? true : false;
Branch: 1 branch
BranchTrueFalseTotal
$is->get ? : 0 2 2
71 2 return $self;
72 }
73
74 1 ▶sub build { # $obj ()
Subroutine build: called CC=4 SCAR=14.2
Pod undocumented
75 1 my ( $class ) = @_;
76 1 ▶ assert ( @_ == 1 );
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 1 0 1 1
77 1 ▶ assert ( is_Str $class );
Branch: 1 branch
BranchTrueFalseTotal
unless &is_Str($class) 0 1 1
78 1 ▶ assert ( Storable::is_retrieving );
Branch: 1 branch
BranchTrueFalseTotal
unless &Storable::is_retrieving() 0 1 1
79 1 return $class->new(
80 limit => 0,
81 delta => 0,
82 );
83 }
84
85 42 1
86
87 __END__
« lib/TUI/StdDlg/Dos.pm ↑ Summary lib/TUI/Objects/StringCollection.pm »