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

Feature 1855 sonarqube fix #1865

Merged
merged 29 commits into from
Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0a66ca1
#1855 Removed break after return (SobarQube)
Jul 23, 2021
f1a2d3f
#1855 Removed break after exit
Jul 23, 2021
f60c052
1855 Added return at MetNcPointObsOut::write_to_netcdf
Jul 23, 2021
c5b1610
#1855 Avoid releasing memory twice
Jul 23, 2021
52e697e
#1855 Removed unused code
Jul 23, 2021
471467c
#1855 Corrected syntax error
Jul 23, 2021
69b5530
#1855 Changed the second call of close() to release _ncFile
Jul 27, 2021
1b977e4
#1855 Deleted break after exit
Jul 27, 2021
658e45e
#1855 Chamnged while to if
Jul 27, 2021
ddbb270
Merge branch 'develop' of github.com:dtcenter/MET into feature_1855_s…
Jul 28, 2021
e6b343b
#1855 Added constructor TCLineCounts and initialized the members
Jul 28, 2021
72ac1a8
#1855 Added break statement back for case '-'
Jul 28, 2021
8d4bf01
#1855 Check the new size before extending to avoid thereference of th…
Jul 28, 2021
24a1cc6
#1855 Changed count to processed_count for log messages. Initialized …
Jul 28, 2021
1004531
#1855 Corected the number of memory copy
Jul 28, 2021
16faedb
#1855 Exit with an error message if both fgi & bgi are null
Jul 28, 2021
0d118ca
#1855 Clear Lead_Times before extening. Formatting for error messages
Jul 28, 2021
0d89f7a
#1855 Extend Lead_Times for new times
Jul 30, 2021
5555965
#1855 Removed break after exit
Jul 30, 2021
33d0ceb
#1855 define "c" dynamically
Jul 30, 2021
c0f678d
#1855 Move the log message within if statement to avoid dereferencing…
Jul 30, 2021
6b3d713
#1855 Corected typo - compare the numnber of U and V
Jul 30, 2021
6846f62
#1855 Check if var_info is hull
Jul 30, 2021
f7a0aea
#1855 Avoid un-initialized variables: dt at open(), v at lat() & lon(…
Jul 30, 2021
72cc21e
#1855 Check if ldf is null pointer
Jul 30, 2021
4935a50
#1855 Removed break after exit
Jul 30, 2021
07b700f
#1855 Removed break after exit
Jul 30, 2021
ce3fcee
Update pcp_combine.cc
JohnHalleyGotway Aug 2, 2021
1b403ec
Merge branch 'develop' into feature_1855_sobarqube_fix
JohnHalleyGotway Aug 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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