Conformance/Check/ClaudeMd.pm

filter: Statementstmt 51.8% 14 / 27 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 62.5% 5 / 8 Podpod 100% 3 / 3 totaltotal 44.9% 22 / 49 CC 6 SCAR 22.5
CC
6
Cov
38%
check
20.0
update
12.0
config_schema
2.0
CRAP 9.5
« Conformance/Snapshot/Directory.pm ↑ Summary Conformance/Schema.pm »
1 package Dist::Conformance::Check::ClaudeMd 0.006;
2  
3 # ABSTRACT: CLAUDE.md exists and names the skills that it must
4  
5 1 ▶use 5.040;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use re '/aasx';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Mojo::Base 'Dist::Conformance::Check', -signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Dist::Conformance::Schema();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12  
13 0 ▶sub config_schema ($) {
Subroutine config_schema: not called CC=1 SCAR=6.9
Pod documented
14 return {
15 0 required => [qw{file mentions}],
16 properties => {
17 file => $Dist::Conformance::Schema::PATH,
18 mentions => { type => 'array', items => { type => 'string', minLength => 1 } },
19 template => $Dist::Conformance::Schema::PATH,
20 },
21 };
22 }
23  
24  
25 0 ▶sub check ( $self, $snapshot ) {
Subroutine check: not called CC=4 SCAR=30.0
Pod documented
26 0 my ( $file, $mentions ) = @{ $self->config }{qw{file mentions}};
27 0 ▶ my $text = $snapshot->content($file) // return ( 'fail', "$file is missing" );
Condition0%0/2
$snapshot->content($file) // (return "fail", "$file is missing")
l!l
00
MC/DC0%0/1
$snapshot->content($file) // (return "fail", "$file is missing")
$snapshot->content($file)
Truth table0%0/2
A
A= $snapshot->content($file)
Aresult
11
00
28 0 my @absent = grep { index( $text, $_ ) < 0 } @$mentions;
29 0 ▶ return ( 'fail', "$file does not name " . join ', ', @absent ) if @absent;
Branch: 1 branch
BranchTrueFalseTotal
if @absent 0 0 0
30 0 ▶ return ( 'pass', @$mentions ? 'names ' . join ', ', @$mentions : "$file exists" );
Branch: 1 branch
BranchTrueFalseTotal
@$mentions ? : 0 0 0
31 }
32  
33  
34 0 ▶sub update ( $self, $update ) {
Subroutine update: not called CC=3 SCAR=24.8
Pod documented
35 0 my ( $status, $detail ) = $self->check( $update->snapshot );
36 0 ▶ return if $status ne 'fail';
Branch: 1 branch
BranchTrueFalseTotal
if $status ne "fail" 0 0 0
37 0 ▶ my $start = defined $self->config->{template} ? ', starting from ' . $self->config->{template} : q{};
Branch: 1 branch
BranchTrueFalseTotal
defined $self->config->{'template'} ? : 0 0 0
38 0 $update->by_hand("$detail: write it by hand$start, because its prose cannot be generated");
39 0 return;
40 }
41  
42 __END__
« Conformance/Snapshot/Directory.pm ↑ Summary Conformance/Schema.pm »