hammackj/risu

View on GitHub

Showing 111 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,
Severity: Major
Found in lib/risu/parsers/nessus/postprocess/wireshark.rb - About 3 hrs to fix

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

                        def initialize
                            @info =
                            {
                                :description => "Adobe Reader Patch Rollup",
                                :plugin_id => -99998,
    Severity: Major
    Found in lib/risu/parsers/nessus/postprocess/adobe_reader.rb - About 3 hrs to fix

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

                          def initialize
                              @info =
                              {
                                  :description => "Java Patch Rollup",
                                  :plugin_id => -99999,
      Severity: Major
      Found in lib/risu/parsers/nessus/postprocess/java.rb - About 3 hrs to fix

        Class NessusSaxListener has 26 methods (exceeds 20 allowed). Consider refactoring.
        Open

                    class NessusSaxListener
                        include LibXML::XML::SaxParser::Callbacks
        
                        attr_accessor :new_tags
        
        
        Severity: Minor
        Found in lib/risu/parsers/nessus/nessus_sax_listener.rb - About 3 hrs to fix

          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
          Severity: Major
          Found in lib/risu/base/post_process_base.rb - About 2 hrs to fix

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

                                def initialize
                                    @info =
                                    {
                                        :description => "VMware ESXi Patch Rollup",
                                        :plugin_id => -99981,
            Severity: Major
            Found in lib/risu/parsers/nessus/postprocess/vmware_esxi.rb - About 2 hrs to fix

              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
              Severity: Major
              Found in lib/risu/cli/application.rb - About 2 hrs to fix

                File nessus_sax_listener.rb has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require 'set'
                
                ActiveRecord::Migration.verbose = false
                
                module Risu
                Severity: Minor
                Found in lib/risu/parsers/nessus/nessus_sax_listener.rb - About 2 hrs to fix

                  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
                  Severity: Minor
                  Found in lib/risu/base/post_process_base.rb - About 2 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 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
                  Severity: Major
                  Found in lib/risu/templates/notable_detailed.rb - About 2 hrs to fix

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

                                        def initialize
                                            @info =
                                            {
                                                :description => "OpenSSL Patch Rollup",
                                                :plugin_id => -99984,
                    Severity: Major
                    Found in lib/risu/parsers/nessus/postprocess/openssl.rb - About 2 hrs to fix

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

                                          def initialize
                                              @info =
                                              {
                                                  :description => "Adobe Air Patch Rollup",
                                                  :plugin_id => -99994,
                      Severity: Major
                      Found in lib/risu/parsers/nessus/postprocess/adobe_air.rb - About 2 hrs to fix

                        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]"
                        Severity: Minor
                        Found in lib/risu/cli/application.rb - About 2 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 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
                        Severity: Major
                        Found in lib/risu/templates/malicious_process_detection.rb - About 2 hrs to fix

                          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|
                          Severity: Minor
                          Found in lib/risu/templates/technical_findings.rb - About 2 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 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
                          Severity: Minor
                          Found in lib/risu/models/host.rb - About 2 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 run has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                          Open

                                      def run
                                          parse_options
                          
                                          if @options[:list_templates]
                                              @template_manager.display_templates
                          Severity: Minor
                          Found in lib/risu/cli/application.rb - About 2 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 initialize has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                              def initialize
                                                  @info =
                                                  {
                                                      :description => "Adobe Acrobat Patch Rollup",
                                                      :plugin_id => -99975,
                          Severity: Major
                          Found in lib/risu/parsers/nessus/postprocess/adobe_acrobat.rb - About 2 hrs to fix

                            Method render has 53 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
                            Severity: Major
                            Found in lib/risu/templates/authentication_summary.rb - About 2 hrs to fix

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

                                          def render output
                                              @output.font_size 10
                              
                                              report_classification
                              
                              
                              Severity: Minor
                              Found in lib/risu/templates/findings_host.rb - About 2 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

                              Severity
                              Category
                              Status
                              Source
                              Language