Skip to content

Commit

Permalink
Merge pull request #1865 from dtcenter/feature_1855_sobarqube_fix
Browse files Browse the repository at this point in the history
Feature 1855 sonarqube fix
  • Loading branch information
hsoh-u authored Aug 2, 2021
2 parents 87de938 + 1b403ec commit 980ae26
Show file tree
Hide file tree
Showing 71 changed files with 283 additions and 316 deletions.
1 change: 0 additions & 1 deletion met/src/basic/vx_config/calculator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,6 @@ while ( pos < (v.length()) ) {
<< celltype_to_string(cell.type)
<< "\"\n\n";
exit ( 1 );
break;


} // switch
Expand Down
12 changes: 0 additions & 12 deletions met/src/basic/vx_config/config_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2450,7 +2450,6 @@ ConcatString fieldtype_to_string(FieldType type) {
mlog << Error << "\nfieldtype_to_string() -> "
<< "Unexpected FieldType value of " << type << ".\n\n";
exit(1);
break;
}

return(s);
Expand Down Expand Up @@ -2520,7 +2519,6 @@ ConcatString setlogic_to_string(SetLogic type) {
mlog << Error << "\nsetlogic_to_string() -> "
<< "Unexpected SetLogic value of " << type << ".\n\n";
exit(1);
break;
}

return(s);
Expand All @@ -2541,7 +2539,6 @@ ConcatString setlogic_to_abbr(SetLogic type) {
mlog << Error << "\nsetlogic_to_abbr() -> "
<< "Unexpected SetLogic value of " << type << ".\n\n";
exit(1);
break;
}

return(s);
Expand All @@ -2562,7 +2559,6 @@ ConcatString setlogic_to_symbol(SetLogic type) {
mlog << Error << "\nsetlogic_to_symbol() -> "
<< "Unexpected SetLogic value of " << type << ".\n\n";
exit(1);
break;
}

return(s);
Expand Down Expand Up @@ -2642,7 +2638,6 @@ ConcatString tracktype_to_string(TrackType type) {
mlog << Error << "\ntracktype_to_string() -> "
<< "Unexpected TrackType value of " << type << ".\n\n";
exit(1);
break;
}

return(s);
Expand Down Expand Up @@ -2698,7 +2693,6 @@ ConcatString interp12type_to_string(Interp12Type type) {
mlog << Error << "\ninterp12type_to_string() -> "
<< "Unexpected Interp12Type value of " << type << ".\n\n";
exit(1);
break;
}

return(s);
Expand Down Expand Up @@ -2738,7 +2732,6 @@ ConcatString mergetype_to_string(MergeType type) {
mlog << Error << "\nmergetype_to_string() -> "
<< "Unexpected MergeType value of " << type << ".\n\n";
exit(1);
break;
}

return(s);
Expand All @@ -2765,7 +2758,6 @@ ConcatString obssummary_to_string(ObsSummary type, int perc_val) {
mlog << Error << "\nobssummary_to_string() -> "
<< "Unexpected ObsSummary value of " << type << ".\n\n";
exit(1);
break;
}

return(s);
Expand Down Expand Up @@ -2805,7 +2797,6 @@ ConcatString matchtype_to_string(MatchType type) {
mlog << Error << "\nmatchtype_to_string() -> "
<< "Unexpected MatchType value of " << type << ".\n\n";
exit(1);
break;
}

return(s);
Expand Down Expand Up @@ -2873,7 +2864,6 @@ ConcatString disttype_to_string(DistType type) {
mlog << Error << "\ndisttype_to_string() -> "
<< "Unexpected DistType value of " << type << ".\n\n";
exit(1);
break;
}

return(s);
Expand Down Expand Up @@ -2915,7 +2905,6 @@ ConcatString griddecomptype_to_string(GridDecompType type) {
mlog << Error << "\ngriddecomptype_to_string() -> "
<< "Unexpected GridDecompType value of " << type << ".\n\n";
exit(1);
break;
}

return(s);
Expand All @@ -2939,7 +2928,6 @@ ConcatString wavelettype_to_string(WaveletType type) {
mlog << Error << "\nwavlettype_to_string() -> "
<< "Unexpected WaveletType value of " << type << ".\n\n";
exit(1);
break;
}

return(s);
Expand Down
6 changes: 1 addition & 5 deletions met/src/basic/vx_config/dictionary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ switch ( entry.Type ) {
<< "\n\n DictionaryEntry::assign(const DictionaryEntry &) -> bad object type ... \""
<< configobjecttype_to_string(entry.Type) << "\"\n\n";
exit ( 1 );
break;

} // switch

Expand Down Expand Up @@ -300,7 +299,6 @@ switch ( Type ) {
<< "bad object type ... \""
<< configobjecttype_to_string(Type) << "\"\n\n";
exit ( 1 );
break;

} // switch

