Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Code cleanup #2251

Merged
merged 22 commits into from
Jan 18, 2023
Merged

Chore: Code cleanup #2251

merged 22 commits into from
Jan 18, 2023

Conversation

ElinorW
Copy link
Contributor

@ElinorW ElinorW commented Nov 22, 2022

Overview

Reduce code smells and bugs from sonar cloud analysis
Fixes #2224

Demo

Optional. Screenshots, curl examples, etc.

Notes

List of code smells addressed in this PR

  • Remove TODO comment
  • "Switch" statements should have at least 3 cases
  • Switch case should end with an unconditional break, continue, return or throw statement
  • Cases in switch statements have repeated code blocks
  • Nested ternary operations
  • Loop counters being modified in the loop body
  • Use of deprecated methods such as substr, addListener, removeListener
  • React components must start with an uppercase.
  • Redundant assignments
  • A shorthand property defined after a longhand property will completely override the value defined in the longhand property making the longhand one useless.
  • Unused imports
  • Using ? and undefined together as they both communicate the same thing

Testing Instructions

  • How to test this PR
  • Prefer bulleted description
  • Start after checking out this branch
  • Include any setup required, such as bundling scripts, restarting services, etc.
  • Include test case, and expected output

@ElinorW ElinorW requested review from Onokaev and thewahome and removed request for Onokaev November 30, 2022 13:47
@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2251.centralus.azurestaticapps.net

@thewahome
Copy link
Collaborator

thewahome commented Dec 1, 2022

Not really important, but as you go along, which code smells have been closed? It would be a good learning experience for us to see what the problem was and how you've fixed it. Maybe indexing them in the Notes section of the overview

@ElinorW
Copy link
Contributor Author

ElinorW commented Dec 1, 2022

Not really important, but as you go along, which code smells have been closed? It would be a good learning experience for us to see what the problem was and how you've fixed it. Maybe indexing them in the Notes section of the overview

Ah yes, this is great feedback.
I shall reference them in the notes section as requested

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2022

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2251.centralus.azurestaticapps.net

@ElinorW ElinorW marked this pull request as ready for review December 6, 2022 12:18
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2022

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2251.centralus.azurestaticapps.net

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 7, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 9 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2022

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2251.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2251.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2251.centralus.azurestaticapps.net

@ElinorW ElinorW requested a review from thewahome January 17, 2023 07:58
@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2251.centralus.azurestaticapps.net

@ElinorW ElinorW merged commit 475721d into dev Jan 18, 2023
@ElinorW ElinorW deleted the fix/code-cleanup branch January 18, 2023 07:44
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@github-actions github-actions bot mentioned this pull request Feb 8, 2023
thewahome pushed a commit that referenced this pull request Feb 13, 2023
Feature: add general playwright tests (#2149)

Task: Add Graph Support Info on README.md (#2347)

Task: Add logging for script errors (#2351)

Task: Add language snippet telemetry (#2371)

Task: Rename sample query "all the items in my drive" to "list items in my drive" (#2350)

Fix: Response area container heights (#2372)

Fix: Re-order tests (#2354)

Fix: Inform user if URL is incomplete (#2367)

Fix: Autocollapsing of history items (#2331)

Fix: Screen blanking on render (#2403)

Fix: Add method to filter ResizeObserver exceptions (#2342)

Fix: enter key runs previous query (#2348)

Fix: autocomplete character selection (#2304)

Fix: Display beta resources subgroups for admin group (#2364)

Fix: Update deprecated aria-label (#2368)

Fix: Default overlay on collections review panel (#2377)

Chore: December dependabot upgrades (#2296)

Chore: Dependabot upgrades February (#2401)

chore: Dependabot upgrades (#2335)

Chore: Code cleanup (#2251)
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.

Improve code quality from the Sonar Cloud stats
3 participants