Skip to content

fix: remove unused className prop from AnchorTitle component#3822

Merged
arkid15r merged 5 commits intoOWASP:mainfrom
lavanyayadawad30-lab:fix/remove-unused-classname-prop-3805
Feb 10, 2026
Merged

fix: remove unused className prop from AnchorTitle component#3822
arkid15r merged 5 commits intoOWASP:mainfrom
lavanyayadawad30-lab:fix/remove-unused-classname-prop-3805

Conversation

@lavanyayadawad30-lab
Copy link
Contributor

@lavanyayadawad30-lab lavanyayadawad30-lab commented Feb 7, 2026

Proposed change

Resolves #3805

This PR fixes a SonarCloud code smell in frontend/src/components/AnchorTitle.tsx where the className prop was defined in AnchorTitleProps but never used in the component.

The unused prop has been removed to improve code clarity and maintainability and to resolve Sonar rule typescript:S6767.
No functional behavior is changed.

Checklist:-
✅I followed the contributing workflow
✅ I verified that my code works as intended and resolves the issue as described
✅I ran checks locally (or verified no additional tests were required for this change)
❌ I used AI for code, documentation, tests, or communication related to this PR

Fixes OWASP#3805

The className prop was defined in AnchorTitleProps but never used
in the component implementation. Removing it resolves Sonar rule
typescript:S6767 and improves code maintainability.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2026

Summary by CodeRabbit

Release Notes

  • Refactor

    • Renamed ContributorsList component prop from label to title throughout the application for improved semantic naming and API consistency
    • Simplified AnchorTitle component interface by removing optional className prop support, reducing surface area while preserving visual behavior
  • Tests

    • Updated component test mocks and test cases to align with prop naming updates and component interface changes

Walkthrough

Removed the unused className prop from AnchorTitle's public props and updated all call sites and tests to stop passing className; also renamed ContributorsList prop labeltitle across code and tests.

Changes

