<commit_before>package com.softwaremill.codebrag.dao

import com.softwaremill.codebrag.dao.user._
import com.softwaremill.codebrag.dao.commitinfo.{SQLCommitInfoDAO, MongoCommitInfoDAO, CommitInfoDAO}
import com.softwaremill.codebrag.dao.followup._
import com.softwaremill.codebrag.dao.reaction._
import com.softwaremill.codebrag.dao.reviewtask.{SQLCommitReviewTaskDAO, MongoCommitReviewTaskDAO, CommitReviewTaskDAO}
import com.softwaremill.codebrag.dao.invitation.{SQLInvitationDAO, MongoInvitationDAO, InvitationDAO}
import com.softwaremill.codebrag.dao.events.{SQLEventDAO, MongoEventDAO, EventDAO}
import com.softwaremill.codebrag.dao.instance.FileBasedInstanceSettingsDAO
import com.softwaremill.codebrag.dao.finders.notification.{SQLNotificationCountFinder, MongoNotificationCountFinder, NotificationCountFinder}
import com.softwaremill.codebrag.dao.finders.followup.{SQLFollowupFinder, MongoFollowupFinder, FollowupFinder}
import com.softwaremill.codebrag.dao.finders.reaction.ReactionFinder
import com.softwaremill.codebrag.dao.finders.StatsEventsFinder
import com.softwaremill.codebrag.dao.sql.SQLDatabase
import com.softwaremill.codebrag.common.Clock
import com.softwaremill.codebrag.dao.repositorystatus.{SQLRepositoryStatusDAO, RepositoryStatusDAO, MongoRepositoryStatusDAO}
import com.softwaremill.codebrag.dao.heartbeat.{SQLHeartbeatDAO, HeartbeatDAO, MongoHeartbeatDAO}
import com.softwaremill.codebrag.dao.branchsnapshot.InMemoryBranchStateDAO

trait Daos {
  def userDao: UserDAO
  def internalUserDao: InternalUserDAO
  def commitInfoDao: CommitInfoDAO
  def followupDao: FollowupDAO
  def followupWithReactionsDao: FollowupWithReactionsDAO
  def likeDao: LikeDAO
  def commentDao: CommitCommentDAO
  def commitReviewTaskDao: CommitReviewTaskDAO
  def invitationDao: InvitationDAO
  def eventDao: EventDAO
  def repoStatusDao: RepositoryStatusDAO
  def heartbeatDao: HeartbeatDAO

  lazy val instanceSettingsDao = new FileBasedInstanceSettingsDAO

  def notificationCountFinder: NotificationCountFinder
  def followupFinder: FollowupFinder

  lazy val reactionFinder = new ReactionFinder(userDao, commentDao, likeDao)
  lazy val statsFinder = new StatsEventsFinder(eventDao)
}

trait MongoDaos extends Daos {
  lazy val userDao = new MongoUserDAO
  lazy val internalUserDao = new MongoInternalUserDAO
  lazy val commitInfoDao = new MongoCommitInfoDAO
  lazy val followupDao = new MongoFollowupDAO
  lazy val followupWithReactionsDao = new MongoFollowupWithReactionsDAO(commentDao, likeDao)
  lazy val likeDao = new MongoLikeDAO
  lazy val commentDao = new MongoCommitCommentDAO
  lazy val commitReviewTaskDao = new MongoCommitReviewTaskDAO
  lazy val invitationDao = new MongoInvitationDAO
  lazy val eventDao = new MongoEventDAO
  lazy val repoStatusDao = new MongoRepositoryStatusDAO
  lazy val branchStateDao = new InMemoryBranchStateDAO
  lazy val heartbeatDao = new MongoHeartbeatDAO(clock)

  lazy val notificationCountFinder = new MongoNotificationCountFinder
  lazy val followupFinder = new MongoFollowupFinder

  def clock: Clock
}

trait SQLDaos extends Daos {
  lazy val userDao = new SQLUserDAO(sqlDatabase)
  lazy val internalUserDao = new SQLInternalUserDAO(sqlDatabase)
  lazy val commitInfoDao = new SQLCommitInfoDAO(sqlDatabase)
  lazy val followupDao = new SQLFollowupDAO(sqlDatabase)
  lazy val followupWithReactionsDao = new SQLFollowupWithReactionsDAO(sqlDatabase, commentDao, likeDao)
  lazy val likeDao = new SQLLikeDAO(sqlDatabase)
  lazy val commentDao = new SQLCommitCommentDAO(sqlDatabase)
  lazy val commitReviewTaskDao = new SQLCommitReviewTaskDAO(sqlDatabase, clock)
  lazy val invitationDao = new SQLInvitationDAO(sqlDatabase)
  lazy val eventDao = new SQLEventDAO(sqlDatabase)
  lazy val repoStatusDao = new SQLRepositoryStatusDAO(sqlDatabase)
  lazy val branchStateDao = new InMemoryBranchStateDAO
  lazy val heartbeatDao = new SQLHeartbeatDAO(sqlDatabase, clock)

  lazy val notificationCountFinder = new SQLNotificationCountFinder(sqlDatabase)
  lazy val followupFinder = new SQLFollowupFinder(sqlDatabase, userDao)

  def sqlDatabase: SQLDatabase
  def clock: Clock
}<commit_msg>Make use of SQL implementation of branch state DAO<commit_after>package com.softwaremill.codebrag.dao

