| 1 | package Imager::QRCode; | ||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use base qw(Exporter); | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use vars qw(@ISA $VERSION @EXPORT_OK); | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||
| 8 | 3 | @EXPORT_OK = qw(plot_qrcode); | |||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||
| 10 | 3 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 11 | 3 | ▶ | use Imager 0.55; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||
| 13 | 3 | ▶ | BEGIN { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=8.1
| |||||||||||||||||||||||||||||||||||||||
| 14 | 3 | $VERSION = '0.035'; | |||||||||||||||||||||||||||||||||||||
| 15 | eval { | ||||||||||||||||||||||||||||||||||||||
| 16 | 3 | require XSLoader; | |||||||||||||||||||||||||||||||||||||
| 17 | 3 | XSLoader::load('Imager::QRCode', $VERSION); | |||||||||||||||||||||||||||||||||||||
| 18 | 3 | 1; | |||||||||||||||||||||||||||||||||||||
| 19 | 3 | ▶ | } or do { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 20 | 0 | require DynaLoader; | |||||||||||||||||||||||||||||||||||||
| 21 | 0 | push @ISA, 'DynaLoader'; | |||||||||||||||||||||||||||||||||||||
| 22 | 0 | bootstrap Imager::QRCode $VERSION; | |||||||||||||||||||||||||||||||||||||
| 23 | }; | ||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||
| 26 | 8 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 27 | 8 | my $class = shift; | |||||||||||||||||||||||||||||||||||||
| 28 | 8 | ▶ | my $params = scalar ref $_[0] eq 'HASH' ? $_[0] : { @_ }; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 29 | 8 | return bless { params => $params }, $class; | |||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||
| 32 | 8 | ▶ | sub plot { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
plot: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 33 | 8 | my ( $self, $text ) = @_; | |||||||||||||||||||||||||||||||||||||
| 34 | 8 | ▶ | defined $text or croak 'Not enough arguments for plot()'; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 35 | 8 | return _imager( _plot($text, $self->{params}) ); | |||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | sub plot_qrcode { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
plot_qrcode: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 39 | 0 | my ( $text, $params ) = @_; | |||||||||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | defined $text or croak 'Not enough arguments for plot()'; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | $params ||= {} if !$params || ref $params ne 'HASH'; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/5
not $params or ref $params ne "HASH"
$params ||= {}
MC/DC0%0/2
not $params or ref $params ne "HASH"
not $params
ref $params ne "HASH"
MC/DC0%0/1
$params ||= {}
$params
Truth table0%0/3
not(A) or B
A= not $paramsB= ref $params ne "HASH"
Truth table0%0/2
A
A= $params
| |||||||||||||||||||||||||||||||||||||||
| 42 | 0 | return _imager( _plot( $text, $params ) ); | |||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||
| 45 | 6 | ▶ | sub _imager { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
_imager: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||||||||
| 46 | 6 | my $raw = shift; | |||||||||||||||||||||||||||||||||||||
| 47 | 6 | ▶ | ref $raw eq 'Imager::ImgRaw' or croak "_imager() argument must be Imager::ImgRaw"; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 48 | 6 | my $img = Imager->new; | |||||||||||||||||||||||||||||||||||||
| 49 | 6 | $img->{IMG} = $raw; | |||||||||||||||||||||||||||||||||||||
| 50 | 6 | return $img; | |||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||
| 53 | 3 | 1; # Magic true value required at end of module | |||||||||||||||||||||||||||||||||||||
| 54 | __END__ | ||||||||||||||||||||||||||||||||||||||