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 #2521 sonarqube code smell #2570

Merged
merged 42 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
8fd7d94
#2521 Move down using statement after include
May 10, 2023
93a11c7
#2521 Remove these useless parentheses
May 10, 2023
ed9a5e6
#2521 Move #include statement to the top of the file
May 10, 2023
3138e3c
#2521 Move #include statement to the top of the file and removed thes…
May 10, 2023
54f2abb
#2521 Move #include statement to the top of the file and removed thes…
May 10, 2023
6032e7b
#2521 Used nullptr
May 10, 2023
324d3d0
#2521 Move #include statement to the top of the file
May 10, 2023
7f31d65
#2521 Appended name space std to ostream
May 10, 2023
c46b83c
#2521 Appended the namespace std to ostream
May 10, 2023
840c5df
#2521 defined int j out of for loop)
May 10, 2023
1e54976
#2521 Added asignment operator with noexcept keyword
May 11, 2023
49f65b8
#2521 Added asignment operator with noexcept keyword to InputInfo
May 11, 2023
dc5ddfc
#2521 Added asignment operator with noexcept keyword to SSIDXData
May 11, 2023
0417e8a
#2521 Added asignment operator with noexcept keyword to ObsErrorInfo
May 11, 2023
ba80c23
#2521 Added asignment operator with noexcept keyword to GenesisEventInfo
May 11, 2023
a754b74
#2521 Added asignment operator with noexcept keyword to ConvData and …
May 11, 2023
577dd4f
#2521 Added asignment operator with noexcept keyword to derive_var_cfg
May 11, 2023
5f8d794
#2521 Refactoring to reduce the depth of if/for
May 18, 2023
564f572
#2521 Refactoring to reduce the depth of if/for
May 18, 2023
b69d834
#5221 Changed strtok to strtok_r
May 18, 2023
4377a78
#2521 Cast to char
Jun 7, 2023
87863d4
#2521Added explicit to construcore
Jun 7, 2023
26ffda3
#2521Added explicit to construcore
Jun 7, 2023
305cf34
#2521 USe nullptr instead of 0
Jun 7, 2023
8ad40ac
#2521 Added explicit to non default constructor
Jun 7, 2023
cf9e9a2
#2521 Release allocated memory
Jun 7, 2023
14d21dd
#2521 applied constexpr
Jun 7, 2023
71ba7be
#2521 Excluded three vaiables which are declared at basic/vx_cal/unix…
Jun 7, 2023
b5cc588
#2521 Applied explicit & virtual
Jun 7, 2023
8c33179
#2521 Fixed code smells
Jun 7, 2023
5344987
Merge remote-tracking branch 'origin/develop' into feature_2521_sonar…
Jun 7, 2023
d0ac3f7
#2521 Rolback read_bufr_vars
Jun 12, 2023
c67184e
Merge remote-tracking branch 'origin/develop' into feature_2521_sonar…
JohnHalleyGotway Jun 13, 2023
a822271
Per #2521, fix compilation
JohnHalleyGotway Jun 13, 2023
203ec34
#2521 Corrected nearest day at adjuste_day_for_month_year_units. Upda…
Jun 13, 2023
4bc904f
Merge branch 'feature_2521_sonarqube_code_smell' of github.com:dtcent…
Jun 13, 2023
fa1b344
#2521 MOved down using namespace below include statements
Jun 13, 2023
2e1ab81
#2521 Added namespace std to ofstream
Jun 13, 2023
2ccd2ec
#2521 Added std namespace
Jun 13, 2023
5440712
#2521 Moved down using namespace below inculde statsments
Jun 13, 2023
982b12b
#2521 Put code back instead of calling adjuste_day_for_month_year_units
Jun 14, 2023
3fa03ed
#2521 Put old code back at add_to_unixtime
Jun 14, 2023
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
6 changes: 3 additions & 3 deletions src/basic/enum_to_string/code.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
////////////////////////////////////////////////////////////////////////


using namespace std;


#include <iostream>
#include <fstream>
#include <unistd.h>
Expand All @@ -29,6 +26,9 @@ using namespace std;
#include "vx_cal.h"


using namespace std;


////////////////////////////////////////////////////////////////////////


Expand Down
16 changes: 8 additions & 8 deletions src/basic/enum_to_string/enum_to_string.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ static const int debug = 0;
////////////////////////////////////////////////////////////////////////


using namespace std;

#include <iostream>
#include <unistd.h>

Expand All @@ -35,6 +33,9 @@ using namespace std;
#include "enum_to_string.h"


using namespace std;


////////////////////////////////////////////////////////////////////////


Expand Down Expand Up @@ -157,7 +158,7 @@ if ( parse_status != 0 ) {

}

return ( 0 );
return 0;

}

Expand All @@ -171,7 +172,8 @@ void parse_command_line(int &argc, char **argv)

if ( argc == 1 ) { usage(); exit ( 1 ); }

int j, found;
int j;
int found;

