Branch Coverage

blib/lib/Dancer2/Plugin/OAuth2/Server/Simple.pm
Criterion Covered Total %
branch 27 40 67.5


line true false branch
32 6 1 if (my $client = $self->_get_clients($dsl, $settings)->{$client_id})
36 1 6 if (not exists $self->_get_clients($dsl, $settings)->{$client_id}{'scopes'}{$scope}) { }
1 5 elsif (not $self->_get_clients($dsl, $settings)->{$client_id}{'scopes'}{$scope}) { }
107 1 7 if ($is_refresh_token and exists $REFRESH_TOKENS{$access_token}) { }
7 0 elsif (exists $ACCESS_TOKENS{$access_token}) { }
112 1 0 if ($scopes_ref)
114 0 0 unless (exists $REFRESH_TOKENS{$access_token}{'scope'}{$scope} and $REFRESH_TOKENS{$access_token}{'scope'}{$scope})
128 0 7 if ($ACCESS_TOKENS{$access_token}{'expires'} <= time) { }
7 0 elsif ($scopes_ref) { }
135 2 5 unless (exists $ACCESS_TOKENS{$access_token}{'scope'}{$scope} and $ACCESS_TOKENS{$access_token}{'scope'}{$scope})
165 1 4 if (not exists $AUTH_CODES{$auth_code} && exists $self->_get_clients($dsl, $settings)->{$client_id} or $client_secret ne $self->_get_clients($dsl, $settings)->{$client_id}{'client_secret'} or $AUTH_CODES{$auth_code}{'access_token'} or $uri and $AUTH_CODES{$auth_code}{'redirect_uri'} ne $uri or $AUTH_CODES{$auth_code}{'expires'} <= time) { }
175 0 1 unless exists $AUTH_CODES{$auth_code}
177 0 1 unless exists $self->_get_clients($dsl, $settings)->{$client_id}
183 0 1 if not $client_secret && $self->_get_clients($dsl, $settings)->{$client_id} or $client_secret ne $self->_get_clients($dsl, $settings)->{$client_id}{'client_secret'}
185 1 0 if ($AUTH_CODES{$auth_code})
187 0 1 if $uri and $AUTH_CODES{$auth_code}{'redirect_uri'} ne $uri
189 0 1 if $AUTH_CODES{$auth_code}{'expires'} <= time
192 1 0 if (my $access_token = $AUTH_CODES{$auth_code}{'access_token'})
216 1 4 if (not defined $auth_code and $old_refresh_token)
233 1 4 if $old_refresh_token