Expand Down Expand Up @@ -377,7 +375,6 @@ switch ( Type ) {
mlog << Error
<< "DictionaryEntry::dump_config_format() -> bad threshold type ... " << Thresh->get_type() << "\n";
exit ( 1 );
break;

} // switch
if ( Thresh->get_type() != thresh_na ) out << Thresh->get_value();
Expand All @@ -402,7 +399,6 @@ switch ( Type ) {
<< "bad object type ... \""
<< configobjecttype_to_string(Type) << "\"\n\n";
exit ( 1 );
break;

} // switch

Expand Down Expand Up @@ -1313,7 +1309,7 @@ for (j=0; j<(scope.n_elements() - 1); ++j) {
// try current dictionary
//

const char * stub = scope[scope.n_elements() - 1].c_str();
const string stub = scope[scope.n_elements() - 1].c_str();

E = D->lookup_simple(stub);

Expand Down
3 changes: 0 additions & 3 deletions met/src/basic/vx_config/icode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ switch ( type ) {
default:
cerr << "\n\n IcodeCell::as_double() const -> bad type ... \"" << celltype_to_string(type) << "\"\n\n";
exit ( 1 );
break;

} // switch

Expand All @@ -289,7 +288,6 @@ switch ( type ) {
default:
cerr << "\n\n IcodeCell::as_int() const -> bad type ... \"" << celltype_to_string(type) << "\"\n\n";
exit ( 1 );
break;

} // switch

Expand Down Expand Up @@ -392,7 +390,6 @@ switch ( type ) {
default:
cerr << "\n\n IcodeCell::dump() -> unrecognized type ... \"" << celltype_to_string(type) << "\"\n\n";
exit ( 1 );
break;

} // switch

Expand Down
26 changes: 13 additions & 13 deletions met/src/basic/vx_config/my_config_scanner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,27 +253,27 @@ switch ( c ) {
// single character tokens
//

case '[': { do_single_char_token(lexeme[0]); is_lhs = false; dict_stack->push_array(); return ( token(lexeme[0]) ); } break;
case '{': { do_single_char_token(lexeme[0]); is_lhs = true; dict_stack->push(); return ( token(lexeme[0]) ); } break;
case '[': { do_single_char_token(lexeme[0]); is_lhs = false; dict_stack->push_array(); return ( token(lexeme[0]) ); }
case '{': { do_single_char_token(lexeme[0]); is_lhs = true; dict_stack->push(); return ( token(lexeme[0]) ); }

case ']': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); } break;
case '}': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); } break;
case ']': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); }
case '}': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); }

case '(': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); } break;
case ')': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); } break;
case '(': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); }
case ')': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); }

case '+': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); } break;
case '+': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); }

case '-': { if ( ! need_number ) { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); } } break;
case '-': { if ( ! need_number ) { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); } } break;

case '*': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); } break;
case '^': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); } break;
case '*': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); }
case '^': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); }

// case '=': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); } break;
// case '=': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); }


case ';': { do_single_char_token(lexeme[0]); is_lhs = true; return ( token( ';' ) ); } break;
case ',': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); } break;
case ';': { do_single_char_token(lexeme[0]); is_lhs = true; return ( token( ';' ) ); }
case ',': { do_single_char_token(lexeme[0]); return ( token(lexeme[0]) ); }

case '\"': { do_quoted_string(); return ( token ( QUOTED_STRING ) ); }

Expand Down
2 changes: 0 additions & 2 deletions met/src/basic/vx_config/threshold.cc
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,6 @@ switch ( op ) {
mlog << Error << "\nSimple_Node::check(double, double, double) const -> "
<< "bad op ... " << op << "\n\n";
exit ( 1 );
break;

} // switch

Expand Down Expand Up @@ -1202,7 +1201,6 @@ if ( Ptype == perc_thresh_climo_dist ) {
<< "threshold to a probability!\n\n";

exit ( 1 );
break;

} // switch
}
Expand Down
1 change: 0 additions & 1 deletion met/src/basic/vx_log/concat_string.cc
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,6 @@ switch ( c ) {
mlog << Error << "\noperator<<(ostream &, CSInlineCommand) -> "
<< "bad CSInlineCommand value\n\n";
exit ( 1 );
break;

} // switch

Expand Down
2 changes: 0 additions & 2 deletions met/src/basic/vx_math/affine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,6 @@ switch ( g ) {
mlog << Error << "\nConformalAffine::set() -> "
<< "bad gravity ... " << viewgravity_to_string(g) << "\n\n";
exit ( 1 );
break;

} // switch

Expand Down Expand Up @@ -1421,7 +1420,6 @@ switch ( g ) {
<< "\n\n viewgravity_to_uv() -> bad gravity ... "
<< viewgravity_to_string(g) << "\n\n";
exit ( 1 );
break;

} // switch

