Showing 4 of 6 total issues
File macho.rb
has 463 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require_relative 'io_helpers'
require_relative 'apple_code_signature'
# Note this implementation only works with little-endian mach-o binaries
# such as ARM and X86. Older PPC mach-o files are big-endian. Support could
Class IPA
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class IPA
class ZipExtractError < StandardError
end
SYSTEM_HAS_UNZIP = system("which unzip > /dev/null")
Method each_executable_entry
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
def each_executable_entry
each_file_entry do |entry|
next if (zipstream = entry.get_input_stream).nil?
next if (magicbytes = zipstream.read(4)).nil?
next if (magic = magicbytes.unpack("N").first).nil?
- 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 parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.parse(data)
obj = data.is_a?(StringStream)? data : StringStream.new(data)
magic = obj.read_uint32
n=FADEMAGIC[magic]
if n.nil? and ((magic >> 16) == 0xFADE)
- 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"