JobControl/Mojolicious/Plugin/Project.pm

filter: Statementstmt 78.5% 22 / 28 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 100% 1 / 1 totaltotal 76.9% 30 / 39 CC 2 SCAR 7.7
CC
2
Cov
73%
__ANON__
6.0
register
1.5
BEGIN
1.0
CRAP 2.2
« JobControl/Job.pm ↑ Summary JobControl/Audit.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4 # vim: set ts=3 sw=3 tw=0:
5 # vim: set expandtab:
6  
7 package Rex::JobControl::Mojolicious::Plugin::Project;
8 1 $Rex::JobControl::Mojolicious::Plugin::Project::VERSION = '0.18.0';
9 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶use Mojolicious::Plugin;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Digest::MD5 'md5_hex';
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use Rex::JobControl::Helper::Project;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 ▶use base 'Mojolicious::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶sub register {
Subroutine register: called CC=1 SCAR=4.1
Pod documented
19 1 my ( $plugin, $app ) = @_;
20  
21 $app->helper(
22 0 ▶ project => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
23 0 my ( $self, $directory ) = @_;
24  
25 0 my $name = $directory;
26  
27 0 ▶ if ( $directory !~ m/^[a-f0-9]{32}$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($directory =~ /^[a-f0-9]{32}$/) 0 0 0
28  
29 # no md5sum, compat. code
30 0 $directory = md5_hex($directory);
31 }
32  
33 0 my $u = Rex::JobControl::Helper::Project->new(
34 directory => $directory,
35 name => $name,
36 app => $app
37 );
38 0 return $u;
39 }
40 1 );
41 }
42  
43 1 1;
« JobControl/Job.pm ↑ Summary JobControl/Audit.pm »