Cohort / File(s) Summary
AnchorTitle component
frontend/src/components/AnchorTitle.tsx
Removed className?: string from AnchorTitleProps and stopped accepting/propagating className in the component.
ContributorsList & usages
frontend/src/components/ContributorsList.tsx, frontend/src/components/CardDetailsPage.tsx, frontend/src/app/page.tsx, frontend/src/app/about/page.tsx
Renamed public prop label?: stringtitle?: string on ContributorsList; internal mapping preserves default label text. Call sites updated to use title.
AnchorTitle call-site updates
frontend/src/components/Milestones.tsx, frontend/src/components/RecentIssues.tsx, frontend/src/components/RecentPullRequests.tsx, frontend/src/components/RecentReleases.tsx, frontend/src/components/CardDetailsPage.tsx
Removed className="..." arguments when instantiating <AnchorTitle ... />, leaving only title prop.
Tests / Mocks
frontend/__tests__/unit/components/Milestones.test.tsx, frontend/__tests__/unit/components/ContributorsList.test.tsx, frontend/__tests__/unit/components/CardDetailsPage.test.tsx
Updated mocks and expectations to match AnchorTitle prop removal and ContributorsList prop rename (labeltitle), and adjusted rendered text assertions accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • kasya
🚥 Pre-merge checks | ✅ 1 | ❌ 4
❌ Failed checks (2 warnings, 2 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Multiple out-of-scope changes present: ContributorsList prop renamed from label to title across 6 files, plus className removals from multiple AnchorTitle usages beyond the component definition. Limit changes to the AnchorTitle component fix only. Handle the label→title rename and other AnchorTitle className removals in separate PRs aligned with their respective issues.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description relates to the changeset and references issue #3805, but contradicts the actual implementation showing className reintroduction. Clarify whether the PR removes or reintroduces the className prop to resolve confusion between description and implementation.
Linked Issues check ❓ Inconclusive The PR partially addresses issue #3805: className was removed from AnchorTitleProps but was then reintroduced in prop signatures, creating inconsistency with the original issue's expected resolution. Verify if className should be removed entirely per issue #3805 or reintroduced with proper usage to fully resolve SonarCloud rule typescript:S6767.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing the unused className prop from AnchorTitle, though implementation differs from PR description.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
frontend/src/components/ContributorsList.tsx (1)

13-13: Public API rename labeltitle is scope creep beyond the PR objective.

The PR objective (issue #3805) is to address the unused className prop on AnchorTitle. Renaming ContributorsListProps.label to title is an unrelated breaking API change that increases the surface area and risk of this PR. Consider splitting this rename into a separate PR.

Also, the destructuring alias title: label = 'Contributors' (accepting title externally but using label internally) is a bit confusing. If you keep the rename, consider using title consistently throughout the component body as well.

Also applies to: 19-21

frontend/__tests__/unit/components/ContributorsList.test.tsx (1)

303-308: Test description says "label" but the prop is now title.

The test description 'uses custom label when provided' still references "label" after the prop was renamed to title. Consider updating the test description for consistency.

Suggested description updates
-    it('uses custom label when provided', () => {
+    it('uses custom title when provided', () => {

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

cubic-dev-ai[bot]
cubic-dev-ai bot previously approved these changes Feb 7, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 7, 2026
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is enough.

Image

This is there for a reason.

@arkid15r arkid15r marked this pull request as draft February 7, 2026 19:01
- Added className back to AnchorTitleProps interface
- Accept className parameter in component
- Apply className to root div element
- Resolves reviewer feedback on PR OWASP#3822
coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 7, 2026
@lavanyayadawad30-lab
Copy link
Contributor Author

Hi @arkid15r , Thank you for the feedback!

I've now updated the fix to properly use the className prop instead of removing it:

✅ Added className?: string back
✅ Accept className parameter in the component function
✅ Apply className to the root div element using template literals

@arkid15r arkid15r marked this pull request as ready for review February 10, 2026 05:44
@arkid15r arkid15r enabled auto-merge February 10, 2026 05:44
@sonarqubecloud
Copy link

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lavanyayadawad30-lab thanks for your contribution!

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.38%. Comparing base (31047c7) to head (ae91917).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3822   +/-   ##
=======================================
  Coverage   95.38%   95.38%           
=======================================
  Files         463      463           
  Lines       14543    14543           
  Branches     2061     2061           
=======================================
  Hits        13872    13872           
  Misses        328      328           
  Partials      343      343           
Flag Coverage Δ
backend 95.67% <ø> (ø)
frontend 94.61% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
frontend/src/app/about/page.tsx 96.70% <ø> (ø)
frontend/src/app/page.tsx 91.35% <ø> (ø)
frontend/src/components/AnchorTitle.tsx 100.00% <ø> (ø)
frontend/src/components/CardDetailsPage.tsx 94.92% <ø> (ø)
frontend/src/components/ContributorsList.tsx 100.00% <100.00%> (ø)
frontend/src/components/Milestones.tsx 93.75% <ø> (ø)
frontend/src/components/RecentIssues.tsx 100.00% <ø> (ø)
frontend/src/components/RecentPullRequests.tsx 100.00% <ø> (ø)
frontend/src/components/RecentReleases.tsx 100.00% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31047c7...ae91917. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arkid15r arkid15r added this pull request to the merge queue Feb 10, 2026
Merged via the queue into OWASP:main with commit 4d9354a Feb 10, 2026
35 checks passed
arkid15r added a commit that referenced this pull request Feb 10, 2026
* Run make update

* Clean up snapshot generated videos

* Update backend/data/nest.dump

* feat(ui): revamp corporate supporters carousel (Infinite Marquee + Dark Mode fix) (#3837)

* feat(ui): revamp corporate supporters carousel (Infinite Marquee + Dark Mode fix)

* fix: resolve failing test case

* fix: add fallback text for unnamed sponsors

* docs: add docstrings to satisfy coverage requirements

* Run make check and fix tests.

---------

Co-authored-by: Kate <kate@kgthreads.com>

* Fix/redundant typescript assertion (#3834)

* Fix Sonar S4325 by narrowing session user fields instead of casting

* Fix unused ExtendedSession in mentorship page

* fix: redundant-typescript-assertion

* Fix stale latest date displayed in Project Health Dashboard metrics (#3842)

* Fixed latest date in proejct health dashboard

* updated order

* Update code

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* feat: improve backend test coverage to 96% (#3840)

* feat: improve backend test coverage to 96%

* fix comments

* fix issues

* fix issue

* fix cubic-dev-ai comments

* Update code

* Fix tests

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Fix: merge consecutive RUN instructions in frontend Dockerfile (#3644)

* Fix: merge consecutive RUN instructions in frontend Dockerfile

* fix: comment Dockerfile note to prevent syntax error

* Update code

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Fix 'is_merged' not being available on the Issue (#3843)

* Fix 'is_merged' not being available on the Issue

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* CI:  Add ansible-lint workflow for Ansible playbooks (#3796)

* ci: add ansible-lint workflow

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* Update .github/workflows/lint-ansible.yaml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* ci: add ansible-lint make target and workflow

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* ci: add ansible-lint pre-commit hook

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* fix: whitespace & version

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* Update Makefile

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* ci: enable ansible-lint scanning and add requirements.yml

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* chore(ansible):align linting and module usage

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* ci(ansible): install collections before deploy playbooks

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* Update code

* Update code

* Update .github/workflows/run-ci-cd.yaml

---------

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Fix ElevenLabs API error (#3861)

* use default liam voice

* bump speed by 0.10

---------

Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Add Ime Iyonsi to MENTORS.md (#3866)

* Add mentor profile for Ime Iyonsi

Added Ime Iyonsi's mentor profile.

* Fix GitHub link for Ime Iyonsi

Corrected GitHub link for Ime Iyonsi.

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Update MENTORS.md

* Enabled Strict Mode (#3776)

* Enabled Strict Mode

* fixed ai review

* fix

* fixed review

* fix

* update test

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Resolve case-sensitivity in QueryParser to support Chapters/Members search (#3844)

* resolve query parser blocker

* use case_sensitive flag in QueryParser

* feat: add case_sensitive option to QueryParser and update tests

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Update dependencies (#3874)

* Update dependencies

* Bump django-ninja version

* fix(proxy): pin nginx and certbot images (#3848)

* fix(proxy): pin nginx and certbot images

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* fix stable verssions

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

---------

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Update docker-compose/proxy/compose.yaml

* Update backend/pyproject.toml

* Update ansible lint configuration (#3880)

* Update .github/ansible/.ansible-lint.yaml

* Improve frontend test coverage above 80% and add missing test files (#3864)

* Imrove test coverage to 80% and added test

* Fixed coderabbit review

* update code

* fixed coderabbit ai

* fixed soanrqube warning

* fixed review

* update

* fixed aloglia cache_key (#3825)

* fixed aloglia cache_key

* change separator val to be semicolon (;)

* Update code

* add tests + use json filters

* add trailing newline

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* fix: remove unused className prop from AnchorTitle component (#3822)

* fix: remove unused className prop from AnchorTitle component

Fixes #3805

The className prop was defined in AnchorTitleProps but never used
in the component implementation. Removing it resolves Sonar rule
typescript:S6767 and improves code maintainability.

* fix: use className prop instead of removing it

- Added className back to AnchorTitleProps interface
- Accept className parameter in component
- Apply className to root div element
- Resolves reviewer feedback on PR #3822

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

---------

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>
Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Yashraj Pahuja <yashrajpahuja9999@gmail.com>
Co-authored-by: Kate <kate@kgthreads.com>
Co-authored-by: CodeAritraDhank <aritradhank21@gmail.com>
Co-authored-by: Anurag Yadav <143180737+anurag2787@users.noreply.github.com>
Co-authored-by: Harshit Verma <harshit1092004@gmail.com>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>
Co-authored-by: Shuban Mutagi <shubanmutagi55@gmail.com>
Co-authored-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: emaybu <152900874+emaybu@users.noreply.github.com>
Co-authored-by: sai chethana <saichethanavesireddy@gmail.com>
Co-authored-by: Rahul Paul <179798584+Mr-Rahul-Paul@users.noreply.github.com>
Co-authored-by: Lavanya <lavanyayadawad30@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove unused className prop from AnchorTitle component

2 participants