hammackj/risu

View on GitHub

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,
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

                  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
                  Severity: Major
                  Found in lib/risu/graphs/windows_os_graph.rb and 1 other location - About 2 hrs to fix
                  lib/risu/models/host.rb on lines 437..453

                  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

                  Further Reading

                  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
                  Severity: Major
                  Found in lib/risu/models/host.rb and 1 other location - About 2 hrs to fix
                  lib/risu/graphs/windows_os_graph.rb on lines 109..125

                  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

                  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

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              module Parsers
                                  module Nessus
                                      module PostProcess
                                          class Wireshark < Risu::Base::PostProcessBase
                          
                          
                          Severity: Major
                          Found in lib/risu/parsers/nessus/postprocess/wireshark.rb and 1 other location - About 2 hrs to fix
                          lib/risu/parsers/nessus/postprocess/adobe_reader.rb on lines 23..109

                          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

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              module Parsers
                                  module Nessus
                                      module PostProcess
                                          class AdobeReader < Risu::Base::PostProcessBase
                          
                          
                          Severity: Major
                          Found in lib/risu/parsers/nessus/postprocess/adobe_reader.rb and 1 other location - About 2 hrs to fix
                          lib/risu/parsers/nessus/postprocess/wireshark.rb on lines 23..108

                          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

                          Further Reading

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language