App/Command.pm

filter: Statementstmt 100% 36 / 36 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 0.0% 0 / 3 totaltotal 92.3% 48 / 52 CC 2 SCAR 1.6
CC
2
Cov
97%
init_class
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« App/Plugin/ConfigHome.pm ↑ Summary App/Plugin/Depends.pm »
1 # ============================================================================
2 package MooseX::App::Command;
3 # ============================================================================
4  
5 11 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 11 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 11 ▶use Moose ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11 11 ▶use MooseX::App::Meta::Role::Attribute::Option;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 11 ▶use MooseX::App::Exporter qw(option parameter command_short_description command_long_description command_usage command_strict);
Subroutine BEGIN: called CC=1 SCAR=0.0
13 11 ▶use Moose::Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 11 Moose::Exporter->setup_import_methods(
16 with_meta => [qw(command_short_description command_long_description command_strict command_usage option parameter extends)],
17 also => 'Moose',
18 );
19  
20 42 ▶sub init_meta {
Subroutine init_meta: called CC=1 SCAR=0.0
Pod undocumented
21 42 my ($class,%args) = @_;
22  
23 42 my $meta = Moose->init_meta( %args );
24 42 init_class($meta);
25  
26 42 return $meta;
27 }
28  
29 23 ▶sub extends {
Subroutine extends: called CC=1 SCAR=0.0
Pod undocumented
30 23 my $meta = shift;
31 23 $meta->superclasses(@_);
32 # Need to re-init meta class, just in case
33 23 init_class($meta);
34 }
35  
36 65 ▶sub init_class {
Subroutine init_class: called CC=2 SCAR=7.0
Pod undocumented
37 65 my $meta = shift;
38 65 Moose::Util::MetaRole::apply_metaroles(
39 for => $meta,
40 class_metaroles => {
41 class => [
42 'MooseX::App::Meta::Role::Class::Documentation',
43 'MooseX::App::Meta::Role::Class::Command'
44 ],
45 attribute => [
46 'MooseX::App::Meta::Role::Attribute::Option'
47 ],
48 },
49 );
50  
51 65 ▶ unless ($meta->DOES('MooseX::App::Role::Common')) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($meta->DOES("MooseX::App::Role::Common")) 65 0 65
52 65 Moose::Util::MetaRole::apply_base_class_roles(
53 for => $meta->name,
54 roles => ['MooseX::App::Role::Common'],
55 );
56 }
57 }
58  
59 11 1;
60  
61 __END__
« App/Plugin/ConfigHome.pm ↑ Summary App/Plugin/Depends.pm »