| Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Role/Matcher/Child/Exists/Any/File.pm |
| Statements | Executed 346 statements in 774µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 74 | 8 | 8 | 502µs | 10.6ms | Path::IsDev::Role::Matcher::Child::Exists::Any::File::child_exists_any_file |
| 1 | 1 | 1 | 15µs | 15µs | Role::Tiny::BEGIN@1.29 |
| 1 | 1 | 1 | 7µs | 8µs | Role::Tiny::BEGIN@4.32 |
| 1 | 1 | 1 | 7µs | 78µs | Path::IsDev::Role::Matcher::Child::Exists::Any::File::BEGIN@24 |
| 1 | 1 | 1 | 7µs | 10µs | Role::Tiny::BEGIN@3.31 |
| 1 | 1 | 1 | 6µs | 18µs | Role::Tiny::BEGIN@2.30 |
| 0 | 0 | 0 | 0s | 0s | Path::IsDev::Role::Matcher::Child::Exists::Any::File::child_exists_file |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | 2 | 35µs | 1 | 15µs | # spent 15µs within Role::Tiny::BEGIN@1.29 which was called:
# once (15µs+0s) by Role::Tiny::_load_module at line 1 # spent 15µs making 1 call to Role::Tiny::BEGIN@1.29 |
| 2 | 2 | 18µs | 2 | 28µs | # spent 18µs (6+11) within Role::Tiny::BEGIN@2.30 which was called:
# once (6µs+11µs) by Role::Tiny::_load_module at line 2 # spent 18µs making 1 call to Role::Tiny::BEGIN@2.30
# spent 11µs making 1 call to strict::import |
| 3 | 2 | 21µs | 2 | 14µs | # spent 10µs (7+4) within Role::Tiny::BEGIN@3.31 which was called:
# once (7µs+4µs) by Role::Tiny::_load_module at line 3 # spent 10µs making 1 call to Role::Tiny::BEGIN@3.31
# spent 4µs making 1 call to warnings::import |
| 4 | 2 | 53µs | 2 | 10µs | # spent 8µs (7+2) within Role::Tiny::BEGIN@4.32 which was called:
# once (7µs+2µs) by Role::Tiny::_load_module at line 4 # spent 8µs making 1 call to Role::Tiny::BEGIN@4.32
# spent 2µs making 1 call to utf8::import |
| 5 | |||||
| 6 | package Path::IsDev::Role::Matcher::Child::Exists::Any::File; | ||||
| 7 | 1 | 600ns | $Path::IsDev::Role::Matcher::Child::Exists::Any::File::VERSION = '1.001000'; | ||
| 8 | # ABSTRACT: Match if a path contains one of any of a list of files | ||||
| 9 | |||||
| 10 | 1 | 200ns | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | ||
| 11 | |||||
| - - | |||||
| 24 | 2 | 208µs | 2 | 150µs | # spent 78µs (7+71) within Path::IsDev::Role::Matcher::Child::Exists::Any::File::BEGIN@24 which was called:
# once (7µs+71µs) by Role::Tiny::_load_module at line 24 # spent 78µs making 1 call to Path::IsDev::Role::Matcher::Child::Exists::Any::File::BEGIN@24
# spent 71µs making 1 call to Role::Tiny::import |
| 25 | 1 | 2µs | 1 | 650µs | with 'Path::IsDev::Role::Matcher::Child::Exists::Any'; # spent 650µs making 1 call to Role::Tiny::__ANON__[Role/Tiny.pm:67] |
| 26 | |||||
| - - | |||||
| 35 | sub child_exists_file { | ||||
| 36 | my ( $self, $result_object, $child ) = @_; | ||||
| 37 | |||||
| 38 | my $child_path = $result_object->path->child($child); | ||||
| 39 | my $ctx = { 'child_name' => $child, child_path => "$child_path", tests => [] }; | ||||
| 40 | my $tests = $ctx->{tests}; | ||||
| 41 | |||||
| 42 | # For now, yes, files, not things usable as files | ||||
| 43 | ## no critic (ValuesAndExpressions::ProhibitFiletest_f) | ||||
| 44 | if ( -f $child_path ) { | ||||
| 45 | push @{$tests}, { 'child_path_isfile?' => 1 }; | ||||
| 46 | $result_object->add_reason( $self, 1, "$child_path is a file", $ctx ); | ||||
| 47 | return 1; | ||||
| 48 | } | ||||
| 49 | push @{$tests}, { 'child_path_isfile?' => 1 }; | ||||
| 50 | $result_object->add_reason( $self, 0, "$child_path is not a file", $ctx ); | ||||
| 51 | |||||
| 52 | return; | ||||
| 53 | } | ||||
| 54 | |||||
| - - | |||||
| 63 | # spent 10.6ms (502µs+10.1) within Path::IsDev::Role::Matcher::Child::Exists::Any::File::child_exists_any_file which was called 74 times, avg 143µs/call:
# 11 times (64µs+1.17ms) by Path::IsDev::NegativeHeuristic::IsDev::IgnoreFile::excludes at line 72 of Path/IsDev/NegativeHeuristic/IsDev/IgnoreFile.pm, avg 112µs/call
# 9 times (100µs+2.44ms) by Path::IsDev::Heuristic::Makefile::matches at line 52 of Path/IsDev/Heuristic/Makefile.pm, avg 282µs/call
# 9 times (75µs+1.63ms) by Path::IsDev::Heuristic::MYMETA::matches at line 60 of Path/IsDev/Heuristic/MYMETA.pm, avg 189µs/call
# 9 times (71µs+1.54ms) by Path::IsDev::Heuristic::META::matches at line 51 of Path/IsDev/Heuristic/META.pm, avg 179µs/call
# 9 times (50µs+863µs) by Path::IsDev::Heuristic::Tool::Dzil::matches at line 48 of Path/IsDev/Heuristic/Tool/Dzil.pm, avg 102µs/call
# 9 times (49µs+833µs) by Path::IsDev::Heuristic::DevDirMarker::matches at line 63 of Path/IsDev/Heuristic/DevDirMarker.pm, avg 98µs/call
# 9 times (46µs+802µs) by Path::IsDev::Heuristic::Tool::ModuleBuild::matches at line 48 of Path/IsDev/Heuristic/Tool/ModuleBuild.pm, avg 94µs/call
# 9 times (46µs+792µs) by Path::IsDev::Heuristic::Tool::MakeMaker::matches at line 48 of Path/IsDev/Heuristic/Tool/MakeMaker.pm, avg 93µs/call | ||||
| 64 | 74 | 51µs | my ( $self, $result_object, @children ) = @_; | ||
| 65 | 74 | 32µs | for my $child (@children) { | ||
| 66 | 110 | 173µs | 110 | 10.1ms | return 1 if $self->child_exists( $result_object, $child ) and $self->child_exists_file( $result_object, $child ); # spent 10.1ms making 110 calls to Path::IsDev::Role::Matcher::Child::Exists::Any::child_exists, avg 92µs/call |
| 67 | } | ||||
| 68 | 74 | 177µs | return; | ||
| 69 | } | ||||
| 70 | |||||
| 71 | 1 | 3µs | 1; | ||
| 72 | |||||
| 73 | __END__ |