ManageIQ/ffi-vix_disk_lib

View on GitHub

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
Severity: Minor
Found in lib/ffi-vix_disk_lib/enum.rb - About 3 hrs to fix

    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'
    Severity: Minor
    Found in lib/ffi-vix_disk_lib/api_wrapper.rb - About 3 hrs to fix

      File api.rb has 292 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'ffi'
      
      module FFI
        module VixDiskLib
          module API
      Severity: Minor
      Found in lib/ffi-vix_disk_lib/api.rb - About 3 hrs to fix

        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)
        Severity: Minor
        Found in lib/ffi-vix_disk_lib/api_wrapper.rb - About 45 mins to fix

          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)
          Severity: Minor
          Found in lib/ffi-vix_disk_lib/safe_create_params.rb - About 45 mins to fix

          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)
          Severity: Minor
          Found in lib/ffi-vix_disk_lib/api_wrapper.rb - About 35 mins to fix

            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)
            Severity: Minor
            Found in lib/ffi-vix_disk_lib/api_wrapper.rb - About 35 mins to fix

              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)
              Severity: Minor
              Found in lib/ffi-vix_disk_lib/api_wrapper.rb - About 35 mins to fix

                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
                Severity: Minor
                Found in lib/ffi-vix_disk_lib/safe_connect_params.rb - About 35 mins to fix

                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))
                Severity: Minor
                Found in lib/ffi-vix_disk_lib/safe_connect_params.rb - About 25 mins to fix

                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

                Severity
                Category
                Status
                Source
                Language