hammackj/risu

View on GitHub

Showing 111 of 178 total issues

Method initialize has 1274 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                    def initialize
                        @info =
                        {
                            :description => "Microsoft Windows Patch Rollup",
                            :plugin_id => -99983,
Severity: Major
Found in lib/risu/parsers/nessus/postprocess/microsoft_windows.rb - About 6 days to fix

    File microsoft_windows.rb has 1286 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Risu
        module Parsers
            module Nessus
                module PostProcess
                    class MicrosoftWindowsPatches < Risu::Base::PostProcessBase
    Severity: Major
    Found in lib/risu/parsers/nessus/postprocess/microsoft_windows.rb - About 3 days to fix

      Method initialize has 408 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                          def initialize
                              @info =
                              {
                                  :description => "Root Cause Mapper",
                                  :plugin_id => 0
      Severity: Major
      Found in lib/risu/parsers/nessus/postprocess/root_cause.rb - About 2 days to fix

        Class Host has 69 methods (exceeds 20 allowed). Consider refactoring.
        Open

                class Host < ActiveRecord::Base
                    belongs_to :report
                    has_many :items
                    has_many :patches
                    has_many :host_properties
        Severity: Major
        Found in lib/risu/models/host.rb - About 1 day to fix

          Class Item has 65 methods (exceeds 20 allowed). Consider refactoring.
          Open

                  class Item < ActiveRecord::Base
                      belongs_to :host
                      belongs_to :plugin
                      has_many :attachments
          
          
          Severity: Major
          Found in lib/risu/models/item.rb - About 1 day to fix

            File host.rb has 478 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module Risu
                module Models
            
                    # Host Model
                    class Host < ActiveRecord::Base
            Severity: Minor
            Found in lib/risu/models/host.rb - About 7 hrs to fix

              Method render has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

                          def render output
                              @output.text Report.classification.upcase, :align => :center
                              @output.text "\n"
              
                              report_title Report.title
              Severity: Minor
              Found in lib/risu/templates/notable_detailed.rb - About 6 hrs to fix

              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

                          def render output
                              text Report.classification.upcase, :align => :center
                              text "\n"
              
                              report_title Report.title
              Severity: Minor
              Found in lib/risu/templates/malicious_process_detection.rb - About 6 hrs to fix

              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

              module Risu
                  module Models
              
                      # Item Model
                      #
              Severity: Minor
              Found in lib/risu/models/item.rb - About 6 hrs to fix

                File root_cause.rb has 430 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module Risu
                    module Parsers
                        module Nessus
                            module PostProcess
                                class RootCauses < Risu::Base::PostProcessBase
                Severity: Minor
                Found in lib/risu/parsers/nessus/postprocess/root_cause.rb - About 6 hrs to fix

                  Method up has 156 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              def self.up
                                  create_table :policies do |t|
                                      t.string :name
                                      t.text :comments
                                      t.string :owner
                  Severity: Major
                  Found in lib/risu/base/schema.rb - About 6 hrs to fix

                    Method initialize has 144 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                        def initialize
                                            @info =
                                            {
                                                :description => "Google Chrome Patch Rollup",
                                                :plugin_id => -99990,
                    Severity: Major
                    Found in lib/risu/parsers/nessus/postprocess/google_chrome.rb - About 5 hrs to fix

                      Method initialize has 140 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                          def initialize
                                              @info =
                                              {
                                                  :description => "Adobe Flash Player Patch Rollup",
                                                  :plugin_id => -99997,
                      Severity: Major
                      Found in lib/risu/parsers/nessus/postprocess/adobe_flash_player.rb - About 5 hrs to fix

                        Method render has 135 lines of code (exceeds 25 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
                        Severity: Major
                        Found in lib/risu/templates/executive_summary_detailed.rb - About 5 hrs to fix

                          Method initialize has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                              def initialize
                                                  @info =
                                                  {
                                                      :description => "Firefox Patch Rollup",
                                                      :plugin_id => -99972,
                          Severity: Major
                          Found in lib/risu/parsers/nessus/postprocess/firefox.rb - About 4 hrs to fix

                            File application.rb has 361 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            module Risu
                                module CLI
                            
                                    # Application class for Risu
                                    class Application
                            Severity: Minor
                            Found in lib/risu/cli/application.rb - About 4 hrs to fix

                              Method initialize has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                                  def initialize
                                                      @info =
                                                      {
                                                          :description => "PHP Patch Rollup",
                                                          :plugin_id => -99988,
                              Severity: Major
                              Found in lib/risu/parsers/nessus/postprocess/php.rb - About 4 hrs to fix

                                Method parse_options has 92 lines of code (exceeds 25 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]"
                                Severity: Major
                                Found in lib/risu/cli/application.rb - About 3 hrs to fix

                                  Class Reference has 30 methods (exceeds 20 allowed). Consider refactoring.
                                  Open

                                          class Reference < ActiveRecord::Base
                                            has_many :plugins
                                  
                                              class << self
                                  
                                  
                                  Severity: Minor
                                  Found in lib/risu/models/reference.rb - About 3 hrs to fix

                                    Method render has 85 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) do
                                    Severity: Major
                                    Found in lib/risu/templates/missing_root_causes.rb - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language