Image/LegoCom.pm

filter: Statementstmt 66.6% 14 / 21 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 100% 1 / 1 totaltotal 63.3% 19 / 30 SCAR 8.1
CC
2
Cov
61%
image_url
6.0
_zoom
2.0
BEGIN
1.0
CRAP 2.2
« Image/PeeronCom.pm ↑ Summary Image/LugnetCom.pm »
1 package Lego::Part::Image::LegoCom;
2  
3 # Pragmas.
4 4 ▶use base qw(Lego::Part::Image);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # Modules.
9 4 ▶use Error::Pure qw(err);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 # Version.
12 4 our $VERSION = 0.04;
13  
14 # Get image URL.
15 sub image_url {
16 0 ▶ my $self = shift;
Subroutine image_url: not called CC=2 SCAR=17.9
Pod documented
17 0 ▶ if (! defined $self->{'part'}->element_id) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"part"}->element_id) 0 0 0
18 0 err "Element ID doesn't defined.";
19 }
20 my $url = sprintf 'http://cache.lego.com/media/bricks/5/%s/%s.jpg',
21 0 $self->_zoom, $self->{'part'}->element_id;
22 0 return $url;
23 }
24  
25 # lego.com zoom rutine.
26 sub _zoom {
27 0 ▶ my $self = shift;
Subroutine _zoom: not called CC=1 SCAR=6.9
28 # TODO Better resolution? 2/3 in lego.com
29 0 return 2;
30 }
31  
32 4 1;
33  
34 __END__
« Image/PeeronCom.pm ↑ Summary Image/LugnetCom.pm »