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

SonarQube: Remove code that will never be executed #2506

Closed
7 of 20 tasks
JohnHalleyGotway opened this issue Apr 4, 2023 · 0 comments · Fixed by #2507
Closed
7 of 20 tasks

SonarQube: Remove code that will never be executed #2506

JohnHalleyGotway opened this issue Apr 4, 2023 · 0 comments · Fixed by #2507
Assignees
Labels
component: code cleanup Code cleanup and maintenance issue priority: medium Medium Priority reporting: DTC AF METplus Air Force METplus Project requestor: USAF United States Air Force type: task An actionable item of work
Milestone

Comments

@JohnHalleyGotway
Copy link
Collaborator

JohnHalleyGotway commented Apr 4, 2023

Describe the Task

SonarQube flags as a Major Bug any code that will never be executed. There are 72 instances of this in develop branch and all of them are calls to return or break immediately after a call to exit. These were originally added to satisfy earlier compiler versions. However, the GCC version 8.3.0 (g++ (Debian 8.3.0-6) 8.3.0) now compilers that code without complaint.

This task is to resolve all of these SonarQube bugs.

Here's the SonarQube explanation:

Some statements (return, break, continue, goto, co_return) and throw expressions move control flow out of the current code block. Furthermore, some function do not return control flow (e.g. abort(), std::terminate(), functions with the [[noreturn]] attribute).

Any unlabeled statements that come after such a jump or function call are unreachable, and either this dead code should be removed, or the logic should be corrected.

Time Estimate

2 hours.

Sub-Issues

Consider breaking the task down into sub-issues.
No sub-issues.

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

2771021

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required
  • Select scientist(s) or no scientist required

Labels

  • Select component(s)
  • Select priority
  • Select requestor(s)

Projects and Milestone

  • Select Repository and/or Organization level Project(s) or add alert: NEED PROJECT ASSIGNMENT label
  • Select Milestone as the next official version or Future Versions

Define Related Issue(s)

Consider the impact to the other METplus components.

Task Checklist

See the METplus Workflow for details.

  • Complete the issue definition above, including the Time Estimate and Funding Source.
  • Fork this repository or create a branch of develop.
    Branch name: feature_<Issue Number>_<Description>
  • Complete the development and test your changes.
  • Add/update log messages for easier debugging.
  • Add/update unit tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into develop.
    Pull request: feature <Issue Number> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s) and Development issues
    Select: Repository level development cycle Project for the next official release
    Select: Milestone as the next official version
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Close this issue.
@JohnHalleyGotway JohnHalleyGotway added component: code cleanup Code cleanup and maintenance issue type: task An actionable item of work priority: medium Medium Priority requestor: USAF United States Air Force reporting: DTC AF METplus Air Force METplus Project labels Apr 4, 2023
@JohnHalleyGotway JohnHalleyGotway added this to the MET 11.1.0 milestone Apr 4, 2023
@JohnHalleyGotway JohnHalleyGotway self-assigned this Apr 4, 2023
@JohnHalleyGotway JohnHalleyGotway moved this from 📋 Backlog to 🏗 In progress in MET-11.1.0 Development Apr 4, 2023
JohnHalleyGotway added a commit that referenced this issue Apr 5, 2023
JohnHalleyGotway added a commit that referenced this issue Apr 5, 2023
@JohnHalleyGotway JohnHalleyGotway linked a pull request Apr 5, 2023 that will close this issue
15 tasks
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in MET-11.1.0 Development Apr 6, 2023
@JohnHalleyGotway JohnHalleyGotway changed the title Remove code that will never be executed Fix SonarQube remove code that will never be executed Apr 23, 2023
@JohnHalleyGotway JohnHalleyGotway changed the title Fix SonarQube remove code that will never be executed SonarQube: Remove code that will never be executed Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: code cleanup Code cleanup and maintenance issue priority: medium Medium Priority reporting: DTC AF METplus Air Force METplus Project requestor: USAF United States Air Force type: task An actionable item of work
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant