lib/nstrct/argument.rb
Method pack_value
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def pack_value(datatype, value, data)
case datatype
when :boolean
data += [to_boolean(value) ? 1 : 0].pack('C')
when :int8
Method parse_value
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.parse_value(datatype, data)
case datatype
when :boolean
return data.slice!(0).unpack('C')[0] == 1
when :int8
Avoid too many return
statements within this method. Open
Open
return length > 0 ? data.slice!(0..length - 1) : ''
Avoid too many return
statements within this method. Open
Open
return data.slice!(0..1).unpack('S>')[0]
Avoid too many return
statements within this method. Open
Open
return data.slice!(0..3).unpack('L>')[0]
Avoid too many return
statements within this method. Open
Open
return data.slice!(0..7).unpack('Q>')[0]
Avoid too many return
statements within this method. Open
Open
return data.slice!(0).unpack('C')[0]
Avoid too many return
statements within this method. Open
Open
return data.slice!(0..7).unpack('G')[0]
Avoid too many return
statements within this method. Open
Open
return data.slice!(0..7).unpack('q>')[0]
Avoid too many return
statements within this method. Open
Open
return data.slice!(0..3).unpack('g')[0]