File Coverage

blib/lib/App/cpanm/meta/checker/State/Duplicates.pm
Criterion Covered Total %
statement 18 33 54.5
branch 0 10 0.0
condition n/a
subroutine 6 11 54.5
pod 4 4 100.0
total 28 58 48.2


line stmt bran cond sub pod time code
1 3     3   1133 use 5.008; # utf8
  3         15  
  3         112  
2 3     3   16 use strict;
  3         7  
  3         102  
3 3     3   18 use warnings;
  3         6  
  3         96  
4 3     3   864 use utf8;
  3         22  
  3         21  
5              
6             package App::cpanm::meta::checker::State::Duplicates;
7             $App::cpanm::meta::checker::State::Duplicates::VERSION = '0.001001';
8             # ABSTRACT: Data tracking for duplicate distribution meta-data
9              
10             our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
11              
12 3     3   1062 use Moo qw( has );
  3         15202  
  3         41  
13 3     3   4194 use App::cpanm::meta::checker::State::Duplicates::Dist;
  3         11  
  3         1444  
14              
15              
16              
17              
18              
19             has 'dists' => (
20             is => ro =>,
21             lazy => 1,
22 0     0     builder => sub { {} },
23             );
24              
25              
26              
27              
28              
29              
30              
31             sub seen_dist_version {
32 0     0 1   my ( $self, $dist, $version ) = @_;
33 0 0         if ( not exists $self->dists->{$dist} ) {
34 0           $self->dists->{$dist} = App::cpanm::meta::checker::State::Duplicates::Dist->new();
35             }
36 0           return $self->dists->{$dist}->seen_version($version);
37             }
38              
39              
40              
41              
42              
43              
44              
45              
46              
47             sub has_duplicates {
48 0     0 1   my ( $self, $dist ) = @_;
49 0 0         return unless exists $self->dists->{$dist};
50 0           return $self->dists->{$dist}->has_duplicates;
51             }
52              
53              
54              
55              
56              
57              
58              
59              
60              
61              
62             sub reported_duplicates {
63 0     0 1   my ( $self, $dist, $set_reported ) = @_;
64 0 0         return unless exists $self->dists->{$dist};
65 0 0         return $self->dists->{$dist}->reported($set_reported) if @_ > 2;
66 0           return $self->dists->{$dist}->reported();
67             }
68              
69              
70              
71              
72              
73              
74              
75              
76              
77             sub duplicate_versions {
78 0     0 1   my ( $self, $dist ) = @_;
79 0 0         return unless exists $self->dists->{$dist};
80 0           return $self->dists->{$dist}->duplicate_versions;
81             }
82              
83             1;
84              
85             __END__