Showing 344 of 711 total issues
Method initialize
has a Cognitive Complexity of 43 (exceeds 8 allowed). Consider refactoring. Open
def initialize(_c, fs)
@networks = []
regHnd = RemoteRegistry.new(fs, true)
software_doc = regHnd.loadHive("software", [
- Read upRead up
- Create a ticketCreate a ticket
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 process_users_v
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_users_v(data)
bin = MSRegHive.regBinaryToRawBinary(data)
header_size = SIZEOF_SAM_STRUCT_USERS_V_HEADER
v = BinaryStruct.decode(bin[0...header_size], SAM_STRUCT_USERS_V_HEADER)
- Create a ticketCreate a ticket
Method fields
has a Cognitive Complexity of 39 (exceeds 8 allowed). Consider refactoring. Open
def fields
return @fields if @fields
return nil if @data.nil?
len = @data[0].ord
- Read upRead up
- Create a ticketCreate a ticket
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 initialize
has a Cognitive Complexity of 38 (exceeds 8 allowed). Consider refactoring. Open
def initialize(fs)
@userHash = {}
@usersByGid = Hash.new { |h, k| h[k] = [] }
@groups = []
- Read upRead up
- Create a ticketCreate a ticket
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
File MiqFS.rb
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'stringio'
require 'find'
require 'fs/MiqFS/FsProbe'
- Create a ticketCreate a ticket
Class Inode
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
class Inode
# Bits 0 to 8 of file mode.
PF_O_EXECUTE = 0x0001 # owner execute
PF_O_WRITE = 0x0002 # owner write
PF_O_READ = 0x0004 # owner read
- Create a ticketCreate a ticket
File inode.rb
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'fs/ext4/directory_entry'
require 'fs/ext4/extent'
require 'fs/ext4/extent_header'
require 'fs/ext4/extent_index'
- Create a ticketCreate a ticket
Method add_disk_stats
has a Cognitive Complexity of 36 (exceeds 8 allowed). Consider refactoring. Open
def add_disk_stats(xml, miqvm)
# Now loop over the xml and find disk files
xml.find_first("/*/hardware").each_recursive do |e|
# Find elements that have a filename attribute
# Loop through the "whole disks" and get the size for this disk
- Read upRead up
- Create a ticketCreate a ticket
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 findInEntries
has a Cognitive Complexity of 36 (exceeds 8 allowed). Consider refactoring. Open
def findInEntries(name, entries)
log_prefix = "MIQ(NTFS::IndexRoot.findInEntries)"
if @foundEntries.key?(name)
$log.debug "#{log_prefix} Found [#{name}] in #{entries.collect { |e| e.isLast? ? "**last**" : e.name.downcase }.inspect}" if DEBUG_TRACE_FIND
- Read upRead up
- Create a ticketCreate a ticket
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 readLog
has a Cognitive Complexity of 35 (exceeds 8 allowed). Consider refactoring. Open
def readLog(log, filter = nil)
filter ||= {}
EventLogFilter.prepare_filter!(filter)
# Get message source files. (This also caches the event log registry entries.)
- Read upRead up
- Create a ticketCreate a ticket
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 octal_to_permissions
has a Cognitive Complexity of 35 (exceeds 8 allowed). Consider refactoring. Open
def self.octal_to_permissions(octal, ftype = nil)
perms = ""
unless ftype.nil?
ftype = ftype[0, 1]
- Read upRead up
- Create a ticketCreate a ticket
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 initialize
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(_c, fs)
@users = []
@groups = []
# Extracted data also built into a human-readable format if uncommented
- Create a ticketCreate a ticket
Method postProcessDisks
has a Cognitive Complexity of 34 (exceeds 8 allowed). Consider refactoring. Open
def postProcessDisks
# Convert absolute paths to relative paths for the disks
if @direct_file_access
getAllDiskKeys.each do |dk|
next if @cfgHash[dk + ".devicetype"] && @cfgHash[dk + ".devicetype"].include?("cdrom")
- Read upRead up
- Create a ticketCreate a ticket
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 loadXmlData
has a Cognitive Complexity of 34 (exceeds 8 allowed). Consider refactoring. Open
def loadXmlData(filename, ost = nil)
# Make sure we have a valid openstruct handle and "from_time" is in a valid format
ost = OpenStruct.new if ost.nil?
# Check 'from_time' value and possible remove from the open struct
validate_from_time(ost)
- Read upRead up
- Create a ticketCreate a ticket
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 copyIn
has a Cognitive Complexity of 34 (exceeds 8 allowed). Consider refactoring. Open
def copyIn(from, to, recursive = false)
allTargets = []
from = [from] unless from.kind_of?(Array)
from.each { |t| allTargets.concat(Dir.glob(t)) }
- Read upRead up
- Create a ticketCreate a ticket
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 process_users_f
has a Cognitive Complexity of 33 (exceeds 8 allowed). Consider refactoring. Open
def process_users_f(data)
f = BinaryStruct.decode(MSRegHive.regBinaryToRawBinary(data), SAM_STRUCT_USERS_F)
@debug_str += " last_logon - %s - " % f['last_logon'].to_s if @debug_str
f['last_logon'] = process_users_f_date(f['last_logon'])
- Read upRead up
- Create a ticketCreate a ticket
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 each_record
has a Cognitive Complexity of 33 (exceeds 8 allowed). Consider refactoring. Open
def each_record(hdr, log)
# Check for an empty event log file
return if hdr[:oldest_record_number].zero?
last_pos = pos = getNextRecordOffset(nil, hdr)
- Read upRead up
- Create a ticketCreate a ticket
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 hostd_log_to_hashes
has a Cognitive Complexity of 33 (exceeds 8 allowed). Consider refactoring. Open
def hostd_log_to_hashes(log, filter = nil)
filter ||= {}
EventLogFilter.prepare_filter!(filter)
ret = []
- Read upRead up
- Create a ticketCreate a ticket
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 convert_vmsd
has a Cognitive Complexity of 32 (exceeds 8 allowed). Consider refactoring. Open
def convert_vmsd(f)
# Only read the enabled snapshots from the file and ignore the rest
numSnapshots = timeHigh = timeLow = nil
knownSnapshots = []
fileData = ""
- Read upRead up
- Create a ticketCreate a ticket
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
Class PEheader
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class PEheader
using ManageIQ::UnicodeString
IMAGE_NT_SIGNATURE = "PE\0\0"
IMAGE_DOS_SIGNATURE = "MZ"
- Create a ticketCreate a ticket