Showing 111 of 178 total issues
Method initialize
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@info =
{
:description => "Microsoft Office Patch Rollup",
:plugin_id => -99946,
Method render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render output
output.image "#{File.expand_path(File.dirname(__FILE__))}/data/nessuslogo.jpg", :scale => 0.2, :position => :left, :vposition => :top
text "\n"
text "\n"
Method initialize
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@info =
{
:description => "VMware vCenter Patch Rollup",
:plugin_id => -99979,
Method render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render output
@output.text Report.classification.upcase, :align => :center
@output.text "\n"
report_title Report.title
Method windows_os_graph_text
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def windows_os_graph_text
nt = Host.os_windows_nt.to_a.size
w2k = Host.os_windows_2k.to_a.size
xp = Host.os_windows_xp.to_a.size
w2k3 = Host.os_windows_2k3.to_a.size
Method windows_os_graph_text
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def windows_os_graph_text
nt = Host.os_windows_nt.to_a.size
w2k = Host.os_windows_2k.to_a.size
xp = Host.os_windows_xp.to_a.size
w2k3 = Host.os_windows_2k3.to_a.size
- 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 print_technical_findings
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def print_technical_findings(risks, text, color, last=false)
if risks.length > 0
title text, 18, color
risks.each do |f|
Method initialize
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@info =
{
:description => "OpenSSH Patch Rollup",
:plugin_id => -99995,
Method text
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def text
nt = Host.os_windows_nt.to_a.count
w2k = Host.os_windows_2k.to_a.count
xp = Host.os_windows_xp.to_a.count
w2k3 = Host.os_windows_2k3.to_a.count
Method db_connect
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def db_connect
begin
if @database["adapter"] == nil
puts "[!] #{@database['adapter']}" if @options[:debug]
Method initialize
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@info =
{
:description => "Cisco IOS Patch Rollup",
:plugin_id => -99965,
Method shares_section
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def shares_section
poor_count = 0
anon_ftp_text = ""
anon_smb_text = ""
Method initialize
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@info =
{
:description => "HP System Management Homepage Patch Rollup",
:plugin_id => -99985,
Method render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render output
output.text Report.classification.upcase, :align => :center
output.text "\n"
output.font_size(22) { output.text Report.title, :align => :center }
Method load_postprocesses
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def load_postprocesses(path, recursive=true)
begin
search_path = "#{path}/**/*.rb" if recursive == true
search_path = "#{path}/*.rb" if recursive == false
- 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 windows_os_graph
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def windows_os_graph
g = Gruff::Pie.new(GRAPH_WIDTH)
g.title = "Windows Operating Systems By Percentage"
g.sort = false
g.marker_count = 1
- 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 load_templates
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def load_templates path, recursive=true
begin
search_path = "#{path}/**/*.rb" if recursive == true
search_path = "#{path}/*.rb" if recursive == false
- 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 text
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def text
nt = Host.os_windows_nt.to_a.count
w2k = Host.os_windows_2k.to_a.count
xp = Host.os_windows_xp.to_a.count
w2k3 = Host.os_windows_2k3.to_a.count
- 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 windows_os_graph
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def windows_os_graph
g = Gruff::Pie.new(GRAPH_WIDTH)
g.title = "Windows Operating Systems By Percentage"
g.sort = false
g.marker_count = 1
Method initialize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@info =
{
:description => "Apple iTunes Patch Rollup",
:plugin_id => -99960,