do {

Expand Down Expand Up @@ -217,9 +219,7 @@ void shift_down(int &argc, char **argv, int pos, int shift)

{

int j;

for (j=pos; j<(argc - shift); ++j) argv[j] = argv[j + shift];
for (int j=pos; j<(argc - shift); ++j) argv[j] = argv[j + shift];

argc -= shift;

Expand Down Expand Up @@ -396,7 +396,7 @@ int yywrap()

{

return ( 1 );
return 1;

}

Expand Down
4 changes: 2 additions & 2 deletions src/basic/enum_to_string/info.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static const int enuminfo_alloc_increment = 100;

class EnumInfo {

friend ostream & operator<<(ostream &, const EnumInfo &);
friend std::ostream & operator<<(std::ostream &, const EnumInfo &);

private:

Expand Down Expand Up @@ -106,7 +106,7 @@ inline const char * EnumInfo::header() const { return ( Header ); }
////////////////////////////////////////////////////////////////////////


extern ostream & operator<<(ostream &, const EnumInfo &);
extern std::ostream & operator<<(std::ostream &, const EnumInfo &);


////////////////////////////////////////////////////////////////////////
Expand Down
49 changes: 25 additions & 24 deletions src/basic/enum_to_string/my_enum_scanner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
////////////////////////////////////////////////////////////////////////


using namespace std;


#include <iostream>
#include <unistd.h>
#include <stdlib.h>
Expand All @@ -22,6 +19,10 @@ using namespace std;

#include "str_wrappers.h"


using namespace std;


////////////////////////////////////////////////////////////////////////


Expand Down Expand Up @@ -155,7 +156,7 @@ while ( 1 ) {
//
// cout << "\n\n" << flush;

return ( t );
return t;

}

Expand Down Expand Up @@ -266,7 +267,7 @@ if ( is_id() ) { if ( do_id() ) return ( token(ID) ); }



return ( skip );
return skip;

}

Expand Down Expand Up @@ -330,7 +331,7 @@ if ( k == char_class_digit ) return ( true );
if ( k == char_class_alpha ) return ( true );


return ( false );
return false;

}

Expand Down Expand Up @@ -378,9 +379,9 @@ bool is_id()

if ( char_class[lexeme[0]] != char_class_alpha ) return ( false );

int j, k;
int k;

for (j=0; j<max_lexeme_size; ++j) {
for (int j=0; j<max_lexeme_size; ++j) {

if ( lexeme[j] == 0 ) break;

Expand Down Expand Up @@ -438,13 +439,13 @@ if ( enum_mode || last_was_enum || last_was_class ) {

m_strncpy(yylval.name, yytext, sizeof(yylval.name), method_name);

return ( 1 );
return 1;

}



return ( 0 );
return 0;

}

Expand All @@ -456,13 +457,13 @@ int do_int()

{

if ( !enum_mode ) return ( 0 );
if ( !enum_mode ) return 0;

yylval.ival = atoi(yytext);



return ( 1 );
return 1;

}

Expand All @@ -478,14 +479,14 @@ int do_left_curly()

++column;

if ( !enum_mode ) return ( 0 );
if ( !enum_mode ) return 0;

yylval.ival = bracket_level;

lexeme[0] = '{';


return ( 1 );
return 1;

}

Expand All @@ -503,14 +504,14 @@ int do_right_curly()

ss.clear_to_level(bracket_level);

if ( !enum_mode ) return ( 0 );
if ( !enum_mode ) return 0;

yylval.ival = bracket_level + 1;

lexeme[0] = '}';


return ( 1 );
return 1;

}

Expand All @@ -528,13 +529,13 @@ if ( enum_mode ) {

lexeme[0] = '}';

return ( 1 );
return 1;

}



return ( 0 );
return 0;

}

Expand All @@ -552,12 +553,12 @@ if ( enum_mode ) {

lexeme[0] = '=';

return ( 1 );
return 1;

}


return ( 0 );
return 0;

}

Expand All @@ -575,12 +576,12 @@ if ( enum_mode ) {

lexeme[0] = ',';

return ( 1 );
return 1;

}


return ( 0 );
return 0;

}

Expand Down Expand Up @@ -669,7 +670,7 @@ if ( c == '\n' ) {
}


return ( c );
return c;

}

Expand All @@ -691,7 +692,7 @@ if ( t == CLASS ) last_was_class = 1;
if ( t == ENUM ) last_was_enum = 1;


return ( t );
return t;

}

Expand Down
15 changes: 7 additions & 8 deletions src/basic/enum_to_string/scope.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
////////////////////////////////////////////////////////////////////////


using namespace std;


#include <iostream>
#include <unistd.h>
#include <stdlib.h>
Expand All @@ -23,6 +20,8 @@ using namespace std;
#include "str_wrappers.h"


using namespace std;


////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -83,7 +82,7 @@ if ( this == &e ) return ( *this );

assign(e);

return ( *this );
return *this;

}

Expand Down Expand Up @@ -239,7 +238,7 @@ if ( this == &ss ) return ( *this );

assign(ss);

return ( *this );
return *this;

}

Expand Down Expand Up @@ -313,7 +312,7 @@ if ( (pos < 0) || (pos >= N) ) {
}


return ( s[pos] );
return s[pos];

}

Expand Down Expand Up @@ -437,7 +436,7 @@ s << " level = " << (sse.level()) << "\n";

s.flush();

return ( s );
return s;

}

Expand Down Expand Up @@ -474,7 +473,7 @@ for (j=0; j<n; ++j) {
}


return ( s );
return s;

}

Expand Down
4 changes: 2 additions & 2 deletions src/basic/enum_to_string/scope.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ inline const char * ScopeStackElement::name() const { return ( Name ); }
////////////////////////////////////////////////////////////////////////


extern ostream & operator<<(ostream &, const ScopeStackElement &);
extern std::ostream & operator<<(std::ostream &, const ScopeStackElement &);


////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -119,7 +119,7 @@ inline int ScopeStack::n_elements() const { return ( N ); }
////////////////////////////////////////////////////////////////////////


extern ostream & operator<<(ostream &, const ScopeStack &);
extern std::ostream & operator<<(std::ostream &, const ScopeStack &);


////////////////////////////////////////////////////////////////////////
Expand Down
Loading