# Unclear rule short description for Web:S6853

**URL:** <https://community.sonarsource.com/t/unclear-rule-short-description-for-web-s6853/115379>\
**Category:** New rules / language support\
**Tags:** sonarqube\
**Created:** [May 15, 2024, 10:31am UTC](https://community.sonarsource.com/t/unclear-rule-short-description-for-web-s6853/115379 "2024-05-15T10:31:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![m-gallesio](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/m-gallesio/32/31534_2.png) [@m-gallesio](https://community.sonarsource.com/u/m-gallesio)\
**Post date:** [May 15, 2024, 10:31am UTC](https://community.sonarsource.com/t/unclear-rule-short-description-for-web-s6853/115379/1 "2024-05-15T10:31:46Z")

</div>

Version: SonarQube v10.5 (89998)  
Rule: [S6853: Label elements should have a text label and an associated control](https://rules.sonarsource.com/html/RSPEC-6853/)

This code triggers the rule:

```html
<label class="btn btn-white">
    <input type="checkbox"
               id="cb_${item.id}"
               name="id"
               value.bind="item.id"
               checked.bind="selectedItems">
</label>

```

By reading the rule I think it is because there is no text content in the `label`.  
However the short rule description in **SonarQube’s issue list** is simply:

> A form label must be associated with a control.

This works well when there is no control / `for` attribute, but in the specific case I mentioned it seems quite unclear. By contrast, the full rule name clearly mentions the “text” part of the label.

---

<div class="post-metadata">

**Author:** ![eric.morand](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/eric.morand/32/54232_2.png) [@eric.morand](https://community.sonarsource.com/u/eric.morand)\
**Post date:** [June 4, 2024, 7:09am UTC](https://community.sonarsource.com/t/unclear-rule-short-description-for-web-s6853/115379/4 "2024-06-04T07:09:36Z")

</div>

Hi @m-gallesio , thanks a lot for the report. You are right, the short description misses the part about the text, which makes it not very helpful.

You can find the issue that tracks this needed improvement here: [[SONARHTML-254] - Jira](https://sonarsource.atlassian.net/browse/SONARHTML-254).

Again, thanks a lot.

---

<div class="post-metadata">

**Author:** ![DaBeck](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dabeck/32/65660_2.png) [@DaBeck](https://community.sonarsource.com/u/DaBeck)\
**Post date:** [January 8, 2025, 9:35am UTC](https://community.sonarsource.com/t/unclear-rule-short-description-for-web-s6853/115379/8 "2025-01-08T09:35:30Z")

</div>

For anybody comming here to see how to get the rule to go away for labels without text. This is the solution that I ended up using:

```auto
<div class="custom-control custom-switch">
	<input
		type="checkbox"
		name="mySwitch"
		class="custom-control-input"
		id="mySwitch"
	/>
	<label class="custom-control-label" for="mySwitch">&nbsp;</label>
</div>

```

Setting `&nbsp;` as text for the label seems to get past the rule
