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 2673 sonarqube beta5 redundant parentheses #2930

Merged
merged 4 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 10 additions & 10 deletions src/basic/vx_config/dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,21 @@ class DictionaryEntry {
////////////////////////////////////////////////////////////////////////


inline ConfigObjectType DictionaryEntry::type() const { return ( Type ); }
inline ConfigObjectType DictionaryEntry::type() const { return Type; }

inline ConcatString DictionaryEntry::name() const { return ( Name ); }
inline ConcatString DictionaryEntry::name() const { return Name; }

inline bool DictionaryEntry::is_number() const { return ( (Type == IntegerType) || (Type == FloatType) ); }

inline bool DictionaryEntry::is_dictionary() const { return ( Type == DictionaryType ); }

inline bool DictionaryEntry::is_array() const { return ( Type == ArrayType ); }

inline int DictionaryEntry::n_args() const { return ( Nargs ); }
inline int DictionaryEntry::n_args() const { return Nargs; }

inline const IcodeVector * DictionaryEntry::icv() const { return ( v ); }
inline const IcodeVector * DictionaryEntry::icv() const { return v; }

inline Dictionary * DictionaryEntry::dict() const { return ( Dict ); }
inline Dictionary * DictionaryEntry::dict() const { return Dict; }


////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -344,15 +344,15 @@ class Dictionary {
////////////////////////////////////////////////////////////////////////


inline int Dictionary::n_entries() const { return ( Nentries ); }
inline int Dictionary::n_entries() const { return Nentries; }

inline const Dictionary * Dictionary::parent() const { return ( Parent ); }
inline const Dictionary * Dictionary::parent() const { return Parent; }

inline void Dictionary::set_is_array(bool __tf) { IsArray = __tf; return; }

inline bool Dictionary::is_array() const { return ( IsArray ); }
inline bool Dictionary::is_array() const { return IsArray; }

inline bool Dictionary::last_lookup_status() const { return ( LastLookupStatus ); }
inline bool Dictionary::last_lookup_status() const { return LastLookupStatus; }


////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -434,7 +434,7 @@ class DictionaryStack {
////////////////////////////////////////////////////////////////////////


inline int DictionaryStack::n_elements () const { return ( Nelements ); }
inline int DictionaryStack::n_elements () const { return Nelements; }


////////////////////////////////////////////////////////////////////////
Expand Down
10 changes: 5 additions & 5 deletions src/basic/vx_config/icode.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class IcodeVector {
////////////////////////////////////////////////////////////////////////


inline int IcodeVector::length() const { return ( Ncells ); }
inline int IcodeVector::length() const { return Ncells; }


////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -267,7 +267,7 @@ class CellStack {
////////////////////////////////////////////////////////////////////////


inline int CellStack::depth() const { return ( Depth ); }
inline int CellStack::depth() const { return Depth; }


////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -319,7 +319,7 @@ class ICVStack {
////////////////////////////////////////////////////////////////////////


inline int ICVStack::depth() const { return ( Depth ); }
inline int ICVStack::depth() const { return Depth; }


////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -358,7 +358,7 @@ class ICVQueue {
////////////////////////////////////////////////////////////////////////


inline int ICVQueue::n_elements() const { return ( Nelements ); }
inline int ICVQueue::n_elements() const { return Nelements; }


////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -402,7 +402,7 @@ class ICVArray {
////////////////////////////////////////////////////////////////////////


inline int ICVArray::n_elements() const { return ( Nelements ); }
inline int ICVArray::n_elements() const { return Nelements; }


////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions src/basic/vx_config/idstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class IdentifierQueue {
////////////////////////////////////////////////////////////////////////


inline int IdentifierQueue::n_elements() const { return ( Nelements ); }
inline int IdentifierQueue::n_elements() const { return Nelements; }


////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -153,7 +153,7 @@ class IdentifierArray {
////////////////////////////////////////////////////////////////////////


inline int IdentifierArray::n_elements() const { return ( Nelements ); }
inline int IdentifierArray::n_elements() const { return Nelements; }


////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/basic/vx_config/number_stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class NumberStack {
////////////////////////////////////////////////////////////////////////


inline int NumberStack::depth() const { return ( Nelements ); }
inline int NumberStack::depth() const { return Nelements; }


////////////////////////////////////////////////////////////////////////
Expand Down
32 changes: 16 additions & 16 deletions src/basic/vx_config/threshold.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ class Or_Node : public ThreshNode {
////////////////////////////////////////////////////////////////////////


inline ThreshType Or_Node::type() const { return ( thresh_complex ); }
inline double Or_Node::value() const { return ( bad_data_double ); }
inline PercThreshType Or_Node::ptype() const { return ( no_perc_thresh_type ); }
inline double Or_Node::pvalue() const { return ( bad_data_double ); }
inline ThreshType Or_Node::type() const { return thresh_complex ; }
inline double Or_Node::value() const { return bad_data_double ; }
inline PercThreshType Or_Node::ptype() const { return no_perc_thresh_type ; }
inline double Or_Node::pvalue() const { return bad_data_double ; }


////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -272,10 +272,10 @@ class And_Node : public ThreshNode {
////////////////////////////////////////////////////////////////////////


inline ThreshType And_Node::type() const { return ( thresh_complex ); }
inline double And_Node::value() const { return ( bad_data_double ); }
inline PercThreshType And_Node::ptype() const { return ( no_perc_thresh_type ); }
inline double And_Node::pvalue() const { return ( bad_data_double ); }
inline ThreshType And_Node::type() const { return thresh_complex ; }
inline double And_Node::value() const { return bad_data_double ; }
inline PercThreshType And_Node::ptype() const { return no_perc_thresh_type ; }
inline double And_Node::pvalue() const { return bad_data_double ; }


////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -322,10 +322,10 @@ class Not_Node : public ThreshNode {
////////////////////////////////////////////////////////////////////////


inline ThreshType Not_Node::type() const { return ( thresh_complex ); }
inline double Not_Node::value() const { return ( bad_data_double ); }
inline PercThreshType Not_Node::ptype() const { return ( no_perc_thresh_type ); }
inline double Not_Node::pvalue() const { return ( bad_data_double ); }
inline ThreshType Not_Node::type() const { return thresh_complex ; }
inline double Not_Node::value() const { return bad_data_double ; }
inline PercThreshType Not_Node::ptype() const { return no_perc_thresh_type ; }
inline double Not_Node::pvalue() const { return bad_data_double ; }


////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -394,10 +394,10 @@ class Simple_Node : public ThreshNode {
////////////////////////////////////////////////////////////////////////


inline ThreshType Simple_Node::type() const { return ( op ); }
inline double Simple_Node::value() const { return ( T ); }
inline PercThreshType Simple_Node::ptype() const { return ( Ptype ); }
inline double Simple_Node::pvalue() const { return ( PT ); }
inline ThreshType Simple_Node::type() const { return op ; }
inline double Simple_Node::value() const { return T ; }
inline PercThreshType Simple_Node::ptype() const { return Ptype ; }
inline double Simple_Node::pvalue() const { return PT ; }


////////////////////////////////////////////////////////////////////////
Expand Down
8 changes: 4 additions & 4 deletions src/basic/vx_log/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ class LoggerDebug {
//////////////////////////////////////////////////////////////////


inline int LoggerDebug::value() const { return (Value); }
inline int LoggerDebug::value() const { return Value; }

inline LoggerDebug::operator int () const { return (Value); }
inline LoggerDebug::operator int () const { return Value; }


//////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -292,9 +292,9 @@ class Logger
//////////////////////////////////////////////////////////////////


inline ConcatString Logger::log_filename() const { return (LogFilename); }
inline ConcatString Logger::log_filename() const { return LogFilename; }

inline int Logger::verbosity_level() const { return (VerbosityLevel); }
inline int Logger::verbosity_level() const { return VerbosityLevel; }

inline bool Logger::is_open() const { return (out != nullptr); }

Expand Down
30 changes: 15 additions & 15 deletions src/basic/vx_log/string_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void StringArray::add_css(const std::string text)
}

Sorted = false;

return;

}
Expand Down Expand Up @@ -450,7 +450,7 @@ void StringArray::insert(int i, const char * text)
s.insert(s.begin()+i, text);

Sorted = false;

return;

}
Expand All @@ -464,7 +464,7 @@ bool StringArray::has(const std::string text) const
{
bool found = false;
bool forward = true;

if (Sorted && !IgnoreCase) {
found = binary_search(s.begin(), s.end(), text);
}
Expand Down Expand Up @@ -496,13 +496,13 @@ bool StringArray::has(const std::string text, int & index, bool forward) const
//
bool found = false;
index = -1;

if (!s.empty()) {
int count;
std::string lower_text = text;
std::vector<std::string>::const_iterator it;
if ( IgnoreCase ) transform(lower_text.begin(), lower_text.end(), lower_text.begin(), ::tolower);

if (forward) {
count = 0;
for(it = s.begin(); it != s.end(); it++, count++) {
Expand Down Expand Up @@ -552,7 +552,7 @@ bool StringArray::has(const std::string text, int & index, bool forward) const
}
if (found) index = count;
}

return found;
}

Expand Down Expand Up @@ -595,7 +595,7 @@ void StringArray::parse_delim(const std::string text, const char *delim)
clear();

std::string str = text;

size_t start = 0;
size_t end = str.find_first_of(delim);
while (end != string::npos) {
Expand All @@ -608,7 +608,7 @@ void StringArray::parse_delim(const std::string text, const char *delim)
s.push_back(str.substr(start).c_str());

Sorted = false;

return;

}
Expand Down Expand Up @@ -729,15 +729,15 @@ void StringArray::sort()
Sorted = true;
return;
}

if ( !Sorted ) {
std::sort(s.begin(), s.end());
}

Sorted = true;

return;

}


