Showing 111 of 178 total issues
Method initialize
has 1274 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize
@info =
{
:description => "Microsoft Windows Patch Rollup",
:plugin_id => -99983,
File microsoft_windows.rb
has 1286 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Risu
module Parsers
module Nessus
module PostProcess
class MicrosoftWindowsPatches < Risu::Base::PostProcessBase
Method initialize
has 408 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize
@info =
{
:description => "Root Cause Mapper",
:plugin_id => 0
Class Host
has 69 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Host < ActiveRecord::Base
belongs_to :report
has_many :items
has_many :patches
has_many :host_properties
Class Item
has 65 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Item < ActiveRecord::Base
belongs_to :host
belongs_to :plugin
has_many :attachments
File host.rb
has 478 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Risu
module Models
# Host Model
class Host < ActiveRecord::Base
Method render
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
Open
def render output
@output.text Report.classification.upcase, :align => :center
@output.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 render
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
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
File item.rb
has 438 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Risu
module Models
# Item Model
#
File root_cause.rb
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Risu
module Parsers
module Nessus
module PostProcess
class RootCauses < Risu::Base::PostProcessBase
Method up
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.up
create_table :policies do |t|
t.string :name
t.text :comments
t.string :owner
Method initialize
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize
@info =
{
:description => "Google Chrome Patch Rollup",
:plugin_id => -99990,
Method initialize
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize
@info =
{
:description => "Adobe Flash Player Patch Rollup",
:plugin_id => -99997,
Method render
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method initialize
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize
@info =
{
:description => "Firefox Patch Rollup",
:plugin_id => -99972,
File application.rb
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Risu
module CLI
# Application class for Risu
class Application
Method initialize
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize
@info =
{
:description => "PHP Patch Rollup",
:plugin_id => -99988,
Method parse_options
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
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]"
Class Reference
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Reference < ActiveRecord::Base
has_many :plugins
class << self
Method render
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def render output
output.text Report.classification.upcase, :align => :center
output.text "\n"
output.font_size(22) do