Skip to content

Commit

Permalink
enh(sonar): change reserved name to a non reserved one (#297) (#301)
Browse files Browse the repository at this point in the history
* enh(sonar): change reserved name to a non reserved one

* enh(sonar): change exp to expr

* fix(tests): bad call on lambda

* fix(sonar): good lambda call on this file
  • Loading branch information
denliA committed Jun 29, 2022
1 parent 9590659 commit 03643e6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
28 changes: 14 additions & 14 deletions broker/bam/src/ba.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,6 @@ auto normalize = [](double d) -> double {
return d;
};

static bool _every_kpi_in_dt(
std::unordered_map<kpi*, bam::ba::impact_info>& imp) {
if (imp.empty())
return false;

for (auto it = imp.begin(), end = imp.end(); it != end; ++it) {
if (!it->first->in_downtime())
return false;
}

return true;
}

/**
* Constructor.
*
Expand Down Expand Up @@ -312,6 +299,19 @@ state ba::get_state_hard() {
return state_ok;
};

auto every_kpi_in_dt =
[](std::unordered_map<kpi*, bam::ba::impact_info>& imp) -> bool {
if (imp.empty())
return false;

for (auto it = imp.begin(), end = imp.end(); it != end; ++it) {
if (!it->first->in_downtime())
return false;
}

return true;
};

switch (_state_source) {
case configuration::ba::state_source_impact:
if (!_valid)
Expand All @@ -326,7 +326,7 @@ state ba::get_state_hard() {
case configuration::ba::state_source_best:
case configuration::ba::state_source_worst:
if (_dt_behaviour == configuration::ba::dt_ignore_kpi &&
_every_kpi_in_dt(_impacts))
every_kpi_in_dt(_impacts))
state = state_ok;
else
state = _computed_hard_state;
Expand Down
6 changes: 3 additions & 3 deletions broker/bam/src/configuration/bool_expression.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ void bool_expression::set_name(std::string const& name) {
/**
* Set expression
*
* @param[in] exp Set the textual value for the expression.
* @param[in] expr Set the textual value for the expression.
*/
void bool_expression::set_expression(std::string const& exp) {
_expression = exp;
void bool_expression::set_expression(std::string const& expr) {
_expression = expr;
}

/**
Expand Down

0 comments on commit 03643e6

Please sign in to comment.