Class: Debtective::Todos::List

Inherits:
Object
  • Object
show all
Defined in:
lib/debtective/todos/list.rb

Overview

Information about the todos in the codebase

Defined Under Namespace

Classes: Author

Instance Method Summary collapse

Constructor Details

#initialize(paths) ⇒ List

Returns a new instance of List.

Parameters:

  • paths (Array<String>)


12
13
14
# File 'lib/debtective/todos/list.rb', line 12

def initialize(paths)
  @paths = paths
end

Instance Method Details

#authorsArray<Debtective::Todos::List::Author>



22
23
24
25
26
27
# File 'lib/debtective/todos/list.rb', line 22

def authors
  todos
    .map { [_1.commit.author.email, _1.commit.author.name] }
    .uniq
    .map { author(_1) }
end

#combined_countInteger

Returns:

  • (Integer)


35
36
37
38
39
40
41
42
43
44
45
# File 'lib/debtective/todos/list.rb', line 35

def combined_count
  todos
    .group_by(&:pathname)
    .values
    .sum do |pathname_todos|
      pathname_todos
        .map { _1.statement_boundaries.to_a }
        .reduce(:|)
        .length
    end
end

#extended_countInteger

Returns:

  • (Integer)


30
31
32
# File 'lib/debtective/todos/list.rb', line 30

def extended_count
  todos.sum(&:size)
end

#todosArray<Debtective::Todos::Todo>

Returns:



17
18
19
# File 'lib/debtective/todos/list.rb', line 17

def todos
  @todos ||= Debtective::Todos::Find.new(@paths).call
end