Skip to content

Instantly share code, notes, and snippets.

@helium-service
Created June 24, 2025 16:36
Show Gist options
  • Save helium-service/ee62cd71a12d8b77fbfb350567378269 to your computer and use it in GitHub Desktop.
Save helium-service/ee62cd71a12d8b77fbfb350567378269 to your computer and use it in GitHub Desktop.
Detekt Report for PR #2230 Timestamp 1750782947

detekt

Metrics

  • 9 number of properties

  • 34 number of functions

  • 7 number of classes

  • 3 number of packages

  • 3 number of kt files

Complexity Report

  • 371 lines of code (loc)

  • 288 source lines of code (sloc)

  • 183 logical lines of code (lloc)

  • 36 comment lines of code (cloc)

  • 43 cyclomatic complexity (mcc)

  • 10 cognitive complexity

  • 9 number of total code smells

  • 12% comment source ratio

  • 234 mcc per 1,000 lloc

  • 49 code smells per 1,000 lloc

Findings (9)

complexity, TooManyFunctions (1)

Too many functions inside a/an file/class/object/interface always indicate a violation of the single responsibility principle. Maybe the file/class/object/interface wants to manage too many things at once. Extract functionality which clearly belongs together.

Documentation

  • /Users/cbx/actions-runner2/_work/helium-android/helium-android/ChartboostMonetization/src/main/java/com/chartboost/sdk/internal/BannerRenderingPipelineCoordinator.kt:20:16
Class 'BannerRenderingPipelineCoordinator' with '13' functions detected. Defined threshold inside classes is set to '11'
17 import java.util.concurrent.TimeoutException
18 import com.chartboost.sdk.callbacks.BannerCallback as BannerCallbackType
19 
20 internal class BannerRenderingPipelineCoordinator(
!!                ^ error
21     api: BannerApi,
22     callback: BannerCallbackType,
23     banner: Banner,

exceptions, TooGenericExceptionCaught (1)

The caught exception is too generic. Prefer catching specific exceptions to the case that is currently handled.

Documentation

  • /Users/cbx/actions-runner2/_work/helium-android/helium-android/ChartboostMonetization/src/main/java/com/chartboost/sdk/ads/Banner.kt:117:18
The caught exception is too generic. Prefer catching specific exceptions to the case that is currently handled.
114                     CacheError(CacheError.Code.SESSION_NOT_STARTED),
115                 )
116             }
117         } catch (e: Exception) {
!!!                  ^ error
118             Logger.e("Banner ad cannot post session not started callback $e")
119         }
120     }

style, MagicNumber (6)

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

Documentation

  • /Users/cbx/actions-runner2/_work/helium-android/helium-android/ChartboostMonetization/src/main/java/com/chartboost/sdk/ads/Banner.kt:128:18
This expression contains a magic number. Consider defining it to a well named constant.
125      */
126     enum class BannerSize(val width: Int, val height: Int) {
127         /** "Banner" - Standard banner size on phones. */
128         STANDARD(320, 50),
!!!                  ^ error
129 
130         /** "Medium Rect" - Medium banner size on phones. */
131         MEDIUM(300, 250),
  • /Users/cbx/actions-runner2/_work/helium-android/helium-android/ChartboostMonetization/src/main/java/com/chartboost/sdk/ads/Banner.kt:128:23
This expression contains a magic number. Consider defining it to a well named constant.
125      */
126     enum class BannerSize(val width: Int, val height: Int) {
127         /** "Banner" - Standard banner size on phones. */
128         STANDARD(320, 50),
!!!                       ^ error
129 
130         /** "Medium Rect" - Medium banner size on phones. */
131         MEDIUM(300, 250),
  • /Users/cbx/actions-runner2/_work/helium-android/helium-android/ChartboostMonetization/src/main/java/com/chartboost/sdk/ads/Banner.kt:131:16
This expression contains a magic number. Consider defining it to a well named constant.
128         STANDARD(320, 50),
129 
130         /** "Medium Rect" - Medium banner size on phones. */
131         MEDIUM(300, 250),
!!!                ^ error
132 
133         /** "Tablet" - Leaderboard banner size on tablets. */
134         LEADERBOARD(728, 90),
  • /Users/cbx/actions-runner2/_work/helium-android/helium-android/ChartboostMonetization/src/main/java/com/chartboost/sdk/ads/Banner.kt:131:21
This expression contains a magic number. Consider defining it to a well named constant.
128         STANDARD(320, 50),
129 
130         /** "Medium Rect" - Medium banner size on phones. */
131         MEDIUM(300, 250),
!!!                     ^ error
132 
133         /** "Tablet" - Leaderboard banner size on tablets. */
134         LEADERBOARD(728, 90),
  • /Users/cbx/actions-runner2/_work/helium-android/helium-android/ChartboostMonetization/src/main/java/com/chartboost/sdk/ads/Banner.kt:134:21
This expression contains a magic number. Consider defining it to a well named constant.
131         MEDIUM(300, 250),
132 
133         /** "Tablet" - Leaderboard banner size on tablets. */
134         LEADERBOARD(728, 90),
!!!                     ^ error
135     }
136 }
137 
  • /Users/cbx/actions-runner2/_work/helium-android/helium-android/ChartboostMonetization/src/main/java/com/chartboost/sdk/ads/Banner.kt:134:26
This expression contains a magic number. Consider defining it to a well named constant.
131         MEDIUM(300, 250),
132 
133         /** "Tablet" - Leaderboard banner size on tablets. */
134         LEADERBOARD(728, 90),
!!!                          ^ error
135     }
136 }
137 

style, MaxLineLength (1)

Line detected, which is longer than the defined maximum line length in the code style.

Documentation

  • /Users/cbx/actions-runner2/_work/helium-android/helium-android/ChartboostMonetization/src/main/java/com/chartboost/sdk/ads/Banner.kt:61:1
Line detected, which is longer than the defined maximum line length in the code style.
58 ) : FrameLayout(context), Ad {
59     private val api: BannerApi by lazy { createBannerApi(mediation) }
60 
61     private val adController: IAdController = BannerRenderingPipelineCoordinator(api, callback, this, ChartboostDependencyContainer)
!! ^ error
62 
63     override fun cache() {
64         if (!Chartboost.isSdkStarted()) {

generated with detekt version 1.23.5 on 2025-06-24 16:36:49 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment