-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Nightly scanning reports the SonarQube finds. They should be resolved with MET v12.0 release.
Note that work on this issue will occur during each development cycle toward the MET-12.0.0 release.
Describe the Enhancement
The newly introduced SonarQube findings should be resolved with v12.0 release. And reduce the code smell as possible.
SonarQube: All rules for C and for CPP
using namespace
statements- remove redundant parentheses
- with return statement
return ( true );
-->return true;
- Note:
return ( digit_count > 0 );
is not considered as redundant parentheses
- with return statement
- use
nullptr
instead of the literal 0 as pointer - reduce the scope of the local variables
- local variable into loop statement
for (int i=0;i<i_end; i++)
instead ofint i; for (i=0; i<i_end;i++)
- local variable into loop statement
enum
toenum class
SonarQube: Replace "enum" to "enum class" #2830while (true)
instead ofwhile{1)
- Assignments should not be made from within conditions
if (x = getValue())
tox = getValue(); if (x)
- Extract the assignment the this expression: need login: mostly
++i
ori++
as an argument. For example,k++
attable.set_entry(r, k++, (string)"N");
- Replace dynamically allocated memory with STL vectors, where possible. Replace
new <data_type>
statements withvector<data_type>
and call thevector::data()
member function to get a pointer to that memory (e.g. when calling NetCDF library to read data from input files into memory).
Time Estimate
Estimate the amount of work required here.
Issues should represent approximately 1 to 3 days of work.
Sub-Issues
Consider breaking the enhancement down into sub-issues.
None needed.
Relevant Deadlines
SonarQube findings should be minimized during each development cycle toward the MET-12.0.0 release.
Funding Source
Prior to FY25 - 2771022 AIR FORCE METPLUS
FY25 - 2771024 Air Force METplus
Define the Metadata
Assignee
- Select engineer(s) or no engineer required
- Select scientist(s) or no scientist required
Labels
- Review default alert labels
- Select component(s)
- Select priority
- Select requestor(s)
Milestone and Projects
- Select Milestone as the next official version or Backlog of Development Ideas
- For the next official version, select the MET-X.Y.Z Development project
Define Related Issue(s)
Consider the impact to the other METplus components.
Enhancement 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 issue
Select: Milestone as the next official version
Select: MET-X.Y.Z Development project for development toward the next official release - Iterate until the reviewer(s) accept and merge your changes.
- Delete your fork or branch.
- Close this issue.