
| Audited | JakeWharton/timber at commit 988c9a5917f11e10543df77c18ca3cb754ce9292 |
|---|---|
| Date | 11 October 2026 (audited again; first audit 11 October 2026) |
| How it ran | local run on our workstation, full audit, Standard review |
| Verdict after review | Pass with notes (Fail if a High finding remains after review, otherwise Pass with notes) |
Compared with the first audit
Same commit as the first audit: the project's default branch has no later commits (checked 11 October 2026), so nothing could have been fixed upstream in between. Each finding of the first audit (11 October 2026) was checked again against the code audited now. 18 findings in the first audit; 18 still open (6 found again, 12 not reported again but still present). This audit has 10 findings after review, 4 of them new.
| First audit | Finding | Reviewed rating then | Now | In this audit |
|---|---|---|---|---|
| #1 | KAPT in lint module | Info | Still open | #1 |
| #2 | Stale lint baseline | Info | Still open | #3 |
| #3 | Sample uses legacy DSL | Info | Still open | not reported again |
| #4 | Tree list/snapshot sync at 4 sites | Info | Still open | not reported again |
| #5 | Format scanner has no size or work limit | Info | Still open | not reported again |
| #6 | Detector file mixes concerns | Low | Still open | #5 |
| #7 | Lint test class very large | Info | Still open | not reported again |
| #8 | Format-scan loop duplicated, drifted | Low | Still open | not reported again |
| #9 | Tag release publishes without build/test | Low | Still open | #7 |
| #10 | Duplicate arg-count report | Info | Still open | not reported again |
| #11 | Fan-out repetition | Info | Still open | #9 |
| #12 | Release workflow targets nonexistent mosaic | Medium | Still open | #10 |
| #13 | RELEASING.md contradicts CI | Low | Still open | not reported again |
| #14 | Chunking by chars, non-ASCII truncated | Low | Still open | not reported again |
| #15 | One-shot tag leaks if a tree throws | Low | Still open | not reported again |
| #16 | Malformed format string throws from log call | Low | Still open | not reported again |
| #17 | Lint false errors on positional args | Low | Still open | not reported again |
| #18 | Concat quick fix emits unescaped % | Low | Still open | not reported again |
Each finding keeps the number it has in the audit report. The rating shown first is the one after review; the first automated rating is listed with it. 2 findings were first rated Medium or High; 2 of them are Medium or High after review. Text marked "From the report" is quoted from the audit report; fixes are suggestions and were not tested. Code locations link to the file and line at the audited commit.
Medium after review (2)
From the report
evaluator.isMemberInClass(method, "timber.log.Timber.Companion") ||
The shipped library's companion object is named Forest (actual companion object Forest : Tree() in timber/src/androidMain/kotlin/timber/log/Timber.kt:278; the public API file lists timber/log/Timber$Forest). No timber.log.Timber.Companion class exists, so this check can never match the real library. The tests (WrongTimberUsageDetectorTest.kt:12–29) run against a hand-written stub that declares an unnamed companion object, which is called Companion. They pass whether or not the detector recognizes calls on the real library. If Kotlin call sites resolve to the Forest members, the argument-count, argument-type and exception-logging checks will not run for them, and no test will catch it.
Add "timber.log.Timber.Forest" to isTimberLogMethod. Make the test stub match the real API (name the companion Forest), or generate it from the real Timber.kt. Then the tests fail if the names drift again.
Review: The match is at :114, and the real companion is Forest (Timber.kt:278, timber.api lists Timber$Forest). The stub (test :12-29) declares an unnamed, private companion. Extra support: tagTooLongLiteralOnly (test :1102-1144) puts a Kotlin Timber.tag(...) over 23 chars in the files, yet expects only the Java hit. That is consistent with Kotlin calls resolving to the companion class. Not run in real lint, so the real-library effect is by inference. Gaps in the report: the :89 tag-length check has no companion alternative at all, so its fix must cover Forest there too.
.github/workflows/release.yaml:23From the report
- run: ./gradlew -p mosaic publish
settings.gradle includes only :timber, :timber-lint and :timber-sample, and no mosaic directory exists in the repository. This looks like a step copied from another project. Every tag push fails at this step, so nothing is published to Maven Central. The later steps that extract release notes, create the GitHub release and deploy the versioned docs never run either.
Replace it with ./gradlew publish, the same command build.yaml uses, or with the intended module's publish task. Exercise the release job once, with a dry run or a test tag, before relying on it.
Review: Steps :29-48 follow it. Not run. Affects maintainers' CI path only.
Low after review (3)
From the report
if (expression is PsiMethodCallExpression) {
val call = expression as PsiMethodCallExpression
getType receives a UAST UExpression, not a raw PSI node. The PsiMethodCallExpression and PsiLiteralExpression branches, including the special case for getString (lines 342–360), cannot match. A reader would expect getString(...) results to be treated as strings, but that never happens.
Handle UCallExpression / ULiteralExpression instead (for example resolve() and check the method name). Or delete the dead branches so the code does not suggest behaviour it does not have.
Review: as dead code. getType takes a UExpression, so is PsiMethodCallExpression (:342) and is PsiLiteralExpression (:349) cannot match a UAST node. The "getString never treated as string" consequence is overstated: the fallback at :362-366 returns the same classes (String, int, float, char, boolean, null), so behaviour is identical.
From the report
class WrongTimberUsageDetector : Detector(), UastScanner {
One class holds call visiting, format-string parsing and type matching (about 330 lines, lines 166–498), quick-fix builders (lines 693–828) and the issue declarations. At this size, changes to one concern are easy to tangle with another, and the format-string logic cannot be tested on its own.
Move format-string counting and type checking into a separate helper, and the quick-fix builders into another. The detector keeps only the visit-and-report flow.
.github/workflows/release.yaml:23From the report
- run: ./gradlew -p mosaic publish
The build workflow skips tags (tags-ignore: '**'), and the release workflow only publishes. A tag on a commit that was never built and tested can reach Maven Central with no test, ABI or lint check on that exact commit.
Run ./gradlew build before publish in release.yaml, or make the release job require a green build of the tagged SHA.
Review: Nuance: build.yaml does run on trunk pushes (:6-8), so the commit is usually built, just not as a gate.
Info after review (5)
timber-lint/build.gradle:2 (and line 18)From the report
apply plugin: 'org.jetbrains.kotlin.kapt'
kapt libs.auto.service
KAPT is the legacy annotation-processing path for Kotlin. It is slower, has weaker incremental-build support, and is in maintenance mode. Here it is used only to generate the service-registration file for the lint registry.
Move to KSP with a KSP-capable service-registration processor. Or drop the processor and hand-write META-INF/services/com.android.tools.lint.client.api.IssueRegistry.
gradle.properties:20. The file has no android.enableJetifier entry, and none was found anywhere in the tree.From the report
org.gradle.jvmargs=-Xmx1536M
The project is fully on AndroidX, so Jetifier does nothing useful. If anything turns it on, it rewrites dependencies on every build and slows builds a lot. Stating the setting makes the intent explicit and independent of plugin defaults.
Add android.enableJetifier=false to gradle.properties.
timber-lint/lint-baseline.xml:2From the report
<issues format="6" by="lint 8.12.0" type="baseline" client="gradle" ... version="8.12.0">
The build now uses Android Gradle Plugin 9.4.1, which ships lint tools 32.4.1. The baseline line numbers have also drifted: one entry points at line 760 of the detector, but that text is now at line 850. A baseline from another tool version hides issues and can silently stop matching. The build then either reports issues that were meant to be suppressed or suppresses the wrong ones.
Delete and regenerate the baseline in a clean CI build with the lint version in use, and review what it suppresses. Or fix the baselined issues and remove the file.
Review: is the mechanism the earlier review showed wrong: baseline matching uses message and path, not line number)
timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt:151 (also lines 801, 806 and the issue text at 903)From the report
if (tag != null && tag.length > 23) {
...
val numCharsToTrim = tag.length - 23
The library has its own MAX_TAG_LENGTH = 23 (timber/src/androidMain/kotlin/timber/log/Timber.kt:273), and the lint module repeats the bare number in several places. If the limit or the check logic changes, the copies can drift apart.
Declare one named constant in the lint module and use it everywhere there. Add a test that keeps it equal to the library's value.
From the report
@JvmStatic
override fun v(@NonNls message: String?, vararg args: Any?) {
treeArray.forEach { it.v(message, *args) }
Observation: All 21 level/overload methods appear once in Tree and again in the Forest facade. This is a deliberate public-API and Java-compatibility choice, and the ABI checks enforce it. A short code comment recording this would stop later reviews from flagging it as duplication.