Lazy/Image.pm

filter: Statementstmt 40.0% 10 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.8% 3 / 7 Podpod 80.0% 4 / 5 totaltotal 45.9% 17 / 37 CC 1 SCAR 4.5
CC
1
Cov
40%
dir
2.0
file
2.0
load
2.0
CRAP 1.6
« Lazy/Plugin.pm ↑ Summary Lazy/Utility.pm »
1 package CGI::Lazy::Image;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use CGI::Lazy::Globals;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 #-------------------------------------------------------------------------------------------------
8 0 ▶sub dir {
Subroutine dir: not called CC=1 SCAR=6.9
Pod documented
9 0 my $self = shift;
10  
11 0 return $self->{_dir};
12 }
13  
14 #----------------------------------------------------------------------------------------
15 0 ▶sub file {
Subroutine file: not called CC=1 SCAR=6.9
Pod documented
16 0 my $self = shift;
17 0 my $file = shift;
18  
19 0 my $dir = $self->dir;
20  
21 0 return "$dir/$file";
22 }
23  
24 #----------------------------------------------------------------------------------------
25 0 ▶sub load {
Subroutine load: not called CC=1 SCAR=6.9
Pod undocumented
26 0 my $self = shift;
27 0 my $file = shift;
28
29 0 my $dir = $self->dir;
30 0 $dir =~s/^\///; #strip a leading slash
31 0 my $docroot = $ENV{DOCUMENT_ROOT};
32 0 $docroot =~ s/\/$//; #strip the trailing slash so we don't double it
33  
34 0 return "$docroot/$dir/$file";
35  
36 }
37  
38 #-------------------------------------------------------------------------------------------------
39 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
40 1 my $class = shift;
41 1 my $q = shift;
42  
43 1 return bless {
44 _q => $q,
45 _dir => $q->config->imgDir,
46
47 }, $class;
48 }
49  
50 #-------------------------------------------------------------------------------------------------
51 0 ▶sub q {
Subroutine q: not called CC=1 SCAR=6.9
Pod documented
52 0 my $self = shift;
53  
54 0 return $self->{_q};
55 }
56  
57 1 1
58  
59 __END__
« Lazy/Plugin.pm ↑ Summary Lazy/Utility.pm »