Skip to content

fix: replace var with const/let and add radix to parseInt in _spaceCatcher #52

@coderabbitai

Description

@coderabbitai

Summary

Pre-existing SonarCloud findings in _spaceCatcher (l2t-paper-slider.js) that were present on master before PR #51 are now surfacing in the SonarCloud diff analysis for that PR because the function was modified.

Findings

  1. var declaration (SonarCloud failure): var nextPos should be const nextPos (or let if reassigned).
  2. parseInt without explicit radix (SonarCloud warning): parseInt(nextPos) should be Number.parseInt(nextPos, 10).

Impact

The var finding is a SonarCloud failure (not merely a warning) and may block the quality gate on any future PR that touches this function.

Suggested fix

const nextPos = activeEl.getAttribute('aria-posinset');
if (nextPos) this.movePos(Number.parseInt(nextPos, 10) - 1);

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions