jwt/ruby-jwe

View on GitHub

Showing 10 of 10 total issues

Method encode has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def self.encode(header, encrypted_cek, iv, ciphertext, tag)
Severity: Minor
Found in lib/jwe/serialization/compact.rb - About 35 mins to fix

    Method JWE::Enc::AesGcm#iv is defined at both lib/jwe/enc/aes_gcm.rb:8 and lib/jwe/enc/aes_gcm.rb:43.
    Open

          def iv
    Severity: Minor
    Found in lib/jwe/enc/aes_gcm.rb by rubocop

    This cop checks for duplicated instance (or singleton) method definitions.

    Example:

    # bad
    
    def duplicated
      1
    end
    
    def duplicated
      2
    end

    Example:

    # bad
    
    def duplicated
      1
    end
    
    alias duplicated other_duplicated

    Example:

    # good
    
    def duplicated
      1
    end
    
    def other_duplicated
      2
    end

    Method JWE::Enc::AesCbcHs#cek is defined at both lib/jwe/enc/aes_cbc_hs.rb:7 and lib/jwe/enc/aes_cbc_hs.rb:60.
    Open

          def cek
    Severity: Minor
    Found in lib/jwe/enc/aes_cbc_hs.rb by rubocop

    This cop checks for duplicated instance (or singleton) method definitions.

    Example:

    # bad
    
    def duplicated
      1
    end
    
    def duplicated
      2
    end

    Example:

    # bad
    
    def duplicated
      1
    end
    
    alias duplicated other_duplicated

    Example:

    # good
    
    def duplicated
      1
    end
    
    def other_duplicated
      2
    end

    required_ruby_version (2.0, declared in jwe.gemspec) and TargetRubyVersion (2.1, declared in .rubocop.yml) should be equal.
    Open

      s.required_ruby_version = '>= 2.0.0'
    Severity: Minor
    Found in jwe.gemspec by rubocop

    Checks that required_ruby_version of gemspec and TargetRubyVersion of .rubocop.yml are equal. Thereby, RuboCop to perform static analysis working on the version required by gemspec.

    Example:

    # When `TargetRubyVersion` of .rubocop.yml is `2.3`.
    
    # bad
    Gem::Specification.new do |spec|
      spec.required_ruby_version = '>= 2.2.0'
    end
    
    # bad
    Gem::Specification.new do |spec|
      spec.required_ruby_version = '>= 2.4.0'
    end
    
    # good
    Gem::Specification.new do |spec|
      spec.required_ruby_version = '>= 2.3.0'
    end
    
    # good
    Gem::Specification.new do |spec|
      spec.required_ruby_version = '>= 2.3'
    end
    
    # good
    Gem::Specification.new do |spec|
      spec.required_ruby_version = ['>= 2.3.0', '< 2.5.0']
    end

    Method JWE::Enc::AesCbcHs#iv is defined at both lib/jwe/enc/aes_cbc_hs.rb:8 and lib/jwe/enc/aes_cbc_hs.rb:56.
    Open

          def iv
    Severity: Minor
    Found in lib/jwe/enc/aes_cbc_hs.rb by rubocop

    This cop checks for duplicated instance (or singleton) method definitions.

    Example:

    # bad
    
    def duplicated
      1
    end
    
    def duplicated
      2
    end

    Example:

    # bad
    
    def duplicated
      1
    end
    
    alias duplicated other_duplicated

    Example:

    # good
    
    def duplicated
      1
    end
    
    def other_duplicated
      2
    end

    Dependencies should be sorted in an alphabetical order within their section of the gemspec. Dependency rake should appear before rspec.
    Open

      s.add_development_dependency 'rake'
    Severity: Minor
    Found in jwe.gemspec by rubocop

    Dependencies in the gemspec should be alphabetically sorted.

    Example:

    # bad
    spec.add_dependency 'rubocop'
    spec.add_dependency 'rspec'
    
    # good
    spec.add_dependency 'rspec'
    spec.add_dependency 'rubocop'
    
    # good
    spec.add_dependency 'rubocop'
    
    spec.add_dependency 'rspec'
    
    # bad
    spec.add_development_dependency 'rubocop'
    spec.add_development_dependency 'rspec'
    
    # good
    spec.add_development_dependency 'rspec'
    spec.add_development_dependency 'rubocop'
    
    # good
    spec.add_development_dependency 'rubocop'
    
    spec.add_development_dependency 'rspec'
    
    # bad
    spec.add_runtime_dependency 'rubocop'
    spec.add_runtime_dependency 'rspec'
    
    # good
    spec.add_runtime_dependency 'rspec'
    spec.add_runtime_dependency 'rubocop'
    
    # good
    spec.add_runtime_dependency 'rubocop'
    
    spec.add_runtime_dependency 'rspec'
    
    # good only if TreatCommentsAsGroupSeparators is true
    # For code quality
    spec.add_dependency 'rubocop'
    # For tests
    spec.add_dependency 'rspec'

    Method JWE::Enc::AesGcm#cek is defined at both lib/jwe/enc/aes_gcm.rb:7 and lib/jwe/enc/aes_gcm.rb:47.
    Open

          def cek
    Severity: Minor
    Found in lib/jwe/enc/aes_gcm.rb by rubocop

    This cop checks for duplicated instance (or singleton) method definitions.

    Example:

    # bad
    
    def duplicated
      1
    end
    
    def duplicated
      2
    end

    Example:

    # bad
    
    def duplicated
      1
    end
    
    alias duplicated other_duplicated

    Example:

    # good
    
    def duplicated
      1
    end
    
    def other_duplicated
      2
    end

    Method JWE::Enc::AesGcm#tag is defined at both lib/jwe/enc/aes_gcm.rb:9 and lib/jwe/enc/aes_gcm.rb:55.
    Open

          def tag
    Severity: Minor
    Found in lib/jwe/enc/aes_gcm.rb by rubocop

    This cop checks for duplicated instance (or singleton) method definitions.

    Example:

    # bad
    
    def duplicated
      1
    end
    
    def duplicated
      2
    end

    Example:

    # bad
    
    def duplicated
      1
    end
    
    alias duplicated other_duplicated

    Example:

    # good
    
    def duplicated
      1
    end
    
    def other_duplicated
      2
    end

    Method JWE::Enc::AesCbcHs#tag is defined at both lib/jwe/enc/aes_cbc_hs.rb:9 and lib/jwe/enc/aes_cbc_hs.rb:76.
    Open

          def tag
    Severity: Minor
    Found in lib/jwe/enc/aes_cbc_hs.rb by rubocop

    This cop checks for duplicated instance (or singleton) method definitions.

    Example:

    # bad
    
    def duplicated
      1
    end
    
    def duplicated
      2
    end

    Example:

    # bad
    
    def duplicated
      1
    end
    
    alias duplicated other_duplicated

    Example:

    # good
    
    def duplicated
      1
    end
    
    def other_duplicated
      2
    end

    Dependencies should be sorted in an alphabetical order within their section of the gemspec. Dependency codeclimate-test-reporter should appear before simplecov.
    Open

      s.add_development_dependency 'codeclimate-test-reporter'
    Severity: Minor
    Found in jwe.gemspec by rubocop

    Dependencies in the gemspec should be alphabetically sorted.

    Example:

    # bad
    spec.add_dependency 'rubocop'
    spec.add_dependency 'rspec'
    
    # good
    spec.add_dependency 'rspec'
    spec.add_dependency 'rubocop'
    
    # good
    spec.add_dependency 'rubocop'
    
    spec.add_dependency 'rspec'
    
    # bad
    spec.add_development_dependency 'rubocop'
    spec.add_development_dependency 'rspec'
    
    # good
    spec.add_development_dependency 'rspec'
    spec.add_development_dependency 'rubocop'
    
    # good
    spec.add_development_dependency 'rubocop'
    
    spec.add_development_dependency 'rspec'
    
    # bad
    spec.add_runtime_dependency 'rubocop'
    spec.add_runtime_dependency 'rspec'
    
    # good
    spec.add_runtime_dependency 'rspec'
    spec.add_runtime_dependency 'rubocop'
    
    # good
    spec.add_runtime_dependency 'rubocop'
    
    spec.add_runtime_dependency 'rspec'
    
    # good only if TreatCommentsAsGroupSeparators is true
    # For code quality
    spec.add_dependency 'rubocop'
    # For tests
    spec.add_dependency 'rspec'
    Severity
    Category
    Status
    Source
    Language