Shakan/Declare.pm

filter: Statementstmt 75.0% 18 / 24 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 71.4% 5 / 7 Podpod 100% 2 / 2 totaltotal 65.7% 25 / 38 CC 2 SCAR 8.6
CC
2
Cov
67%
get
6.0
form
2.0
BEGIN
1.0
CRAP 2.4
« Shakan/Filters.pm ↑ Summary Shakan/Field.pm »
1 package HTML::Shakan::Declare;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use parent 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use HTML::Shakan ();
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 our @EXPORT = qw(form get);
8  
9 1 ▶sub import {
Subroutine import: called CC=1 SCAR=0.0
10 1 my $class = shift;
11 1 __PACKAGE__->export_to_level(1);
12 1 HTML::Shakan::Fields->export_to_level(1);
13 }
14  
15 1 our $FORMS;
16 0 ▶sub form ($@) { ## no critic.
Subroutine form: not called CC=1 SCAR=6.9
Pod documented
17 0 my ($name, @fields) = @_;
18 0 my $pkg = caller(0);
19 0 $FORMS->{$pkg}->{$name} = \@fields;
20 }
21  
22 0 ▶sub get {
Subroutine get: not called CC=2 SCAR=17.9
Pod documented
23 0 my ($class, $name, %args) = @_;
24 0 ▶ $class = ref $class || $class;
Condition0%0/3
ref $class || $class
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table0%0/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
25 return HTML::Shakan->new(
26 0 fields => $FORMS->{$class}->{$name},
27 %args,
28 );
29 }
30  
31 1 1;
32 __END__
« Shakan/Filters.pm ↑ Summary Shakan/Field.pm »