kamaradclimber/rrimm

View on GitHub

Showing 4 of 4 total issues

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

    def create_subreddit!(feed)
      info "Will create subreddit named #{feed2sr(feed)}"
      sr(feed2sr(feed)).create(
        allow_discovery: true,
        allow_images: true,
Severity: Minor
Found in lib/rrimm/publisher/reddit.rb - About 1 hr to fix

    Method fetch_feed_no_timeout has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def fetch_feed_no_timeout(name, feed_config)
          debug "-> #{name}: reading cache"
          last_read = Time.at(@config.get_cache.read(feed_config))
          print name unless @quiet
          debug "-> #{name}: fetching and parsing"
    Severity: Minor
    Found in lib/rrimm/fetcher.rb - About 1 hr 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 status has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def status(ios, old_timestamp, very_old_timestamp, display_old_only, category=nil)
    Severity: Minor
    Found in lib/rrimm/config.rb - About 35 mins to fix

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

          def status(ios, old_timestamp, very_old_timestamp, display_old_only, category=nil)
            @feeds.values.
              select { |f| category.nil? || f.category == category }.
              map { |f| [ Time.at(get_cache.read(f)), f] }.
              sort_by { |el| el.first }.
      Severity: Minor
      Found in lib/rrimm/config.rb - About 35 mins 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