dtcenter/MET

SonarQube: Replace "enum" to "enum class"

Closed this issue · 1 comments

Replace italics below with details for this issue.

Describe the Enhancement

Provide a description of the enhancement request here.
Subtask of #2673.

The SonarQube suggests to use enum class instead of enum. The enum is converted to integer, So the different enum can be the same value. MET's solution is different names to avoid it like STATOutputType_None, FieldType_None, They can be changed to

enum STATOutputType {
   STATOutputType_None, // Do not output this line type
   STATOutputType_Stat, // Write output to the .stat file
   STATOutputType_Both  // Write output to .stat and .txt files
};
==>
enum class STATOutputType {
   None, // Do not output this line type
   Stat, // Write output to the .stat file
   Both  // Write output to .stat and .txt files
};

STATOutputType_None
STATOutputType_Stat
STATOutputType_Both
==>
STATOutputType::None
STATOutputType::Stat
STATOutputType::Both

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.

  • Add a checkbox for each sub-issue here.

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

Define the source of funding and account keys here or state NONE.
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.

Following files were not updated because enum_to_string is applied

  • basic/vx_config/object_types.h
  • basic/vx_config/data_file_type.h
  • basic/vx_config/icode.h
  • basic/vx_util/ascii_table.h
  • basic/vx_math/affine.h
  • libcode/vx_bool_calc/token.h
  • libcode/vx_gis/shp_types.h
  • libcode/vx_afm/afm_keywords.h
  • libcode/vx_afm/afm_token_types.h
  • libcode/vx_ps/vx_ps.h
  • libcode/vx_data2d/level_info.h
  • tools/other/mode_time_domain/mtd_file_base.h
  • tools/other/mode_graphics/cgraph_main.h
  • tools/other/wwmca_tool/wwmca_ref.h

Following files are used at *yy:

  • basic/vx_config/threshold.h: ThreshType and PercThreshType

Following files have the assignment with enum+1

  • src/libcode/vx_tc_util/atcf_track_line.h: StepDirection