ManageIQ/manageiq-smartstate

View on GitHub

Showing 711 of 711 total issues

Method initialize has a Cognitive Complexity of 135 (exceeds 8 allowed). Consider refactoring.
Open

    def initialize(_c, fs)
      @users = []
      @groups = []

      # Extracted data also built into a human-readable format if uncommented
Severity: Minor
Found in lib/metadata/util/win32/Win32Accounts.rb - About 2 days 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 doUpdate has a Cognitive Complexity of 116 (exceeds 8 allowed). Consider refactoring.
Open

  def doUpdate(cs)
    #
    # The directory where the collection will be created.
    #
    destDir = cs.todir
Severity: Minor
Found in lib/fs/MiqFsUtil.rb - About 2 days 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

File VmConfig.rb has 769 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'pathname'
require 'metadata/VMMount/VMMount'
require 'miq_unicode'
require 'manageiq/gems/pending'
require 'util/miq-xml'
Severity: Major
Found in lib/metadata/VmConfig/VmConfig.rb - About 1 day to fix

File peheader.rb has 635 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'stringio'
require 'binary_struct'
require 'miq_unicode'

# Notes:
Severity: Major
Found in lib/metadata/util/win32/peheader.rb - About 1 day to fix

File InitProcHash.rb has 632 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module MiqLinux
  InitProcHash = {
    "2xthinclientserver"     => "Supports thin clients",
    "3dwm-server"            => "Binary server daemon",
    "acct"                   => "GNU Accounting utilities for process and login accounting",
Severity: Major
Found in lib/metadata/linux/InitProcHash.rb - About 1 day to fix

Method initialize has a Cognitive Complexity of 69 (exceeds 8 allowed). Consider refactoring.
Open

    def initialize(fs)
      @fs = fs
      @os_type = "Linux"
      @distribution = nil
      @description  = nil
Severity: Minor
Found in lib/metadata/linux/LinuxOSInfo.rb - About 1 day 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

File Win32Accounts.rb has 593 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'manageiq/gems/pending'
require 'util/miq-xml'
require 'miq_unicode'

module MiqWin32
Severity: Major
Found in lib/metadata/util/win32/Win32Accounts.rb - About 1 day to fix

File QcowDisk.rb has 555 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'disk/modules/MiqLargeFile'
require 'memory_buffer'
require 'binary_struct'

require 'zlib'
Severity: Major
Found in lib/disk/modules/QcowDisk.rb - About 1 day to fix

Method initialize has a Cognitive Complexity of 58 (exceeds 8 allowed). Consider refactoring.
Open

    def initialize(fs)
      @fs = fs
      @scriptsByName = {}

      #
Severity: Minor
Found in lib/metadata/linux/LinuxInitProcs.rb - About 1 day 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

File Win32EventLog.rb has 516 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'sys-uname'

# For message table resources.
require 'metadata/util/win32/peheader'

Severity: Major
Found in lib/metadata/util/win32/Win32EventLog.rb - About 1 day to fix

Class Superblock has 57 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Superblock
    #
    # Block I/O parameterization. A basic block (BB) is the lowest size of
    # filesystem allocation, and must equal 512.  Length units given to bio
    # routines are in BB's.
Severity: Major
Found in lib/fs/xfs/superblock.rb - About 1 day to fix

Class VmConfig has 53 methods (exceeds 20 allowed). Consider refactoring.
Open

class VmConfig
  using ManageIQ::UnicodeString

  attr_reader :configFile

Severity: Major
Found in lib/metadata/VmConfig/VmConfig.rb - About 7 hrs to fix

Method disk_files has a Cognitive Complexity of 51 (exceeds 8 allowed). Consider refactoring.
Open

  def disk_files(miqvm = nil)
    return @disk_files if @disk_files
    @disk_files = []
    if @direct_file_access
      @disk_files = files(miqvm)
Severity: Minor
Found in lib/metadata/VmConfig/VmConfig.rb - About 7 hrs 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

File ms-registry.rb has 468 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'binary_struct'
require 'miq_unicode'
require 'manageiq/gems/pending'
require 'util/miq-xml'
require 'util/xml/xml_hash'
Severity: Minor
Found in lib/metadata/util/win32/ms-registry.rb - About 7 hrs to fix

File inode.rb has 452 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'binary_struct'
require 'memory_buffer'
require 'more_core_extensions/all'
require 'fs/xfs/superblock'
require 'fs/xfs/bmap_btree_record'
Severity: Minor
Found in lib/fs/xfs/inode.rb - About 6 hrs to fix

Class Inode has 48 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Inode
    MAX_READ              = 4_294_967_296
    XFS_DINODE_MAGIC             = 0x494e

    # Bits 0 to 8 of file mode.
Severity: Minor
Found in lib/fs/xfs/inode.rb - About 6 hrs to fix

File superblock.rb has 434 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'binary_struct'
require 'uuidtools'
require 'stringio'
require 'memory_buffer'
require 'fs/xfs/allocation_group'
Severity: Minor
Found in lib/fs/xfs/superblock.rb - About 6 hrs to fix

Class MiqFS has 46 methods (exceeds 20 allowed). Consider refactoring.
Open

class MiqFS
  attr_accessor :fsType, :dobj, :fsId, :volName

  #
  # Class method to instantiate a MiqFS object
Severity: Minor
Found in lib/fs/MiqFS/MiqFS.rb - About 6 hrs to fix

Method openDisks has a Cognitive Complexity of 44 (exceeds 8 allowed). Consider refactoring.
Open

  def openDisks(diskFiles)
    pVolumes = []

    $log.debug "openDisks: no disk files supplied." unless diskFiles

Severity: Minor
Found in lib/MiqVm/MiqVm.rb - About 6 hrs 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

File MiqLdm.rb has 424 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'ostruct'
require 'binary_struct'
require 'uuidtools'

class BinaryStruct
Severity: Minor
Found in lib/VolumeManager/MiqLdm.rb - About 6 hrs to fix
Severity
Category
Status
Source
Language