Skip to content

refactor: introduce ArtCacheManager with artwork resizing and size-ba…

a41575f
Select commit
Loading
Failed to load commit list.
Open

Add Android Auto Support with Improvements to Album Art Handling #890

refactor: introduce ArtCacheManager with artwork resizing and size-ba…
a41575f
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Code Health Review (beta) failed Apr 28, 2026 in 30s

CodeScene PR Check

Quality Gate Failed

Code Health Improved (1 files improve in Code Health)

Gates Failed
Prevent hotspot decline (1 hotspot with Complex Method)
New code is healthy (2 new files with code health below 9.00)
Enforce critical code health rules (2 files with Bumpy Road Ahead)

See analysis details in CodeScene

Reason for failure
Prevent hotspot decline Violations Code Health Impact
GramophonePlaybackService.kt 1 rule in this hotspot 4.82 → 4.75 Suppress
New code is healthy Violations Code Health Impact
ArtResolver.kt 5 rules 7.52 Suppress
GramophoneLibrarySessionCallback.kt 3 rules 7.84 Suppress
Enforce critical code health rules Violations Code Health Impact
ArtResolver.kt 1 critical rule 7.52 Suppress
ArtCacheManager.kt 1 critical rule 9.54 Suppress
View Improvements
File Code Health Impact Categories Improved
GramophoneApplication.kt 7.76 → 8.28 Complex Method

Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Method GramophonePlaybackService.kt: GramophonePlaybackService.onCreate 🔥
  • Overall Code Complexity GramophoneLibrarySessionCallback.kt
  • Overall Code Complexity ArtResolver.kt
  • Complex Method GramophoneLibrarySessionCallback.kt: GramophoneLibrarySessionCallback.onGetItem
  • Complex Method GramophoneLibrarySessionCallback.kt: GramophoneLibrarySessionCallback.onAddMediaItems
  • Complex Conditional ArtResolver.kt: ArtResolver.extractSongThumbnail
  • Complex Method GramophoneLibrarySessionCallback.kt: GramophoneLibrarySessionCallback.onGetChildren
  • Complex Method ArtResolver.kt: ArtResolver.openResourceStream
  • Complex Method ArtResolver.kt: ArtResolver.getResolutionList
  • Primitive Obsession ArtResolver.kt
  • Complex Method ArtResolver.kt: ArtResolver.decodeAndResize
  • Excess Number of Function Arguments GramophoneLibrarySessionCallback.kt: GramophoneLibrarySessionCallback.onGetChildren
  • Excess Number of Function Arguments GramophoneLibrarySessionCallback.kt: GramophoneLibrarySessionCallback.onGetSearchResult
  • Bumpy Road Ahead ArtCacheManager.kt: ArtCacheManager.trimCacheIfNeeded
  • Bumpy Road Ahead ArtResolver.kt: ArtResolver.getResolutionList
  • Bumpy Road Ahead ArtResolver.kt: ArtResolver.openResourceStream
  • Bumpy Road Ahead ArtResolver.kt: ArtResolver.decodeAndResize

✅ Improving Code Health:

  • Overall Code Complexity GramophonePlaybackService.kt 🔥
  • Complex Method GramophoneApplication.kt: GramophoneApplication.newImageLoader 🔥

Annotations

Check warning on line 550 in app/src/main/java/org/akanework/gramophone/logic/GramophonePlaybackService.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ Getting worse: Complex Method

GramophonePlaybackService.onCreate already has high cyclomatic complexity, and now it increases in Lines of Code from 311 to 341. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check notice on line 1 in app/src/main/java/org/akanework/gramophone/logic/GramophonePlaybackService.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

✅ Getting better: Overall Code Complexity

The mean cyclomatic complexity decreases from 4.91 to 4.73, threshold = 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.

Check notice on line 275 in app/src/main/java/org/akanework/gramophone/logic/GramophoneApplication.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

