Showing 217 of 217 total issues
File xml_hash.rb
has 461 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rexml/document'require 'active_support/core_ext/hash/keys' module XmlHash class Element < Hash
- Create a ticketCreate a ticket
Class MiqGenericMountSession
has 45 methods (exceeds 20 allowed). Consider refactoring. Open
class MiqGenericMountSession < MiqFileStorage::Interface class NoSuchFileOrDirectory < RuntimeError; end class << self def run_command(command, args)
- Create a ticketCreate a ticket
Method disk_usage
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def self.disk_usage(file = nil) file = normalize_df_file_argument(file) case Sys::Platform::IMPL when :linux
- Read upRead up
- Create a ticketCreate a ticket
Class Element
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
class Element < Hash include Enumerable def initialize(name, attrs = {}, parent = nil) super()
- Create a ticketCreate a ticket
File miq_generic_mount_session.rb
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_support/core_ext/object/blank'require 'fileutils'require 'logger'require 'sys-uname'require 'uri'
- Create a ticketCreate a ticket
Method miq_patch_elements
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def miq_patch_elements(xml, patch, node, direction, stats) miq_patch_element_logging(node, direction) patch.root.elements[node.to_s].each_element do |e| path = e.elements['path'].elements[1] data = e.elements['data'].elements[1]
- Read upRead up
- Create a ticketCreate a ticket
Class Document
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Document < Hash include MiqXmlDiff include MiqXmlPatch def initialize(name = "xml", _attrs = {}, _parent = nil)
- Create a ticketCreate a ticket
Class MiqIPMI
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class MiqIPMI def initialize(server = nil, username = nil, password = nil) @server = server @username = username @password = password
- Create a ticketCreate a ticket
Method parse_output
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def parse_output(cmd_text) last_key = nil lines = cmd_text.kind_of?(Array) ? cmd_text : cmd_text.split("\n") lines.inject({}) do |a, line| idx = line.index(": ")
- Read upRead up
- Create a ticketCreate a ticket
Cyclomatic complexity for disk_usage is too high. [18/11] Open
def self.disk_usage(file = nil) file = normalize_df_file_argument(file) case Sys::Platform::IMPL when :linux
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Method walk
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def self.walk(node, parents = "") tags = [] sep = "/" case node.name
- Read upRead up
- Create a ticketCreate a ticket
Cyclomatic complexity for to_png is too high. [17/11] Open
def self.to_png(data, options = {}) require 'gruff' graph = case options[:graph_type] when :line then Gruff::Line.new
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
File miq_rexml.rb
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'time'require 'rexml/document'require_relative 'xml_utils' class MIQRexml
- Create a ticketCreate a ticket
File miq-powershell.rb
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'awesome_spawn'require 'io/wait'require 'open-uri' # Not to be confused with our own win32 directory, this is in stdlib on windows
- Create a ticketCreate a ticket
Method linux_process_stat
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.linux_process_stat(pid = nil) pid ||= Process.pid filename = "/proc/#{pid}/stat" raise Errno::ESRCH.new(pid.to_s) unless File.exist?(filename)
- Create a ticketCreate a ticket
Method disk_usage
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.disk_usage(file = nil) file = normalize_df_file_argument(file) case Sys::Platform::IMPL when :linux
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
def mount_share super log_header = "MIQ(#{self.class.name}-mount_share)" logger.info("#{log_header} Connecting to host: [#{@host}], share: [#{@mount_path}] using mount point: [#{@mnt_point}]...")
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
def mount_share super log_header = "MIQ(#{self.class.name}-mount_share)" logger.info(
- Read upRead up
- Create a ticketCreate a ticket
Method miq_compare_elements
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def miq_compare_elements(node1, node2, delta, diff_elements, stats) node1.each_element do |e1| e2 = miq_find_element(e1, node2) if e2 if miq_compare_attributes(e1, e2) == false
- Read upRead up
- Create a ticketCreate a ticket
Method convert_type
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def convert_type(c) case c.name.to_sym when :U16, :U32, :I32, :U64, :I64, :D, :By then c.text.to_i when :Db then c.text.to_f when :B then c.text.downcase == 'true'
- Read upRead up
- Create a ticketCreate a ticket