wordpress-mobile / wordpress-mobile/WordPress-Android

The `getWordCount` method should return 0 when given an empty string

Open Beginner friendly
#11,342 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Type] Bug Posting/Editing
Dominant language
Kotlin
Stars
3.2k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
69

Description

Currently it returns 1 when the string is empty. Word count precision is not super important, except for empty posts (we would like to count them).

https://github.com/wordpress-mobile/WordPress-Android/blob/78cfb8812c6fb0edb608bee18cfe59ea64cb47f1/WordPress/src/main/java/org/wordpress/android/util/analytics/AnalyticsUtils.java#L163-L167

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in WordPress/src/main/java/org/wordpress/android/util/analytics/AnalyticsUtils.java at getWordCount, referenced by the issue. Check the current empty-string behavior and make the smallest change needed so an empty string returns 0; done means the method returns 0 for empty input without changing the stated behavior for other strings.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.