Skip to content

Commit

Permalink
Fix detekt reported issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ravishanker committed Jan 31, 2024
1 parent 4ea21b3 commit e910a02
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ class StatsModule {
@Provides
@Singleton
@Named(LIST_STATS_USE_CASES)
@Suppress("LongParameterList")
fun provideListStatsUseCases(
@Named(INSIGHTS_USE_CASE) insightsUseCase: BaseListUseCase,
@Named(TRAFFIC_USE_CASE) trafficUseCase: BaseListUseCase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import org.wordpress.android.fluxc.network.utils.StatsGranularity
import org.wordpress.android.fluxc.store.StatsStore.StatsType
import org.wordpress.android.ui.pages.SnackbarMessageHolder
import org.wordpress.android.ui.stats.refresh.NavigationTarget
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.UiModel
import org.wordpress.android.ui.stats.refresh.lists.sections.BaseStatsUseCase
import org.wordpress.android.ui.stats.refresh.lists.sections.BaseStatsUseCase.UseCaseModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import org.wordpress.android.fluxc.store.StatsStore.PostDetailType
import org.wordpress.android.fluxc.store.stats.PostDetailStore
import org.wordpress.android.modules.BG_THREAD
import org.wordpress.android.modules.UI_THREAD
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.DETAIL
import org.wordpress.android.ui.stats.refresh.lists.detail.PostDayViewsUseCase.UiState
import org.wordpress.android.ui.stats.refresh.lists.sections.BaseStatsUseCase
import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import org.wordpress.android.fluxc.store.StatsStore.StatsType
import org.wordpress.android.ui.stats.refresh.lists.sections.BaseStatsUseCase.StatelessUseCase
import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem
import org.wordpress.android.ui.stats.refresh.utils.StatsSiteProvider
import org.wordpress.android.ui.stats.refresh.utils.toStatsSection
import java.util.Date

abstract class GranularStatelessUseCase<DOMAIN_MODEL>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ import org.wordpress.android.fluxc.network.utils.StatsGranularity.MONTHS
import org.wordpress.android.fluxc.network.utils.StatsGranularity.WEEKS
import org.wordpress.android.fluxc.network.utils.StatsGranularity.YEARS
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.ANNUAL_STATS
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.DETAIL
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.INSIGHTS
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.TOTAL_COMMENTS_DETAIL
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.TOTAL_FOLLOWERS_DETAIL
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.TOTAL_LIKES_DETAIL
import javax.inject.Inject

const val SELECTED_SECTION_KEY = "SELECTED_STATS_SECTION_KEY"
Expand Down Expand Up @@ -47,7 +42,13 @@ class SelectedSectionManager

fun StatsSection.toStatsGranularity(): StatsGranularity? {
return when (this) {
StatsSection.TRAFFIC, ANNUAL_STATS, DETAIL, TOTAL_LIKES_DETAIL, TOTAL_COMMENTS_DETAIL, TOTAL_FOLLOWERS_DETAIL, INSIGHTS -> null
StatsSection.TRAFFIC,
StatsSection.ANNUAL_STATS,
StatsSection.DETAIL,
StatsSection.TOTAL_LIKES_DETAIL,
StatsSection.TOTAL_COMMENTS_DETAIL,
StatsSection.TOTAL_FOLLOWERS_DETAIL,
StatsSection.INSIGHTS -> null
StatsSection.INSIGHT_DETAIL,
StatsSection.DAYS -> DAYS
StatsSection.WEEKS -> WEEKS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class StatsDateSelectorTest : BaseUnitTest() {
@Before
fun setUp() {
dateProviderSelectedDate.value = GranularityChange(statsGranularity)
whenever(selectedDateProvider.granularSelectedDateChanged(statsGranularity)).thenReturn(dateProviderSelectedDate)
whenever(selectedDateProvider.granularSelectedDateChanged(statsGranularity))
.thenReturn(dateProviderSelectedDate)

dateSelector = StatsDateSelector(
selectedDateProvider,
Expand Down

0 comments on commit e910a02

Please sign in to comment.