module Repokeeper::Analyzers::BranchesCount

Public Instance Methods

analyze(repo) click to toggle source
# File lib/repokeeper/analyzers/mixins/branches_count.rb, line 3
def analyze(repo)
  branches = get_branches(repo)
  report(branches) if error?(branches)
end

Private Instance Methods

create_offense(branches) click to toggle source
# File lib/repokeeper/analyzers/mixins/branches_count.rb, line 18
def create_offense(branches)
  Repokeeper::Offenses::BranchesOffense.new(branches, message, name)
end
error?(branches) click to toggle source
# File lib/repokeeper/analyzers/mixins/branches_count.rb, line 10
def error?(branches)
  branches.count > max_branches
end
report(branches) click to toggle source
# File lib/repokeeper/analyzers/mixins/branches_count.rb, line 14
def report(branches)
  create_offense(branches)
end