phradion/lgtm_hd

View on GitHub

Showing 4 of 4 total issues

Method run has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def run
program :name, LgtmHD::Configuration::PROGRAM_NAME
program :version, LgtmHD::VERSION
program :description, LgtmHD::Configuration::DESCRIPTION
program :help_formatter, Commander::HelpFormatter::TerminalCompact
Severity: Major
Found in lib/lgtm_hd/cli.rb - About 2 hrs to fix

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

    def run
    program :name, LgtmHD::Configuration::PROGRAM_NAME
    program :version, LgtmHD::VERSION
    program :description, LgtmHD::Configuration::DESCRIPTION
    program :help_formatter, Commander::HelpFormatter::TerminalCompact
    Severity: Minor
    Found in lib/lgtm_hd/cli.rb - About 1 hr to fix

    Method check_uris has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    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)
    Severity: Minor
    Found in lib/lgtm_hd/cli.rb - About 55 mins to fix

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

    def self.fetch_random_image(dest_path = nil, file_prefix = nil)
    # LGTM.in has so many broken images
    # So we loop until a good image is found
    limit = TRY_FETCHING_IMAGE_LIMIT
    begin
    Severity: Minor
    Found in lib/lgtm_hd/lgtmdotin.rb - About 25 mins to fix
    Severity
    Category
    Status
    Source
    Language