Expand Down
1 change: 0 additions & 1 deletion met/src/basic/vx_math/so3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,6 @@ switch ( k ) {
default:
cerr << "\n\n SO3::operator()(int, int) const -> range check error (2)\n\n";
exit ( 1 );
break;

}

Expand Down
7 changes: 4 additions & 3 deletions met/src/basic/vx_util/GridTemplate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ GridPoint *GridTemplate::getFirst(const int &base_x, const int &base_y,

GridPoint *GridTemplate::getNext(void) const
{
while (_pointInGridIterator != _offsetList.end())
GridPoint *next_point = (GridPoint *)NULL;
if (_pointInGridIterator != _offsetList.end())
{
GridOffset *offset = *_pointInGridIterator;

Expand All @@ -191,11 +192,11 @@ GridPoint *GridTemplate::getNext(void) const
_pointInGridReturn.x = _pointInGridBase.x + offset->x_offset;
_pointInGridReturn.y = _pointInGridBase.y + offset->y_offset;

return &_pointInGridReturn;
next_point = &_pointInGridReturn;

}

return (GridPoint *)NULL;
return next_point;
}

/**********************************************************************
Expand Down
4 changes: 3 additions & 1 deletion met/src/basic/vx_util/data_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ bool DataLine::read_single_text_line(LineDataFile * ldf)

{

if ( !ldf ) return ( false );

#ifdef WITH_PYTHON

PyLineDataFile * pldf = dynamic_cast<PyLineDataFile *>(ldf);
Expand All @@ -530,7 +532,7 @@ if ( pldf ) {

const bool status = read_py_single_text_line(pldf);

return ( status );
return ( status );

}

Expand Down
1 change: 0 additions & 1 deletion met/src/basic/vx_util/data_plane_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ void smooth_field(const DataPlane &dp, DataPlane &smooth_dp,
<< interpmthd_to_string(mthd) << "(" << mthd
<< ")\n\n";
exit(1);
break;
}

// Store the smoothed value
Expand Down
4 changes: 0 additions & 4 deletions met/src/basic/vx_util/interp_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1014,8 +1014,6 @@ double compute_sfc_interp(const DataPlane &dp,
mlog << Error << "\ncompute_sfc_interp() -> "
<< "unsupported interpolation method encountered: "
<< interpmthd_to_string(mthd) << "(" << mthd << ")\n\n";
exit(1);
break;
}

delete gt;
Expand Down Expand Up @@ -1187,7 +1185,6 @@ double compute_horz_interp(const DataPlane &dp,
<< "unsupported interpolation method encountered: "
<< interpmthd_to_string(mthd) << "(" << mthd << ")\n\n";
exit(1);
break;
}

delete gt;
Expand Down Expand Up @@ -1331,7 +1328,6 @@ DataPlane valid_time_interp(const DataPlane &in1, const DataPlane &in2,
<< "unsupported interpolation method encountered: "
<< interpmthd_to_string(mthd) << "(" << mthd << ")\n\n";
exit(1);
break;
}

// Initialize
Expand Down
1 change: 0 additions & 1 deletion met/src/basic/vx_util/ordinal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ switch ( n ) {
//
mlog << Error << "\nordinal_suffix() -> totally confused!\n\n";
exit ( 1 );
break;

} // switch

Expand Down
3 changes: 0 additions & 3 deletions met/src/basic/vx_util/read_fortran_binary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ switch ( rec_pad_length ) {
mlog << Error << "\n\n read_fortran_binary() -> bad record pad size ... "
<< rec_pad_length << "\n\n";
exit ( 1 );
break;

}

Expand Down Expand Up @@ -179,7 +178,6 @@ switch ( rec_pad_length ) {
mlog << Error << "\n\n read_fortran_binary() -> bad record pad size ... "
<< rec_pad_length << "\n\n";
exit ( 1 );
break;

}

Expand Down Expand Up @@ -316,7 +314,6 @@ switch ( rec_pad_length ) {
default:
mlog << Error << "\n\n peek_record_size() -> bad record pad length\n\n";
exit ( 1 );
break;

} // switch

Expand Down
1 change: 0 additions & 1 deletion met/src/basic/vx_util/roman_numeral.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ switch ( n/modulus ) {
default: // shouldn't ever happen
mlog << Error << "\nrn_add() -> can't handle integer " << n << "\n";
exit ( 1 );
break;

} // switch

Expand Down
2 changes: 0 additions & 2 deletions met/src/basic/vx_util/two_to_one.cc
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,6 @@ switch ( k ) {
mlog << Error << "\nget_two_to_one() -> "
<< "bad input values\n\n";
exit ( 1 );
break;

} // switch

Expand Down Expand Up @@ -696,7 +695,6 @@ switch ( k ) {
mlog << Error << "\nget_one_to_two() -> "
<< "bad input values\n\n";
exit ( 1 );
break;

} // switch

Expand Down
Loading

0 comments on commit 980ae26

Please sign in to comment.