Showing 1,243 of 1,244 total issues
MetasmUtils#self.is_looping performs a nil-check Open
return result if di.block.to_normal.nil?
- Read upRead up
- Exclude checks
A NilCheck
is a type check. Failures of NilCheck
violate the "tell, don't ask" principle.
Additionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.
Example
Given
class Klass
def nil_checker(argument)
if argument.nil?
puts "argument isn't nil!"
end
end
end
Reek would emit the following warning:
test.rb -- 1 warning:
[3]:Klass#nil_checker performs a nil-check. (NilCheck)
isStartFunction doesn't depend on instance state (maybe move it to another class?) Open
def isStartFunction(addr)
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
AddTagFunction performs a nil-check Open
if @tbFuncName[funcaddr].nil?
- Read upRead up
- Exclude checks
A NilCheck
is a type check. Failures of NilCheck
violate the "tell, don't ask" principle.
Additionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.
Example
Given
class Klass
def nil_checker(argument)
if argument.nil?
puts "argument isn't nil!"
end
end
end
Reek would emit the following warning:
test.rb -- 1 warning:
[3]:Klass#nil_checker performs a nil-check. (NilCheck)
parse_some_string performs a nil-check Open
basefunc = 0 if basefunc.nil?
- Read upRead up
- Exclude checks
A NilCheck
is a type check. Failures of NilCheck
violate the "tell, don't ask" principle.
Additionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.
Example
Given
class Klass
def nil_checker(argument)
if argument.nil?
puts "argument isn't nil!"
end
end
end
Reek would emit the following warning:
test.rb -- 1 warning:
[3]:Klass#nil_checker performs a nil-check. (NilCheck)
parse_calls doesn't depend on instance state (maybe move it to another class?) Open
def parse_calls(datas, regexp)
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
MurmurHash#self.murmur3_32_rotl has the parameter name 'x' Open
def self.murmur3_32_rotl(x, r)
- Read upRead up
- Exclude checks
An Uncommunicative Parameter Name
is a parameter name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
MachocHash has the variable name '@fullFuncSign' Open
@fullFuncSign = ''
@fullHashSign = ''
@listoffunct = []
dasm.function.each do |addr, _symb|
@listoffunct << addr if addr.to_s =~ /^[0-9]+$/
- Read upRead up
- Exclude checks
An Uncommunicative Variable Name
is a variable name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
MurmurHash#self.murmur3_32_str_hash has the variable name 'h1' Open
h1 = seed
numbers = str.unpack('V*C*')
tailn = str.bytesize % 4
tail = numbers.slice!(numbers.size - tailn, tailn)
for k1 in numbers
- Read upRead up
- Exclude checks
An Uncommunicative Variable Name
is a variable name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
calculateSizeSubCallTree has the variable name 'i' Open
i = 0
total = 1
return total if indent.length > 5
getToFunc(fromaddr).each do |tdi_addr|
next unless isFuncTreeLink(tdi_addr, toaddr)
- Read upRead up
- Exclude checks
An Uncommunicative Variable Name
is a variable name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
AddTagFunction has the name 'AddTagFunction' Open
def AddTagFunction(funcaddr, tagname)
- Read upRead up
- Exclude checks
An Uncommunicative Method Name
is a method name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
MetasmUtils#self.getArg has the name 'getArg' Open
def self.getArg(addrori, arg)
- Read upRead up
- Exclude checks
An Uncommunicative Method Name
is a method name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
checkCall has the name 'checkCall' Open
def checkCall(strFunc, xrefCall)
- Read upRead up
- Exclude checks
An Uncommunicative Method Name
is a method name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
checkCall has the variable name 'cfunctionDecoder' Open
cfunctionDecoder = @functionsDecoders[strFunc]
- Read upRead up
- Exclude checks
An Uncommunicative Variable Name
is a variable name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
getFromFunc has the name 'getFromFunc' Open
def getFromFunc(addressFunc)
- Read upRead up
- Exclude checks
An Uncommunicative Method Name
is a method name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
MachocHash#self.calculate_machoc_hash has the variable name 'b' Open
@treefunc.each do |b|
- Read upRead up
- Exclude checks
An Uncommunicative Variable Name
is a variable name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
getFromFunc has the parameter name 'addressFunc' Open
def getFromFunc(addressFunc)
- Read upRead up
- Exclude checks
An Uncommunicative Parameter Name
is a parameter name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
MetasmUtils#self.getArg has the variable name 'i' Open
i = di.block.list.length
while i > 0
if di.block.list[i - 1].address == addrori
i -= 1
while i > 0
- Read upRead up
- Exclude checks
An Uncommunicative Variable Name
is a variable name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
MurmurHash#self.murmur3_32_fmix has the parameter name 'h' Open
def self.murmur3_32_fmix(h)
- Read upRead up
- Exclude checks
An Uncommunicative Parameter Name
is a parameter name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
MurmurHash#self.murmur3_32_fmix has the variable name 'h' Open
h &= MASK32
h ^= h >> 16
h = (h * 0x85ebca6b) & MASK32
h ^= h >> 13
h = (h * 0xc2b2ae35) & MASK32
- Read upRead up
- Exclude checks
An Uncommunicative Variable Name
is a variable name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.
printCallTree has the variable name 'i' Open
i = 0
@glinestree = 9999
log('')
log('Call tree from entry point to function :')
log('')
- Read upRead up
- Exclude checks
An Uncommunicative Variable Name
is a variable name that doesn't communicate its intent well enough.
Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.