swagger-api / swagger-api/swagger-ui

"unreachable code after return statement" warning in FireFox

Open
#5,268 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type: housekeeping
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Q&A (please complete the following information)
  • OS: Ubuntu
  • Browser: Firefox
  • Version: 65
  • Method of installation: npm
  • Swagger-UI version: 3.22.0
  • Swagger/OpenAPI version: OpenAPI 3.0
Steps to reproduce

Open Firefox dev tools. The following warning is displayed: "unreachable code after return statement"

This is caused by the following dead code:

https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/err/error-transformers/transformers/parameter-oneof.js#L8

This warning generates uneccessary noise in the console.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/core/plugins/err/error-transformers/transformers/parameter-oneof.js at the line identified in the issue, then reproduce the warning in Firefox developer tools. Remove the reported dead code and verify that the “unreachable code after return statement” warning no longer appears.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.