<commit_before>package com.softwaremill.codebrag.service.config

import org.joda.time._
import scala.concurrent.duration._
import com.softwaremill.codebrag.common.config.ConfigWithDefault

trait CodebragConfig extends ConfigWithDefault with CodebragStatsConfig {

  lazy val debugServicesLogin: String = rootConfig.getString("codebrag.debug-services-login")
  lazy val debugServicesPassword: String = rootConfig.getString("codebrag.debug-services-password")
  lazy val demo: Boolean = getBoolean("codebrag.demo", default = false)
  lazy val applicationUrl: String = rootConfig.getString("codebrag.application-url")

  lazy val invitationExpiryTime: ReadablePeriod = Period.millis(getMilliseconds("codebrag.invitation-expiry-time", 24.hours.toMillis).toInt)

  lazy val userNotifications: Boolean = getBoolean("codebrag.user-email-notifications.enabled", default = true)

  lazy val notificationsCheckInterval = getMilliseconds("codebrag.user-email-notifications.check-interval", 15.minutes.toMillis).millis

  lazy val userOfflinePeriod = Period.millis(getMilliseconds("codebrag.user-email-notifications.user-offline-after", 5.minutes.toMillis).toInt)

  // Config properties for daily summary send outs
  // Not included in docs and in config template as we prefer not to expose them
  // By default daily summaries are sent at 6am every day
  lazy val dailyDigestSendHour = getInt("codebrag.user-email-notifications.daily-digest-hour", 6)
  lazy val dailyDigestSendMinute = getInt("codebrag.user-email-notifications.daily-digest-minute", 0)
  lazy val dailyDigestSendInterval = Period.millis(getMilliseconds("codebrag.user-email-notifications.daily-digest-interval", 24.hours.toMillis).toInt)

  lazy val replayFollowupsForPastCommitsTimeInDays = getInt("codebrag.replay-followups-time", 30)
}

trait CodebragStatsConfig extends ConfigWithDefault {
<commit_msg>Extract notification config to separate trait<commit_after>package com.softwaremill.codebrag.service.config

import org.joda.time._
import scala.concurrent.duration._
import com.softwaremill.codebrag.common.config.ConfigWithDefault

trait CodebragConfig extends ConfigWithDefault with StatsConfig with EmailNotificationConfig {

  lazy val demo: Boolean = getBoolean("codebrag.demo", default = false)
  lazy val applicationUrl: String = rootConfig.getString("codebrag.application-url")

  lazy val invitationExpiryTime: ReadablePeriod = Period.millis(getMilliseconds("codebrag.invitation-expiry-time", 24.hours.toMillis).toInt)

  lazy val replayFollowupsForPastCommitsTimeInDays = getInt("codebrag.replay-followups-time", 30)
}

trait EmailNotificationConfig extends ConfigWithDefault {
  lazy val userNotifications: Boolean = getBoolean("email-notifications.enabled", default = true)
  lazy val notificationsCheckInterval = getMilliseconds("email-notifications.check-interval", 15.minutes.toMillis).millis
  lazy val userOfflinePeriod = Period.millis(getMilliseconds("email-notifications.user-offline-after", 5.minutes.toMillis).toInt)

  // Config properties for daily summary send outs
  // Not included in docs and in config template as we prefer not to expose them
  // By default daily summaries are sent at 6am every day
  lazy val dailyDigestSendHour = getInt("email-notifications.daily-digest-hour", 6)
  lazy val dailyDigestSendMinute = getInt("email-notifications.daily-digest-minute", 0)
  lazy val dailyDigestSendInterval = Period.millis(getMilliseconds("email-notifications.daily-digest-interval", 24.hours.toMillis).toInt)
}

trait StatsConfig extends ConfigWithDefault {

{'fraction_non_alphanumeric': 0.09067868206139115, 'fraction_numerical': 0.006758659532526049, 'mean_word_length': 6.104, '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': '5456554', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1024, 'n_words': 231}