OFC/Dataset/Line.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 97.6% 42 / 43 CC 2 SCAR 2.0
CC
2
Cov
100%
_parameters_for_type
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« OFC/Dataset/Bar.pm ↑ Summary OFC/Axis.pm »
1 package Chart::OFC::Dataset::Line;
2 25 $Chart::OFC::Dataset::Line::VERSION = '0.12';
3 25 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 25 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 25 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 25 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 25 ▶use Chart::OFC::Types;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 25 extends 'Chart::OFC::Dataset';
11  
12 # Cannot do has '+values' because the new type is not a subtype of the
13 # type in the parent class.
14 25 has 'values' =>
15 ( is => 'ro',
16 isa => 'Chart::OFC::Type::NonEmptyArrayRefOfNumsOrUndefs',
17 required => 1,
18 auto_deref => 1,
19 );
20  
21 25 has width =>
22 ( is => 'ro',
23 isa => 'Chart::OFC::Type::PosInt',
24 default => 2,
25 );
26  
27 25 has color =>
28 ( is => 'ro',
29 isa => 'Chart::OFC::Type::Color',
30 coerce => 1,
31 default => '#000000',
32 );
33  
34 25 has label =>
35 ( is => 'ro',
36 isa => 'Str',
37 predicate => '_has_label',
38 );
39  
40 25 has text_size =>
41 ( is => 'ro',
42 isa => 'Chart::OFC::Type::Size',
43 default => 10,
44 );
45  
46 sub type
47 6 ▶{
Subroutine type: called CC=1 SCAR=0.0
Pod undocumented
48 6 return 'line';
49 }
50  
51 sub _parameters_for_type
52 6 ▶{
Subroutine _parameters_for_type: called CC=2 SCAR=6.9
53 6 my $self = shift;
54  
55 6 my @p = ( $self->width(), $self->color() );
56 6 ▶ push @p, ( $self->label(), $self->text_size() )
Branch: 1 branch
BranchTrueFalseTotal
if $self->_has_label 2 4 6
57 if $self->_has_label();
58  
59 6 return @p;
60 }
61  
62 25 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
63  
64 25 __PACKAGE__->meta()->make_immutable();
65  
66 25 1;
67  
68 # ABSTRACT: A dataset represented as a line
69  
70 __END__
« OFC/Dataset/Bar.pm ↑ Summary OFC/Axis.pm »