Image/PeeronCom.pm

filter: Statementstmt 66.6% 14 / 21 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 61.2% 19 / 31 SCAR 13.3
CC
3
Cov
56%
image_url
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.8
« Image.pm ↑ Summary Image/LegoCom.pm »
1 package Lego::Part::Image::PeeronCom;
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=3 SCAR=24.8
Pod documented
17 0 ▶ if (! defined $self->{'part'}->color) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"part"}->color) 0 0 0
18 0 err "Color doesn't defined.";
19 }
20 0 ▶ if (! defined $self->{'part'}->design_id) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"part"}->design_id) 0 0 0
21 0 err "Design ID doesn't defined.";
22 }
23 my $url = sprintf 'http://media.peeron.com/ldraw/images/%d/100/%s.png',
24 0 $self->{'part'}->color, $self->{'part'}->design_id;
25 0 return $url;
26 }
27  
28 4 1;
29  
30 __END__
« Image.pm ↑ Summary Image/LegoCom.pm »