Class: Solidstats::TodoService

Inherits:
DataCollectorService show all
Defined in:
app/services/solidstats/todo_service.rb

Overview

Service to collect and process TODO items from codebase

Instance Attribute Summary

Attributes inherited from DataCollectorService

#cache_duration, #cache_file

Instance Method Summary collapse

Methods inherited from DataCollectorService

#fetch

Constructor Details

#initializeTodoService

Initialize with default cache settings for TODO items



7
8
9
# File 'app/services/solidstats/todo_service.rb', line 7

def initialize
  super(Rails.root.join("tmp", "solidstats_todos.json"))
end

Instance Method Details

#summaryHash

Generate a summary for the dashboard display

Returns:

  • (Hash)

    Summary information with counts and status



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/services/solidstats/todo_service.rb', line 13

def summary
  todos = fetch
  return { count: 0, status: "success", message: "No TODO items found" } if todos.nil? || todos.empty?

  stats = calculate_stats(todos)

  {
    count: todos.count,
    status: determine_status(todos),
    message: generate_message(todos.count),
    by_type: stats[:by_type],
    hotspots: stats[:hotspots]
  }
end