Chart/Size.pm

filter: Statementstmt 77.7% 28 / 36 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 70.0% 7 / 10 Podpod 100% 1 / 1 totaltotal 70.5% 36 / 51 CC 3 SCAR 10.1
CC
3
Cov
70%
__ANON__
6.0
__ANON__
6.0
parameter_value
2.0
CRAP 2.8
« Chart/Fill/LinearStripes.pm ↑ Summary Chart/Type/Pie.pm »
1 # $Id$
2  
3 package Google::Chart::Size;
4 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Google::Chart::Types qw(hash_coercion);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Carp();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use constant parameter_name => 'chs';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 with 'Google::Chart::QueryComponent::Simple';
12  
13 coerce 'Google::Chart::Size'
14 => from 'Str'
15 0 ▶ => via {
Subroutine __ANON__: not called CC=2 SCAR=17.9
16 0 ▶ if (! /^(\d+)x(\d+)$/) {
Branch: 1 branch
BranchTrueFalseTotal
unless (/^(\d+)x(\d+)$/) 0 0 0
17 0 Carp::confess("Could not parse $_ as size");
18 }
19  
20 0 return Google::Chart::Size->new(width => $1, height => $2);
21 }
22 1 ;
23  
24 coerce 'Google::Chart::Size'
25 => from 'HashRef'
26 0 ▶ => via {
Subroutine __ANON__: not called CC=2 SCAR=17.9
27 0 my $h = $_;
28  
29 my ($width, $height) = ($h->{args}) ?
30 ($h->{args}->{width}, $h->{args}->{height}) :
31 ($h->{width}, $h->{height})
32 0 ▶ ;
Branch: 1 branch
BranchTrueFalseTotal
$h->{'args'} ? : 0 0 0
33  
34 0 return Google::Chart::Size->new( width => $width, height => $height );
35 }
36 1 ;
37  
38 1 has 'width' => (
39 is => 'rw',
40 isa => 'Int',
41 required => 1
42 );
43  
44 1 has 'height' => (
45 is => 'rw',
46 isa => 'Int',
47 required => 1
48 );
49  
50 1 __PACKAGE__->meta->make_immutable;
51  
52 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
53 1 ▶no Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
54  
55 0 ▶sub parameter_value {
Subroutine parameter_value: not called CC=1 SCAR=6.9
Pod documented
56 0 my $self = shift;
57 0 return join('x', $self->width, $self->height);
58 }
59  
60 1 1;
61  
62 __END__
« Chart/Fill/LinearStripes.pm ↑ Summary Chart/Type/Pie.pm »