Skip to content

Commit 7289664

Browse files
committed
Analysis: Move complex method warnings from baseline and close to source
This was done because those warnings are line based and since these files got updated from previous commits they are now complaining again. Thus, removing them from the baseline and moving them explicitly, inline/close to source makes it so that this problem will never happen again for those specific cases.
1 parent 57ab46a commit 7289664

4 files changed

Lines changed: 3 additions & 6 deletions

File tree

WordPress/src/main/java/org/wordpress/android/ui/posts/PostListDialogHelper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class PostListDialogHelper(
151151
showDialog.invoke(dialogHolder)
152152
}
153153

154-
@Suppress("LongParameterList")
154+
@Suppress("LongParameterList", "ComplexMethod")
155155
fun onPositiveClickedForBasicDialog(
156156
instanceTag: String,
157157
trashPostWithLocalChanges: (Int) -> Unit,

WordPress/src/main/java/org/wordpress/android/viewmodel/pages/CreatePageListItemLabelsUseCase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CreatePageListItemLabelsUseCase @Inject constructor(
5353
return Pair(labels, labelColor)
5454
}
5555

56-
@Suppress("LongParameterList")
56+
@Suppress("LongParameterList", "ComplexMethod")
5757
private fun getLabels(
5858
postStatus: PostStatus,
5959
isLocalDraft: Boolean,

WordPress/src/main/java/org/wordpress/android/viewmodel/posts/PostListItemUiStateHelper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ class PostListItemUiStateHelper @Inject constructor(
362362
(!appPrefsWrapper.isAztecEditorEnabled && uploadUiState is UploadingMedia))
363363
}
364364

365-
@Suppress("LongParameterList")
365+
@Suppress("LongParameterList", "ComplexMethod")
366366
private fun createButtonTypes(
367367
postStatus: PostStatus,
368368
isLocalDraft: Boolean,

config/detekt/baseline.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<ID>ComplexMethod:BlockListAdapter.kt$BlockListAdapter$override fun onBindViewHolder(holder: BlockListItemViewHolder, position: Int, payloads: List&lt;Any>)</ID>
1414
<ID>ComplexMethod:BlockListAdapter.kt$BlockListAdapter$override fun onCreateViewHolder(parent: ViewGroup, itemType: Int): BlockListItemViewHolder</ID>
1515
<ID>ComplexMethod:CreatePageListItemActionsUseCase.kt$CreatePageListItemActionsUseCase$fun setupPageActions( listType: PageListType, uploadUiState: PostUploadUiState, siteModel: SiteModel, remoteId: Long ): Set&lt;Action></ID>
16-
<ID>ComplexMethod:CreatePageListItemLabelsUseCase.kt$CreatePageListItemLabelsUseCase$private fun getLabels( postStatus: PostStatus, isLocalDraft: Boolean, isLocallyChanged: Boolean, uploadUiState: PostUploadUiState, hasUnhandledConflicts: Boolean, hasAutoSave: Boolean ): List&lt;UiString></ID>
1716
<ID>ComplexMethod:EditorTracker.kt$EditorTracker$@JvmOverloads fun trackEditorEvent( event: TrackableEvent, editorName: String, properties: Map&lt;String, String> = mapOf() )</ID>
1817
<ID>ComplexMethod:FormattableContentClickHandler.kt$FormattableContentClickHandler$fun onClick( activity: FragmentActivity, clickedSpan: FormattableRange, source: String )</ID>
1918
<ID>ComplexMethod:HomepageSettingsDialog.kt$HomepageSettingsDialog$override fun onCreateDialog(savedInstanceState: Bundle?): Dialog</ID>
@@ -24,8 +23,6 @@
2423
<ID>ComplexMethod:NoticonUtils.kt$NoticonUtils$fun noticonToGridicon(noticon: String): Int</ID>
2524
<ID>ComplexMethod:PostActionHandler.kt$PostActionHandler$fun handlePostButton(buttonType: PostListButtonType, post: PostModel, hasAutoSave: Boolean)</ID>
2625
<ID>ComplexMethod:PostListActionTracker.kt$fun trackPostListAction(site: SiteModel, buttonType: PostListButtonType, postData: PostModel, statsEvent: Stat)</ID>
27-
<ID>ComplexMethod:PostListDialogHelper.kt$PostListDialogHelper$fun onPositiveClickedForBasicDialog( instanceTag: String, trashPostWithLocalChanges: (Int) -> Unit, trashPostWithUnsavedChanges: (Int) -> Unit, deletePost: (Int) -> Unit, publishPost: (Int) -> Unit, updateConflictedPostWithRemoteVersion: (Int) -> Unit, editRestoredAutoSavePost: (Int) -> Unit, moveTrashedPostToDraft: (Int) -> Unit, resolveConflictsAndEditPost: (Int) -> Unit )</ID>
28-
<ID>ComplexMethod:PostListItemUiStateHelper.kt$PostListItemUiStateHelper$private fun createButtonTypes( postStatus: PostStatus, isLocalDraft: Boolean, isLocallyChanged: Boolean, uploadUiState: PostUploadUiState, siteHasCapabilitiesToPublish: Boolean, statsSupported: Boolean ): List&lt;PostListButtonType></ID>
2926
<ID>ComplexMethod:ReaderPostDetailFragment.kt$ReaderPostDetailFragment$private fun ReaderNavigationEvents.handleNavigationEvent()</ID>
3027
<ID>ComplexMethod:ReferrersUseCase.kt$ReferrersUseCase$override fun buildUiModel(domainModel: ReferrersModel, uiState: SelectedGroup): List&lt;BlockListItem></ID>
3128
<ID>ComplexMethod:SystemNotificationsTracker.kt$SystemNotificationsTracker$private fun NotificationType.toTypeValue(): String</ID>

0 commit comments

Comments
 (0)