Showing 23 of 23 total issues

Assignment Branch Condition size for print is too high. [76.72/20]
Open

def print(output)
output.puts "---- MEMORY THRESHOLD ----"
output.puts "THRESHOLD: #{@threshold/1024} MB\n"
 
output.puts "\n-- REQUESTS --\n" if @format == :verbose

Assignment Branch Condition size for print is too high. [58.19/20]
Open

def print(output)
output.puts "---- OINK FOR ACTIVERECORD ----"
output.puts "THRESHOLD: #{@threshold} Active Record objects per request\n"
 
output.puts "\n-- REQUESTS --\n" if @format == :verbose

Method print has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

def print(output)
output.puts "---- MEMORY THRESHOLD ----"
output.puts "THRESHOLD: #{@threshold/1024} MB\n"
 
output.puts "\n-- REQUESTS --\n" if @format == :verbose
Severity: Minor
Found in lib/oink/reports/memory_usage_report.rb - About 5 hrs to fix

Assignment Branch Condition size for print_summary is too high. [52.12/20]
Open

def print_summary(output)
output.puts "\n-- SUMMARY --\n"
output.puts "Worst Requests:"
@bad_requests.each_with_index do |offender, index|
output.puts "#{index + 1}. #{offender.datetime}, #{offender.display_oink_number}, #{offender.action}"
Severity: Minor
Found in lib/oink/reports/base.rb by rubocop

Method print has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

def print(output)
output.puts "---- OINK FOR ACTIVERECORD ----"
output.puts "THRESHOLD: #{@threshold} Active Record objects per request\n"
 
output.puts "\n-- REQUESTS --\n" if @format == :verbose
Severity: Minor
Found in lib/oink/reports/active_record_instantiation_report.rb - About 4 hrs to fix

Assignment Branch Condition size for process is too high. [41.82/20]
Open

def process
options = { :format => :short_summary, :type => :memory }
 
op = OptionParser.new do |opts|
opts.banner = "Usage: oink [options] files"
Severity: Minor
Found in lib/oink/cli.rb by rubocop

Assignment Branch Condition size for included is too high. [30.1/20]
Open

def self.included(klass)
klass.class_eval do
 
def self.reset_instance_type_count
self.instantiated_hash = {}

Method print has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def print(output)
output.puts "---- MEMORY THRESHOLD ----"
output.puts "THRESHOLD: #{@threshold/1024} MB\n"
 
output.puts "\n-- REQUESTS --\n" if @format == :verbose
Severity: Minor
Found in lib/oink/reports/memory_usage_report.rb - About 1 hr to fix

    Method process has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def process
    options = { :format => :short_summary, :type => :memory }
     
    op = OptionParser.new do |opts|
    opts.banner = "Usage: oink [options] files"
    Severity: Minor
    Found in lib/oink/cli.rb - About 1 hr to fix

      Method print has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def print(output)
      output.puts "---- OINK FOR ACTIVERECORD ----"
      output.puts "THRESHOLD: #{@threshold} Active Record objects per request\n"
       
      output.puts "\n-- REQUESTS --\n" if @format == :verbose
      Severity: Minor
      Found in lib/oink/reports/active_record_instantiation_report.rb - About 1 hr to fix

        Method included has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def self.included(klass)
        klass.class_eval do
         
        def self.reset_instance_type_count
        self.instantiated_hash = {}
        Severity: Minor
        Found in lib/oink/instrumentation/active_record.rb - About 1 hr to fix

          Method print_summary has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def print_summary(output)
          output.puts "\n-- SUMMARY --\n"
          output.puts "Worst Requests:"
          @bad_requests.each_with_index do |offender, index|
          output.puts "#{index + 1}. #{offender.datetime}, #{offender.display_oink_number}, #{offender.action}"
          Severity: Minor
          Found in lib/oink/reports/base.rb - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

            if @format == :verbose
            @pids[pid][:buffer].each { |b| output.puts b }
            output.puts "---------------------------------------------------------------------"
            end
            Severity: Major
            Found in lib/oink/reports/memory_usage_report.rb - About 45 mins to fix

              Method process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              def process
              options = { :format => :short_summary, :type => :memory }
               
              op = OptionParser.new do |opts|
              opts.banner = "Usage: oink [options] files"
              Severity: Minor
              Found in lib/oink/cli.rb - About 35 mins to fix

              Method get_file_listing has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              def get_file_listing(args)
              listing = []
              args.each do |file|
              unless File.exist?(file)
              raise "Could not find \"#{file}\""
              Severity: Minor
              Found in lib/oink/cli.rb - About 25 mins to fix

              Variable value used in void context.
              Open

              value

              Unused block argument - v. You can omit the argument if you don't care about it.
              Open

              opts.on("-m", "--memory", "Check for Memory Threshold (default)") do |v|
              Severity: Minor
              Found in lib/oink/cli.rb by rubocop

              Useless assignment to variable - e.
              Open

              rescue Oink::Instrumentation::MemoryDataUnavailableError => e

              Unused block argument - v. You can omit the argument if you don't care about it.
              Open

              opts.on("-r", "--active-record", "Check for Active Record Threshold") do |v|
              Severity: Minor
              Found in lib/oink/cli.rb by rubocop

              Do not suppress exceptions.
              Open

              rescue LoadError
              Severity
              Category
              Status
              Source
              Language