Method run
has 66 lines of code (exceeds 25 allowed). Consider refactoring.
def run
program :name, LgtmHD::Configuration::PROGRAM_NAME
program :version, LgtmHD::VERSION
program :description, LgtmHD::Configuration::DESCRIPTION
program :help_formatter, Commander::HelpFormatter::TerminalCompact
Method run
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
def run
program :name, LgtmHD::Configuration::PROGRAM_NAME
program :version, LgtmHD::VERSION
program :description, LgtmHD::Configuration::DESCRIPTION
program :help_formatter, Commander::HelpFormatter::TerminalCompact
Method check_uris
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
def check_uris(dest_dir, source_uri = nil)
begin
raise ArgumentError, "Destination path for exporting image is invalid" unless File.exist?(dest_dir) && File.directory?(dest_dir)
if !!source_uri
raise ArgumentError, "Source image is neither proper URL nor FILE" unless source_uri =~ URI::regexp || File.exist?(source_uri)
Method fetch_random_image
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def self.fetch_random_image(dest_path = nil, file_prefix = nil)
limit = TRY_FETCHING_IMAGE_LIMIT
begin