Showing 111 of 178 total issues
Method graph
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def graph
g = Gruff::Pie.new(GRAPH_WIDTH)
g.title = "Windows Operating Systems By Percentage"
g.sort = false
g.marker_count = 1
Method unsupported_os_windows
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def unsupported_os_windows
win_95_text = ""
win_98_text = ""
win_me_text = ""
win_nt_text = ""
Method migrate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def migrate direction
begin
if @database["adapter"] == nil
return false, "[!] Invalid database adapter, please check your configuration file"
end
Method parse_file
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_file file
begin
puts "[*] Parsing #{file}..."
tstart = Time.new
Method render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render output
text Report.classification.upcase, :align => :center
text "\n"
report_title Report.title
Method graph
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def 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 other_os_graph
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def other_os_graph
g = Gruff::Pie.new(GRAPH_WIDTH)
g.title = "Other Operating Systems Percentage"
g.sort = false
g.marker_count = 1
Method top_by_count_graph
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def top_by_count_graph(limit=10)
g = Gruff::Bar.new(GRAPH_WIDTH)
g.title = sprintf "Top %d Critical Findings By Plugin", Item.risks_by_plugin(limit).to_a.count
g.sort = false
g.marker_count = 1
Method create_plugin
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_plugin
plugin = Plugin.find_by_id(@plugin_id)
newest_plugin = newest_plugin()
Method render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def render output
text Report.classification.upcase, :align => :center
text "\n"
report_title Report.title
- 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 newest_plugin
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def newest_plugin
newest = DateTime.new(0001, 01, 01)
newest_plugin = nil
@plugin_ids.uniq.each do |id|
- 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 shares_section
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def shares_section
poor_count = 0
anon_ftp_text = ""
anon_smb_text = ""
- 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 anon_smb_section
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def anon_smb_section
if anon_smb_count() <= 0
return
end
- 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 render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def render output
output.font_size 10
output.font "Times-Roman"
output.image "#{File.expand_path(File.dirname(__FILE__))}/data/nessuslogo.jpg", :scale => 1.0, :position => :left, :vposition => :top
- 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 render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def render output
text Report.classification.upcase, :align => :center
text "\n"
report_title Report.title
- 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 on_end_element
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def on_end_element(element)
@tag = nil
case element
when "device"
@in_device = 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 valid?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def valid?
if File.exist?(@document)
@parser = LibXML::XML::Parser.file @document
doc = @parser.parse
- 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 run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run
@plugins_to_severity.each do |k, v|
items = Item.where(:plugin_id => k)
if items == nil
- 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 stig_findings_text
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def stig_findings_text(category="I")
if category != "I" || category != "II" || category != "III"
return
end
- 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 known_malicious_process_appendix_section
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def known_malicious_process_appendix_section
count = known_malicious_process_count()
if count <= 0
return
- 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"