lib/TUI/Gadgets/AsciiChart.pm

filter: Statementstmt 54.6% 47 / 86 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 73.6% 14 / 19 Podpod 60.0% 3 / 5 totaltotal 53.3% 64 / 120 CC 6 SCAR 17.3
CC
6
Cov
49%
build
20.0
BUILD
12.0
new_TAsciiChart
2.0
CRAP 5.7
« lib/TUI/Dialogs/MultiCheckBoxes.pm ↑ Summary lib/TUI/App/Background.pm »
1 package TUI::Gadgets::AsciiChart;
2 # ABSTRACT: window showing an ASCII table and the focused character
3
4 5 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 5 our $VERSION = '2.000003';
9 5 $VERSION =~ tr/_//d;
10 5 our $AUTHORITY = 'cpan:BRICKPOOL';
11
12 5 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 5 our @EXPORT = qw(
14 TAsciiChart
15 new_TAsciiChart
16 );
17
18 5 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
19 5 ▶use Storable;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 5 ▶use TUI::toolkit;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 5 ▶use TUI::toolkit::Types qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
22 is_Object
23 :types
24 5 );
25
26 5 ▶use TUI::Drivers::Const qw( evBroadcast );
Subroutine BEGIN: called CC=1 SCAR=0.0
27 5 ▶use TUI::Gadgets::Report;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 5 ▶use TUI::Gadgets::Table;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 5 ▶use TUI::Objects::Rect;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 5 ▶use TUI::Views::Const qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
31 ofFramed
32 ofSelectable
33 wfGrow
34 wfZoom
35 wnNoNumber
36 wpGrayWindow
37 5 );
38 5 ▶use TUI::Views::Window;
Subroutine BEGIN: called CC=1 SCAR=0.0
39
40 sub TAsciiChart() { __PACKAGE__ }
41 sub name() { 'TAsciiChart' }
42 0 ▶sub new_TAsciiChart { __PACKAGE__->from(@_) }
Subroutine new_TAsciiChart: not called CC=1 SCAR=6.9
Pod documented
43
44 5 extends TWindow;
45
46 0 ▶sub BUILDARGS { # \%args (%args)
Subroutine BUILDARGS: not called CC=1 SCAR=6.9
Pod documented
47 0 state $sig = signature(
48 method => 1,
49 named => [],
50 caller_level => +1,
51 );
52 0 my ( $class ) = $sig->( @_ );
53 0 local $Carp::CarpLevel = $Carp::CarpLevel + 1;
54 0 return $class->SUPER::BUILDARGS(
55 bounds => TRect->new( ax => 0, ay => 0, bx => 34, by => 12 ),
56 title => 'ASCII Chart',
57 number => wnNoNumber,
58 );
59 }
60
61 0 ▶sub BUILD { # void (\%args)
Subroutine BUILD: not called CC=3 SCAR=24.8
Pod documented
62 0 my ( $self, $args ) = @_;
63 0 ▶ assert ( @_ == 2 );
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 2 0 0 0
64 0 ▶ assert ( is_Object $self );
Branch: 1 branch
BranchTrueFalseTotal
unless &is_Object($self) 0 0 0
65
66 0 $self->{flags} &= ~( wfGrow | wfZoom );
67 0 $self->{palette} = wpGrayWindow;
68
69 0 my $r = $self->getExtent();
70 0 $r->grow( -1, -1 );
71 0 $r->{a}{y} = $r->{b}{y} - 1;
72 0 my $report = TReport->new( bounds => $r );
73 0 $report->{options} |= ofFramed;
74 0 $report->{eventMask} |= evBroadcast;
75 0 $self->insert( $report );
76
77 0 $r = $self->getExtent();
78 0 $r->grow( -1, -1 );
79 0 $r->{b}{y} -= 2;
80 0 my $table = TTable->new( bounds => $r );
81 0 $table->{options} |= ofFramed | ofSelectable;
82 0 $table->blockCursor();
83 0 $self->insert( $table );
84 0 $table->select();
85 0 return;
86 }
87
88 0 ▶sub from { # $asciiChart ()
Subroutine from: not called CC=1 SCAR=6.9
Pod undocumented
89 0 state $sig = signature(
90 method => 1,
91 pos => [],
92 );
93 0 my ( $class ) = $sig->( @_ );
94 0 return $class->new();
95 }
96
97 0 ▶sub build { # $obj ()
Subroutine build: not called CC=4 SCAR=30.0
Pod undocumented
98 0 my ( $class ) = @_;
99 0 ▶ assert ( @_ == 1 );
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 1 0 0 0
100 0 ▶ assert ( is_Str $class );
Branch: 1 branch
BranchTrueFalseTotal
unless $class->is_Str 0 0 0
101 0 ▶ assert ( Storable::is_retrieving );
Branch: 1 branch
BranchTrueFalseTotal
unless &Storable::is_retrieving() 0 0 0
102 0 return $class->new();
103 }
104
105 5 1
106
107 __END__
« lib/TUI/Dialogs/MultiCheckBoxes.pm ↑ Summary lib/TUI/App/Background.pm »