Skip to content

Commit

Permalink
Sonar findings introduced by recent commits (#5241)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarchant authored Feb 11, 2022
1 parent cdf95ea commit 747f708
Show file tree
Hide file tree
Showing 16 changed files with 199 additions and 241 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ double LegacyVertexMatcher::_denominatorForTie(TiePointScorePtr tie) const
QSet<TiePointScorePtr> ties;

QList<TiePointScorePtr> tie1 = _scores1.value(tie->v1);
for (const auto& tie : tie1)
ties.insert(tie);
for (const auto& t1 : tie1)
ties.insert(t1);

QList<TiePointScorePtr> tie2 = _scores2.value(tie->v2);
for (const auto& tie : tie2)
ties.insert(tie);
for (const auto& t2 : tie2)
ties.insert(t2);

double sum = 0.0;
for (const auto& t : ties)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,10 @@ Meters NetworkDetails::getSearchRadius(ConstNetworkEdgePtr e) const

if (e->isStub())
{
for (const auto& e : _n2->getEdgesFromVertex(e->getFrom()))
for (const auto& element : _n2->getEdgesFromVertex(e->getFrom()))
{
if (e->isStub() == false)
ce = std::max(ce, getSearchRadius(e));
if (element->isStub() == false)
ce = std::max(ce, getSearchRadius(element));
}
if (ce == -1)
ce = e->getFrom()->getElement()->getCircularError();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ bool InBoundsCriterion::_nonWayNodeInBounds(const ConstElementPtr& e) const
{
return _bounds->contains(geom.get());
}
catch (geos::util::TopologyException&)
catch (const geos::util::TopologyException&)
{
// If the contains call fails, use the envelope
return _bounds->contains(geom->getEnvelope().get());
Expand All @@ -132,7 +132,7 @@ bool InBoundsCriterion::_nonWayNodeInBounds(const ConstElementPtr& e) const
{
return _bounds->intersects(geom.get());
}
catch (geos::util::TopologyException&)
catch (const geos::util::TopologyException&)
{
// If the intersects call fails, use the envelope
return _bounds->intersects(geom->getEnvelope().get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void TagAdvancedCriterion::_loadTagFilters(const QString& tagFilterType,
propTree->get_child_optional(tagFilterType.toStdString());
if (tagFilterChild)
{
for (auto& tagFilterPart : propTree->get_child(tagFilterType.toStdString()))
for (const auto& tagFilterPart : propTree->get_child(tagFilterType.toStdString()))
{
TagFilter tagFilter = TagFilter::fromJson(tagFilterPart);
LOG_VART(tagFilter);
Expand Down Expand Up @@ -178,7 +178,7 @@ bool TagAdvancedCriterion::_hasAuxMatch(const ConstElementPtr& e, const TagFilte

LOG_VART(tags);

for (auto tagItr = tags.begin(); tagItr != tags.end(); ++tagItr)
for (auto tagItr = tags.constBegin(); tagItr != tags.constEnd(); ++tagItr)
{
const QString tagKey = tagItr.key();
const QString tagValue = tagItr.value();
Expand Down
Loading

0 comments on commit 747f708

Please sign in to comment.