Expand All @@ -751,7 +751,7 @@ StringArray StringArray::uniq() const
StringArray sa;

sa.s = s;

std::vector<std::string>::iterator it;

it = std::unique(sa.s.begin(), sa.s.end());
Expand Down Expand Up @@ -783,7 +783,7 @@ regex_t buffer;
regex_t *preg = &buffer;

// Check for null pointers
if( !reg_exp_str || !test_str ) return( false );
if( !reg_exp_str || !test_str ) return false;

if( regcomp(preg, reg_exp_str, REG_EXTENDED*REG_NOSUB) != 0 ) {
mlog << Error << "\ncheck_reg_exp(char *, char *) -> "
Expand All @@ -798,7 +798,7 @@ if( regexec(preg, test_str, 0, 0, 0) == 0 ) { valid = true; }
// Free allocated memory.
regfree( preg );

return( valid );
return valid;

}

Expand Down
6 changes: 3 additions & 3 deletions src/basic/vx_log/string_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ class StringArray {
////////////////////////////////////////////////////////////////////////


inline int StringArray::n_elements() const { return ( (int) (s.size()) ); }
inline int StringArray::n_elements() const { return (int) s.size(); }

inline int StringArray::n () const { return ( s.size() ); }
inline int StringArray::n () const { return s.size(); }

inline int StringArray::max_length() const { return ( MaxLength ); }
inline int StringArray::max_length() const { return MaxLength; }


////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/basic/vx_math/affine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ rho = image_aspect/view_aspect;

mag = min(rho, 1.0);

mag *= (view_width)/(image_width);
mag *= view_width/image_width;

return mag;

Expand Down
Loading