import com.softwaremill.codebrag.dao.user._
import com.softwaremill.codebrag.dao.commitinfo.{SQLCommitInfoDAO, MongoCommitInfoDAO, CommitInfoDAO}
import com.softwaremill.codebrag.dao.followup._
import com.softwaremill.codebrag.dao.reaction._
import com.softwaremill.codebrag.dao.reviewtask.{SQLCommitReviewTaskDAO, MongoCommitReviewTaskDAO, CommitReviewTaskDAO}
import com.softwaremill.codebrag.dao.invitation.{SQLInvitationDAO, MongoInvitationDAO, InvitationDAO}
import com.softwaremill.codebrag.dao.events.{SQLEventDAO, MongoEventDAO, EventDAO}
import com.softwaremill.codebrag.dao.instance.FileBasedInstanceSettingsDAO
import com.softwaremill.codebrag.dao.finders.notification.{SQLNotificationCountFinder, MongoNotificationCountFinder, NotificationCountFinder}
import com.softwaremill.codebrag.dao.finders.followup.{SQLFollowupFinder, MongoFollowupFinder, FollowupFinder}
import com.softwaremill.codebrag.dao.finders.reaction.ReactionFinder
import com.softwaremill.codebrag.dao.finders.StatsEventsFinder
import com.softwaremill.codebrag.dao.sql.SQLDatabase
import com.softwaremill.codebrag.common.Clock
import com.softwaremill.codebrag.dao.repositorystatus.{SQLRepositoryStatusDAO, RepositoryStatusDAO, MongoRepositoryStatusDAO}
import com.softwaremill.codebrag.dao.heartbeat.{SQLHeartbeatDAO, HeartbeatDAO, MongoHeartbeatDAO}
import com.softwaremill.codebrag.dao.branchsnapshot.{SQLBranchStateDAO, InMemoryBranchStateDAO}

trait Daos {
  def userDao: UserDAO
  def internalUserDao: InternalUserDAO
  def commitInfoDao: CommitInfoDAO
  def followupDao: FollowupDAO
  def followupWithReactionsDao: FollowupWithReactionsDAO
  def likeDao: LikeDAO
  def commentDao: CommitCommentDAO
  def commitReviewTaskDao: CommitReviewTaskDAO
  def invitationDao: InvitationDAO
  def eventDao: EventDAO
  def repoStatusDao: RepositoryStatusDAO
  def heartbeatDao: HeartbeatDAO

  lazy val instanceSettingsDao = new FileBasedInstanceSettingsDAO

  def notificationCountFinder: NotificationCountFinder
  def followupFinder: FollowupFinder

  lazy val reactionFinder = new ReactionFinder(userDao, commentDao, likeDao)
  lazy val statsFinder = new StatsEventsFinder(eventDao)
}

trait MongoDaos extends Daos {
  lazy val userDao = new MongoUserDAO
  lazy val internalUserDao = new MongoInternalUserDAO
  lazy val commitInfoDao = new MongoCommitInfoDAO
  lazy val followupDao = new MongoFollowupDAO
  lazy val followupWithReactionsDao = new MongoFollowupWithReactionsDAO(commentDao, likeDao)
  lazy val likeDao = new MongoLikeDAO
  lazy val commentDao = new MongoCommitCommentDAO
  lazy val commitReviewTaskDao = new MongoCommitReviewTaskDAO
  lazy val invitationDao = new MongoInvitationDAO
  lazy val eventDao = new MongoEventDAO
  lazy val repoStatusDao = new MongoRepositoryStatusDAO
  lazy val branchStateDao = new InMemoryBranchStateDAO
  lazy val heartbeatDao = new MongoHeartbeatDAO(clock)

  lazy val notificationCountFinder = new MongoNotificationCountFinder
  lazy val followupFinder = new MongoFollowupFinder

  def clock: Clock
}

trait SQLDaos extends Daos {
  lazy val userDao = new SQLUserDAO(sqlDatabase)
  lazy val internalUserDao = new SQLInternalUserDAO(sqlDatabase)
  lazy val commitInfoDao = new SQLCommitInfoDAO(sqlDatabase)
  lazy val followupDao = new SQLFollowupDAO(sqlDatabase)
  lazy val followupWithReactionsDao = new SQLFollowupWithReactionsDAO(sqlDatabase, commentDao, likeDao)
  lazy val likeDao = new SQLLikeDAO(sqlDatabase)
  lazy val commentDao = new SQLCommitCommentDAO(sqlDatabase)
  lazy val commitReviewTaskDao = new SQLCommitReviewTaskDAO(sqlDatabase, clock)
  lazy val invitationDao = new SQLInvitationDAO(sqlDatabase)
  lazy val eventDao = new SQLEventDAO(sqlDatabase)
  lazy val repoStatusDao = new SQLRepositoryStatusDAO(sqlDatabase)
  lazy val branchStateDao = new SQLBranchStateDAO(sqlDatabase)
  lazy val heartbeatDao = new SQLHeartbeatDAO(sqlDatabase, clock)

  lazy val notificationCountFinder = new SQLNotificationCountFinder(sqlDatabase)
  lazy val followupFinder = new SQLFollowupFinder(sqlDatabase, userDao)

  def sqlDatabase: SQLDatabase
  def clock: Clock
}
{'fraction_non_alphanumeric': 0.0546218487394958, 'fraction_numerical': 0.0, 'mean_word_length': 6.859433962264151, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1694615', 'n_tokens_mistral': 2559, 'n_tokens_neox': 2708, 'n_words': 581}