android / tv-samples
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 1,179 units with 10,291 lines of code in units (55.9% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (34 lines of code)
    • 4 medium complex units (199 lines of code)
    • 38 simple units (1,262 lines of code)
    • 1,136 very simple units (8,796 lines of code)
0% | <1% | 1% | 12% | 85%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
java0% | <1% | 2% | 13% | 84%
py0% | 0% | 9% | 6% | 84%
kt0% | 0% | 0% | 5% | 94%
ts0% | 0% | 0% | 31% | 68%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
LeanbackShowcase/app0% | <1% | 2% | 13% | 82%
ReferenceAppKotlin/scripts0% | 0% | 22% | 14% | 62%
Leanback/app0% | 0% | 0% | 13% | 86%
AccessibilityDemo/app0% | 0% | 0% | 11% | 88%
ClassicsKotlin/app0% | 0% | 0% | 21% | 78%
ReferenceAppKotlin/firebase0% | 0% | 0% | 29% | 70%
ReferenceAppKotlin/app0% | 0% | 0% | 0% | 100%
LeanbackShowcase/server0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public boolean equals()
in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/room/db/entity/VideoEntity.java
34 29 1
public Presenter getPresenter()
in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/cards/presenters/CardPresenterSelector.java
55 20 1
public void onItemClicked()
in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/MainFragment.java
93 16 4
def main()
in ReferenceAppKotlin/scripts/atv-create-media-feed.py
34 16 0
public int hashCode()
in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/room/db/entity/VideoEntity.java
17 14 0
protected Void doInBackground()
in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/room/ui/VideoCardPresenter.java
39 10 1
protected void prefetch()
in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/media/PlaybackSeekAsyncDataProvider.java
23 10 2
override fun onCreate()
in ClassicsKotlin/app/src/main/java/com/android/tv/classics/fragments/NowPlayingFragment.kt
51 10 1
public long onGuidedActionEditedAndProceed()
in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/wizard/WizardNewPaymentStepFragment.java
36 9 1
private static long downloadFromNetworkHelper()
in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/room/network/NetworkManagerUtil.java
58 9 3
private String findLocalContentUriOrNetworkUrl()
in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/room/controller/detail/LiveDataDetailViewWithVideoBackgroundFragment.java
35 9 1
public void playMediaItem()
in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/media/MusicPlaybackService.java
27 9 1
private void bind()
in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/room/ui/VideoCardPresenter.java
31 8 1
private void fetchVideosInfo()
in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/grid/VideoGridExampleFragment.java
47 8 1
def main()
in ReferenceAppKotlin/scripts/atv-csv-to-json.py
22 8 0
public void onLoadFinished()
in Leanback/app/src/main/java/com/example/android/tvleanback/ui/PlaybackFragment.java
18 7 2
public void onItemClicked()
in Leanback/app/src/main/java/com/example/android/tvleanback/ui/MainFragment.java
40 7 4
public boolean onGenericMotionEvent()
in Leanback/app/src/main/java/com/example/android/tvleanback/ui/PlaybackActivity.java
15 7 1
protected void onHandleIntent()
in Leanback/app/src/main/java/com/example/android/tvleanback/recommendation/UpdateRecommendationsService.java
47 7 1
public void onDownloadingCompleted()
in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/room/controller/overview/LiveDataFragment.java
67 7 1