Method packages
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def packages
res = send_req('cgi-bin/bfenterprise/BESMirrorRequest.exe')
return unless res && res.code == 200
print_status('Packages')
- 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 initialize
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(update_info(info,
'Name' => 'IBM BigFix Relay Server Sites and Package Enum',
'Description' => %q{
This module retrieves masthead, site, and available package information
Method download
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def download
print_status('Downloading packages')
@files.each do |action, val|
next if val.empty?
res = send_req("bfmirror/downloads/#{action}/0")
- 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 packages
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def packages
res = send_req('cgi-bin/bfenterprise/BESMirrorRequest.exe')
return unless res && res.code == 200
print_status('Packages')
Method run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run
masthead if datastore['SHOW_MASTHEAD']
sites if datastore['SHOW_SITES']
packages if datastore['SHOW_PACKAGES'] || datastore['DOWNLOAD']
download if datastore['DOWNLOAD'] && @files != {}
- 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"