library/rubygems/package/tar_test_case.rb
Method assert_headers_equal
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def assert_headers_equal(expected, actual)
expected = expected.to_s unless String === expected
actual = actual.to_s unless String === actual
fields = %w[
Method header
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def header(type, fname, dname, length, mode, mtime, checksum = nil, linkname = "")
checksum ||= " " * 8
arr = [ # struct tarfile_entry_posix
ASCIIZ(fname, 100), # char name[100]; ASCII + (Z unless filled)
Method header
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def header(type, fname, dname, length, mode, mtime, checksum = nil, linkname = "")
Method assert_headers_equal
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def assert_headers_equal(expected, actual)
expected = expected.to_s unless String === expected
actual = actual.to_s unless String === actual
fields = %w[
- 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 tar_symlink_header
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def tar_symlink_header(fname, prefix, mode, mtime, linkname)
Method tar_file_header
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def tar_file_header(fname, dname, mode, length, mtime)