Skip to content

Commit

Permalink
Per #2709, eliminate SonarQube bug that was flagged
Browse files Browse the repository at this point in the history
  • Loading branch information
MET Tools Test Account committed Dec 14, 2024
1 parent 4db78a0 commit 5491a87
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/tools/core/mode/mode_exec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2181,7 +2181,6 @@ void ModeExecutive::write_poly_netcdf(NcFile *f_out, ObjPolyType poly_type)

{

int n_pts;
int n_poly;
double lat;
double lon;
Expand Down Expand Up @@ -2347,7 +2346,8 @@ void ModeExecutive::write_poly_netcdf(NcFile *f_out, ObjPolyType poly_type)
}

// Get the number of polyline points
for(int i=0, n_pts=0; i<n_poly; i++) n_pts += poly[i]->n_points;
int n_pts = 0;
for(int i=0; i<n_poly; i++) n_pts += poly[i]->n_points;

// Define dimensions
NcDim tmp_obj_dim = get_nc_dim(f_out, (string)obj_dim_name);
Expand Down Expand Up @@ -2410,7 +2410,7 @@ void ModeExecutive::write_poly_netcdf(NcFile *f_out, ObjPolyType poly_type)
// Convert to lat/lon and store them
grid.xy_to_latlon(x, y, lat, lon);
poly_lat[n_pts] = (float) lat;
poly_lon[n_pts] = (float) -1.0*lon;
poly_lon[n_pts] = -1.0 * ((float) lon);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/tools/core/mode/mode_superobject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static void _debug_shape_examine(const string &name, const ShapeData &sd,
values.push_back(v);
count.push_back(1);
} else {
int ii = nint(vi - values.begin());
auto ii = (int) (vi - values.begin());
count[ii] = count[ii] + 1;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/tools/core/mode/multivar_frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,8 @@ void MultivarFrontEnd::_process_superobjects(SimpleObjects &fcsts, SimpleObjects
<< "\nRunning mvmode superobject analysis conv_radius[" << fcsts._rIndex+1
<< "] conv_thresh[" << fcsts._tIndex+1 << "]\n" << sep << "\n";

MultiVarData *mvdf = fcsts._mvd[0];
MultiVarData *mvdo = obs._mvd[0];
const MultiVarData *mvdf = fcsts._mvd[0];
const MultiVarData *mvdo = obs._mvd[0];

// set the data to 0 inside superobjects and missing everywhere else

Expand All @@ -690,7 +690,7 @@ void MultivarFrontEnd::_process_superobjects(SimpleObjects &fcsts, SimpleObjects
_init_exec(ModeExecutive::MULTIVAR_SUPER, "None", "None");
mode_exec->init_multivar_intensities(config);

ModeConfInfo & conf = mode_exec->engine.conf_info;
const ModeConfInfo & conf = mode_exec->engine.conf_info;
if ((fcsts._super._hasUnion || obs._super._hasUnion) &&
(conf.Fcst->merge_flag == MergeType::Thresh ||
conf.Obs->merge_flag == MergeType::Thresh)) {
Expand Down

0 comments on commit 5491a87

Please sign in to comment.