Showing 10 of 27 total issues
File enum.rb
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'ffi'
module FFI
module VixDiskLib
module API
File api_wrapper.rb
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'ffi-vix_disk_lib'
require 'logger'
require 'ffi-vix_disk_lib/safe_connect_params'
require 'ffi-vix_disk_lib/safe_create_params'
require 'ffi-vix_disk_lib/disk_info'
File api.rb
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'ffi'
module FFI
module VixDiskLib
module API
Method clone
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.clone(dest_connection, dest_path, src_connection, src_path, create_parms, over_write)
Method initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(in_create_parms)
create_parms = FFI::MemoryPointer.new(VixDiskLib::CreateParams, 1, true)
create_parms_start = create_parms
disk_type = in_create_parms[:diskType]
create_parms = create_parms_start + VixDiskLib::CreateParams.offset_of(:diskType)
- 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 init_ex
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.init_ex(info_logger = nil, warn_logger = nil, error_logger = nil, libDir = nil, configFile = nil)
Method create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.create(connection, path, create_parms, prog_func = nil, prog_callback_data = nil)
Method create_child
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.create_child(disk_handle, child_path, disk_type, prog_func = nil, prog_callback_data = nil)
Method initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(in_conn_parms)
conn_parms = FFI::MemoryPointer.new(API::ConnectParams, 1, true)
@connect_params = conn_parms
set_param(in_conn_parms, :vmxSpec)
# Increment structure pointer to server_name
- 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 read
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.read(ffi_connect_parms)
out_connect_parms = {}
spec_ptr = ffi_connect_parms.get_pointer(API::ConnectParams.offset_of(:vmxSpec))
out_connect_parms[:vmxSpec] = spec_ptr.read_string unless spec_ptr.null?
serv_ptr = ffi_connect_parms.get_pointer(API::ConnectParams.offset_of(:serverName))
- 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"