Showing 178 of 178 total issues
Method initialize
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@info =
{
:description => "Wireshark Patch Rollups",
:plugin_id => -99992,
Method initialize
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@info =
{
:description => "Adobe Reader Patch Rollup",
:plugin_id => -99998,
Method initialize
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@info =
{
:description => "Java Patch Rollup",
:plugin_id => -99999,
Class NessusSaxListener
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class NessusSaxListener
include LibXML::XML::SaxParser::Callbacks
attr_accessor :new_tags
Method create_plugin
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_plugin
plugin = Plugin.find_by_id(@info[:plugin_id])
if plugin == nil
Method initialize
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@info =
{
:description => "VMware ESXi Patch Rollup",
:plugin_id => -99981,
Method run
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
parse_options
if @options[:list_templates]
@template_manager.display_templates
File nessus_sax_listener.rb
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'set'
ActiveRecord::Migration.verbose = false
module Risu
Method create_plugin
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def create_plugin
plugin = Plugin.find_by_id(@info[:plugin_id])
if plugin == 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
def has_data?
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
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 97.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def windows_os_graph_has_data?
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
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 97.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method render
has 66 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 initialize
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@info =
{
:description => "OpenSSL Patch Rollup",
:plugin_id => -99984,
Method initialize
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@info =
{
:description => "Adobe Air Patch Rollup",
:plugin_id => -99994,
Method parse_options
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def parse_options
begin
opts = OptionParser.new do |opt|
opt.banner = "#{APP_NAME} v#{VERSION}\nJacob Hammack\nhttp://www.hammackj.com\n\n"
opt.banner << "Usage: #{APP_NAME} [options] [files_to_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 render
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render output
text Report.classification.upcase, :align => :center
text "\n"
report_title Report.title
Similar blocks of code found in 2 locations. Consider refactoring. Open
module Parsers
module Nessus
module PostProcess
class Wireshark < Risu::Base::PostProcessBase
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
module Parsers
module Nessus
module PostProcess
class AdobeReader < Risu::Base::PostProcessBase
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method print_technical_findings
has a Cognitive Complexity of 18 (exceeds 5 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|
- 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 a Cognitive Complexity of 18 (exceeds 5 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
- 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"