DDG/Meta.pm

filter: Statementstmt 100% 78 / 78 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 21 / 21 Podpod 100% 5 / 5 totaltotal 94.6% 107 / 113 SCAR 13.9
CC
4
Cov
95%
__ANON__
6.0
apply_goodie_keywords
1.0
BEGIN
1.0
CRAP 4.0
« DDG/Meta/Helper.pm ↑ Summary DDG/Meta/Block.pm »
1 package DDG::Meta;
2 11 our $AUTHORITY = 'cpan:DDG';
3 # ABSTRACT: Main meta layer implementation factory... dark side of the moon...
4 11 $DDG::Meta::VERSION = '1016';
5 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 11 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 11 require Data::Printer;
9  
10 11 ▶use DDG::Meta::RequestHandler;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 11 ▶use DDG::Meta::ZeroClickInfo;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 11 ▶use DDG::Meta::ZeroClickInfoSpice;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 11 ▶use DDG::Meta::Fathead;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 11 ▶use DDG::Meta::ShareDir;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 11 ▶use DDG::Meta::Block;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 11 ▶use DDG::Meta::Information;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 11 ▶use DDG::Meta::Helper;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 11 ▶use DDG::Meta::AnyBlock;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 11 ▶use DDG::Meta::CountryCodes;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 11 ▶use MooX ();
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 11 require Moo::Role;
24  
25  
26 sub apply_base_to_package {
27 45 ▶ my ( $class, $target ) = @_;
Subroutine apply_base_to_package: called CC=1 SCAR=0.0
Pod documented
28  
29 45 MooX->import::into($target, qw(
30 +Data::Printer
31 ));
32 }
33  
34  
35 sub apply_goodie_keywords {
36 24 ▶ my ( $class, $target ) = @_;
Subroutine apply_goodie_keywords: called CC=1 SCAR=0.2
Pod documented
37 24 DDG::Meta::ZeroClickInfo->apply_keywords($target);
38 24 DDG::Meta::ShareDir->apply_keywords($target);
39 24 DDG::Meta::Block->apply_keywords($target);
40 24 DDG::Meta::Information->apply_keywords($target);
41 24 DDG::Meta::Helper->apply_keywords($target);
42 DDG::Meta::RequestHandler->apply_keywords($target,sub {
43 shift->zci_new(
44 34 ▶ scalar @_ == 1 && ref $_[0] eq 'HASH' ? $_[0] :
Subroutine __ANON__: called CC=4 SCAR=17.9
Branch: 2 branches
BranchTrueFalseTotal
scalar @_ == 1 && ref $_[0] eq 'HASH' ? : 0 34 34
@_ % 2 ? : 34 0 34
Condition33%1/3
scalar @_ == 1 and ref $_[0] eq "HASH"
!ll&&!rl&&r
0340
MC/DC0%0/2
scalar @_ == 1 and ref $_[0] eq "HASH"
scalar @_ == 1 ref $_[0] eq "HASH"
Truth table33%1/3
A and B
A= scalar @_ == 1B= ref $_[0] eq "HASH"
ABresult
0X0
100
111
45 @_ % 2 ? ( answer => @_ ) : @_
46 );
47 24 },'DDG::IsGoodie');
48 }
49  
50  
51 sub apply_spice_keywords {
52 11 ▶ my ( $class, $target ) = @_;
Subroutine apply_spice_keywords: called CC=1 SCAR=0.0
Pod documented
53 11 DDG::Meta::ZeroClickInfoSpice->apply_keywords($target);
54 11 DDG::Meta::ShareDir->apply_keywords($target);
55 11 DDG::Meta::Block->apply_keywords($target);
56 11 DDG::Meta::Information->apply_keywords($target);
57 11 DDG::Meta::Helper->apply_keywords($target);
58 DDG::Meta::RequestHandler->apply_keywords($target,sub {
59 11 ▶ shift->spice_new(@_);
Subroutine __ANON__: called CC=1 SCAR=0.0
60 11 },'DDG::IsSpice');
61 }
62  
63  
64 sub apply_fathead_keywords {
65 5 ▶ my ( $class, $target ) = @_;
Subroutine apply_fathead_keywords: called CC=1 SCAR=0.0
Pod documented
66 5 DDG::Meta::ZeroClickInfo->apply_keywords($target);
67 5 DDG::Meta::ShareDir->apply_keywords($target);
68 5 DDG::Meta::Fathead->apply_keywords($target);
69 5 DDG::Meta::Information->apply_keywords($target);
70 5 DDG::Meta::AnyBlock->apply_keywords($target);
71 5 Moo::Role->apply_role_to_package($target, "DDG::IsFathead");
72 }
73  
74  
75 sub apply_longtail_keywords {
76 5 ▶ my ( $class, $target ) = @_;
Subroutine apply_longtail_keywords: called CC=1 SCAR=0.0
Pod documented
77 5 DDG::Meta::ZeroClickInfo->apply_keywords($target);
78 5 DDG::Meta::ShareDir->apply_keywords($target);
79 5 DDG::Meta::Information->apply_keywords($target);
80 5 DDG::Meta::AnyBlock->apply_keywords($target);
81 5 Moo::Role->apply_role_to_package($target, "DDG::IsLongtail");
82 }
83  
84 11 1;
85  
86 __END__
« DDG/Meta/Helper.pm ↑ Summary DDG/Meta/Block.pm »