Skip to content

Comments

Remove unused variable#345

Open
Shweta-281 wants to merge 2 commits intoAOSSIE-Org:developfrom
Shweta-281:remove-unused-variable
Open

Remove unused variable#345
Shweta-281 wants to merge 2 commits intoAOSSIE-Org:developfrom
Shweta-281:remove-unused-variable

Conversation

@Shweta-281
Copy link

@Shweta-281 Shweta-281 commented Apr 7, 2025

Description

This PR addresses a static analysis warning in the monumentCheckIn method where a local variable doc was declared but never used. By removing the unused variable, we improve code quality, reduce technical debt, and ensure adherence to Dart best practices. This fix aligns with GSOC goals of fostering clean, maintainable, and efficient codebases.

Changes:
File: lib/data/repositories/firebase_social_repository.dart

Method: monumentCheckIn

Issue: Unused doc variable when creating a check-in post.

Fix: Remove the assignment of the unused DocumentReference variable.

Before:

dart
Copy
DocumentReference doc = await _database.collection("posts").add({ ... });
After:

dart
Copy
await _database.collection("posts").add({ ... });
Impact:
✅ Eliminates static analysis warnings.

✅ Reduces clutter and improves code readability.

✅ Demonstrates attention to code quality, a key GSOC evaluation criterion.

Fixes # 344

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Please include screenshots below if applicable.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

@Shweta-281 Shweta-281 requested a review from jddeep as a code owner April 7, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unused Local Variable Warning in monumentCheckIn Method

1 participant