lib/argon2/ffi_engine.rb
Method hash_argon2id_encode
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def self.hash_argon2id_encode(password, salt, t_cost, m_cost, p_cost, secret)
Method hash_argon2id
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def self.hash_argon2id(password, salt, t_cost, m_cost, p_cost, out_len = nil)
Method hash_argon2id_encode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.hash_argon2id_encode(password, salt, t_cost, m_cost, p_cost, secret)
result = ''
secretlen = secret.nil? ? 0 : secret.bytesize
passwordlen = password.nil? ? 0 : password.bytesize
raise ArgonHashFail, "Invalid salt size" if salt.length != Constants::SALT_LEN
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method hash_argon2i
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def self.hash_argon2i(password, salt, t_cost, m_cost, out_len = nil)
Method argon2_verify
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.argon2_verify(pwd, hash, secret)
secretlen = secret.nil? ? 0 : secret.bytesize
passwordlen = pwd.nil? ? 0 : pwd.bytesize
ret = Ext.wrap_argon2_verify(hash, pwd, passwordlen, secret, secretlen)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"