Meet SourceLevel, your automatic code reviewer

SourceLevel does continuous static analysis of your GitHub repositories and delivers it straight to your Pull Requests

Get started for free

Great, lib/jwt/claims_validator.rb does not have any issues!

Go to line 1
require_relative './error'
Go to line 3
module JWT
Go to line 4
  class ClaimsValidator
Go to line 5
    NUMERIC_CLAIMS = %i[
Go to line 11
    def initialize(payload)
Go to line 12
      @payload = payload.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
Go to line 15
    def validate!
Go to line 16
      validate_numeric_claims
Go to line 23
    def validate_numeric_claims
Go to line 24
      NUMERIC_CLAIMS.each do |claim|
Go to line 25
        validate_is_numeric(claim) if @payload.key?(claim)
Go to line 29
    def validate_is_numeric(claim)
Go to line 30
      return if @payload[claim].is_a?(Numeric)
Go to line 32
      raise InvalidPayload, "#{claim} claim must be a Numeric value but it is a #{@payload[claim].class}"