livinginthepast/fake_ftp

View on GitHub

Showing 6 of 6 total issues

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

def start
@started = true
@server = ::TCPServer.new('127.0.0.1', port)
@port = @server.addr[1]
@thread = Thread.new do
Severity: Minor
Found in lib/fake_ftp/server.rb - About 6 hrs to fix

Class Server has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

class Server
attr_accessor :client, :command_state, :data_server, :passive_port
attr_accessor :port, :store, :workdir
 
alias path workdir
Severity: Minor
Found in lib/fake_ftp/server.rb - About 2 hrs to fix

    Method start has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def start
    @started = true
    @server = ::TCPServer.new('127.0.0.1', port)
    @port = @server.addr[1]
    @thread = Thread.new do
    Severity: Minor
    Found in lib/fake_ftp/server.rb - About 1 hr to fix

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

      def run(ctx, filename = '', *)
      ctx.respond_with('501 No filename given') if filename.empty?
       
      f = ctx.file(filename.to_s)
      return ctx.respond_with('550 File not found') if f.nil?
      Severity: Minor
      Found in lib/fake_ftp/server_commands/retr.rb - About 25 mins to fix

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

      private def load_command_instance(command)
      require "fake_ftp/server_commands/#{command}"
      FakeFtp::ServerCommands.constants.each do |const_name|
      next unless const_name.to_s.downcase == command
      return FakeFtp::ServerCommands.const_get(const_name).new
      Severity: Minor
      Found in lib/fake_ftp/server.rb - About 25 mins to fix

      FIXME found
      Open

      # FIXME: this is far too ambiguous. args should not mean different
      Severity: Minor
      Found in lib/fake_ftp/file.rb by fixme
      Severity
      Category
      Status
      Source
      Language