Type/Plugin/Windows.pm

filter: Statementstmt 32.0% 8 / 25 Branchbran 12.5% 1 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 3 totaltotal 27.5% 11 / 40 CC 5 SCAR 20.0
CC
5
Cov
27%
fstype
12.0
new
6.8
diagnose
2.0
CRAP 7.4
↑ Summary Type/Plugin/Unix.pm »
1 package Filesys::Type::Plugin::Windows;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 our $VERSION = 0.02;
5  
6 1 ▶sub new {
Subroutine new: called CC=3 SCAR=19.2
Pod undocumented
7 1 my $pkg = shift;
8  
9 1 ▶ return undef unless $^O =~ /win/i;
Branch: 1 branch
BranchTrueFalseTotal
unless $^O =~ /win/i 1 0 1
10  
11 0 eval {
12 0 require Win32;
13 0 require Cwd;
14 0 require File::Spec;
15 };
16 0 ▶ return undef if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 0 0
17  
18 0 bless {}, $pkg;
19 }
20  
21 1 our ($dest,$err);
22  
23 0 ▶sub fstype {
Subroutine fstype: not called CC=3 SCAR=24.8
Pod undocumented
24 0 my ($self,$path) = @_;
25  
26 0 my $cur = Cwd::cwd;
27  
28 0 eval {
29 0 my ($vol,$dir,$file) = File::Spec->splitpath($path);
30 0 $dest = File::Spec->catpath($vol,$dir);
31 };
32 0 ▶ ($err = $@) && return undef;
Branch: 1 branch
BranchTrueFalseTotal
$Filesys::Type::Plugin::Windows::err = $@ and return undef 0 0 0
33 0 ▶ chdir $dest or return undef;
Branch: 1 branch
BranchTrueFalseTotal
chdir $Filesys::Type::Plugin::Windows::dest or return undef 0 0 0
34 0 my $fstype = Win32::FsType();
35 0 chdir $cur;
36 0 $fstype;
37 }
38  
39 0 ▶sub diagnose {
Subroutine diagnose: not called CC=1 SCAR=6.9
Pod undocumented
40 0 $err . "\nWorking directory: ".$dest;
41 }
42  
43  
44 1 1;
↑ Summary Type/Plugin/Unix.pm »