✅ Getting better: Complex Method

GramophoneApplication.newImageLoader decreases in cyclomatic complexity from 27 to 16, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check warning on line 239 in app/src/main/java/org/akanework/gramophone/logic/GramophoneLibrarySessionCallback.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Complex Method

GramophoneLibrarySessionCallback.onGetItem has a cyclomatic complexity of 21, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check warning on line 376 in app/src/main/java/org/akanework/gramophone/logic/GramophoneLibrarySessionCallback.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Complex Method

GramophoneLibrarySessionCallback.onAddMediaItems has a cyclomatic complexity of 17, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check warning on line 159 in app/src/main/java/org/akanework/gramophone/logic/GramophoneLibrarySessionCallback.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Complex Method

GramophoneLibrarySessionCallback.onGetChildren has a cyclomatic complexity of 15, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check warning on line 1 in app/src/main/java/org/akanework/gramophone/logic/GramophoneLibrarySessionCallback.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Overall Code Complexity

This module has a mean cyclomatic complexity of 4.93 across 15 functions. The mean complexity threshold is 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.

Check warning on line 159 in app/src/main/java/org/akanework/gramophone/logic/GramophoneLibrarySessionCallback.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Excess Number of Function Arguments

GramophoneLibrarySessionCallback.onGetChildren has 6 arguments, max arguments = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 305 in app/src/main/java/org/akanework/gramophone/logic/GramophoneLibrarySessionCallback.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Excess Number of Function Arguments

GramophoneLibrarySessionCallback.onGetSearchResult has 6 arguments, max arguments = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 135 in app/src/main/java/org/akanework/gramophone/logic/utils/ArtCacheManager.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Bumpy Road Ahead

ArtCacheManager.trimCacheIfNeeded has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is 2 blocks per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.

Check warning on line 187 in app/src/main/java/org/akanework/gramophone/logic/utils/ArtResolver.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Complex Method

ArtResolver.openResourceStream has a cyclomatic complexity of 13, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check warning on line 122 in app/src/main/java/org/akanework/gramophone/logic/utils/ArtResolver.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Complex Method

ArtResolver.getResolutionList has a cyclomatic complexity of 12, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check warning on line 230 in app/src/main/java/org/akanework/gramophone/logic/utils/ArtResolver.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Complex Method

ArtResolver.decodeAndResize has a cyclomatic complexity of 10, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check warning on line 288 in app/src/main/java/org/akanework/gramophone/logic/utils/ArtResolver.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Complex Conditional

ArtResolver.extractSongThumbnail has 1 complex conditionals with 3 branches, threshold = 2. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.

Check warning on line 122 in app/src/main/java/org/akanework/gramophone/logic/utils/ArtResolver.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Bumpy Road Ahead

ArtResolver.getResolutionList has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is 2 blocks per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.

Check warning on line 187 in app/src/main/java/org/akanework/gramophone/logic/utils/ArtResolver.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Bumpy Road Ahead

ArtResolver.openResourceStream has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is 2 blocks per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.

Check warning on line 230 in app/src/main/java/org/akanework/gramophone/logic/utils/ArtResolver.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Bumpy Road Ahead

ArtResolver.decodeAndResize has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is 2 blocks per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.

Check warning on line 1 in app/src/main/java/org/akanework/gramophone/logic/utils/ArtResolver.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Overall Code Complexity

This module has a mean cyclomatic complexity of 5.45 across 11 functions. The mean complexity threshold is 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.

Check warning on line 1 in app/src/main/java/org/akanework/gramophone/logic/utils/ArtResolver.kt

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (beta)

❌ New issue: Primitive Obsession

In this module, 65.2% of all function arguments are primitive types, threshold = 30.0%. The functions in this file have too many primitive types (e.g. int, double, float) in their function argument lists. Using many primitive types lead to the code smell Primitive Obsession. Avoid adding more primitive arguments.