attr-encrypted/encryptor

View on GitHub

Showing 2 of 2 total issues

Method crypt has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def crypt(cipher_method, *args) #:nodoc:
options = default_options.merge(value: args.first).merge(args.last.is_a?(Hash) ? args.last : {})
raise ArgumentError.new('must specify a key') if options[:key].to_s.empty?
cipher = OpenSSL::Cipher.new(options[:algorithm])
cipher.send(cipher_method)
Severity: Minor
Found in lib/encryptor.rb - About 4 hrs to fix

Method crypt has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def crypt(cipher_method, *args) #:nodoc:
options = default_options.merge(value: args.first).merge(args.last.is_a?(Hash) ? args.last : {})
raise ArgumentError.new('must specify a key') if options[:key].to_s.empty?
cipher = OpenSSL::Cipher.new(options[:algorithm])
cipher.send(cipher_method)
Severity: Minor
Found in lib/encryptor.rb - About 1 hr to fix
    Severity
    Category
    Status
    Source
    Language