Skip to content

Commit

Permalink
fix: some blocker reported sonar-cloud issues (#4009)
Browse files Browse the repository at this point in the history
Spillover from 2024 - some "blocker" labelled SonarCloud issues fixed.
  • Loading branch information
asalzburger authored Jan 9, 2025
1 parent cd40162 commit fe95173
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 28 deletions.
4 changes: 2 additions & 2 deletions Core/include/Acts/EventData/VectorMultiTrajectory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class VectorMultiTrajectoryBase {
TrackStatePropMask allocMask = TrackStatePropMask::None;
};

VectorMultiTrajectoryBase() = default;
VectorMultiTrajectoryBase() noexcept = default;

VectorMultiTrajectoryBase(const VectorMultiTrajectoryBase& other)
: m_index{other.m_index},
Expand Down Expand Up @@ -388,7 +388,7 @@ class VectorMultiTrajectory final
VectorMultiTrajectory(const VectorMultiTrajectory& other)
: VectorMultiTrajectoryBase{other} {}

VectorMultiTrajectory(VectorMultiTrajectory&& other)
VectorMultiTrajectory(VectorMultiTrajectory&& other) noexcept
: VectorMultiTrajectoryBase{std::move(other)} {}

Statistics statistics() const {
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Geometry/GeometryHierarchyMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ class GeometryHierarchyMap {
// defaulted constructors and assignment operators
GeometryHierarchyMap() = default;
GeometryHierarchyMap(const GeometryHierarchyMap&) = default;
GeometryHierarchyMap(GeometryHierarchyMap&&) = default;
GeometryHierarchyMap(GeometryHierarchyMap&&) noexcept = default;
~GeometryHierarchyMap() = default;
GeometryHierarchyMap& operator=(const GeometryHierarchyMap&) = default;
GeometryHierarchyMap& operator=(GeometryHierarchyMap&&) = default;
GeometryHierarchyMap& operator=(GeometryHierarchyMap&&) noexcept = default;

/// Return an iterator pointing to the beginning of the stored values.
Iterator begin() const { return m_values.begin(); }
Expand Down
3 changes: 2 additions & 1 deletion Core/include/Acts/Seeding/BinnedGroupIterator.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ void Acts::BinnedGroupIterator<grid_t>::findNotEmptyBin() {
passesMask = m_group->mask().at(m_gridItr.globalBinIndex());
}
// loop and only stop when we find a non-empty bin which is not masked
while ((dimCollection == 0ul || !passesMask) && ++m_gridItr != m_gridItrEnd) {
while ((dimCollection == 0ul || !passesMask) &&
(++m_gridItr != m_gridItrEnd)) {
dimCollection = (*m_gridItr).size();
if (dimCollection == 0ul) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Utilities/Any.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class AnyBase : public AnyBaseAll {
return *this;
}

AnyBase(AnyBase&& other) {
AnyBase(AnyBase&& other) noexcept {
_ACTS_ANY_VERBOSE("Move construct (this="
<< this << ") at: " << static_cast<void*>(m_data.data()));
if (m_handler == nullptr && other.m_handler == nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Utilities/MultiIndex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class MultiIndex {
MultiIndex(const MultiIndex&) = default;
MultiIndex(MultiIndex&) = default;
MultiIndex& operator=(const MultiIndex&) = default;
MultiIndex& operator=(MultiIndex&&) = default;
MultiIndex& operator=(MultiIndex&&) noexcept = default;
/// Allow setting the MultiIndex from an already encoded value.
constexpr MultiIndex& operator=(Value encoded) {
m_value = encoded;
Expand Down
6 changes: 3 additions & 3 deletions Core/include/Acts/Utilities/Result.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ class Result {
Result<T, E>& operator=(const Result<T, E>& other) = delete;

/// Move construction is allowed
Result(Result<T, E>&& other) : m_var(std::move(other.m_var)) {}
Result(Result<T, E>&& other) noexcept : m_var(std::move(other.m_var)) {}

/// Move assignment is allowed
/// @param other The other result instance, rvalue reference
/// @return The assigned instance
Result<T, E>& operator=(Result<T, E>&& other) {
Result<T, E>& operator=(Result<T, E>&& other) noexcept {
m_var = std::move(other.m_var);
return *this;
}
Expand Down Expand Up @@ -357,7 +357,7 @@ class Result<void, E> {

/// Move constructor
/// @param other The other result object, rvalue ref
Result(Result<void, E>&& other) : m_opt(std::move(other.m_opt)) {}
Result(Result<void, E>&& other) noexcept : m_opt(std::move(other.m_opt)) {}

/// Move assignment operator
/// @param other The other result object, rvalue ref
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,14 @@ ProtoLayerCreatorT<detector_element_t>::centralProtoLayers(
auto moduleTransform = std::const_pointer_cast<const Acts::Transform3>(
mutableModuleTransform);
// create the module
auto module = std::make_shared<detector_element_t>(
auto moduleElement = std::make_shared<detector_element_t>(
moduleIdentifier, moduleTransform, moduleBounds, moduleThickness,
moduleMaterialPtr);

// put the module into the detector store
layerStore.push_back(module);
layerStore.push_back(moduleElement);
// register the surface
sVector.push_back(module->surface().getSharedPtr());
sVector.push_back(moduleElement->surface().getSharedPtr());
// IF double modules exist
// and the backside one (if configured to do so)
if (!m_cfg.centralModuleBacksideGap.empty()) {
Expand All @@ -311,11 +311,11 @@ ProtoLayerCreatorT<detector_element_t>::centralProtoLayers(
moduleTransform = std::const_pointer_cast<const Acts::Transform3>(
mutableModuleTransform);
// create the backseide moulde
auto bsmodule = std::make_shared<detector_element_t>(
auto bsModuleElement = std::make_shared<detector_element_t>(
moduleIdentifier, moduleTransform, moduleBounds, moduleThickness,
moduleMaterialPtr);
// everything is set for the next module
layerStore.push_back(std::move(bsmodule));
layerStore.push_back(std::move(bsModuleElement));
}
}

Expand Down Expand Up @@ -456,10 +456,10 @@ ProtoLayerCreatorT<detector_element_t>::createProtoLayers(
static_cast<GenericDetectorElement::Identifier>(imodule++);

// create the module
auto module = std::make_shared<detector_element_t>(
auto moduleElement = std::make_shared<detector_element_t>(
moduleIdentifier, moduleTransform, moduleBounds, moduleThickness,
moduleMaterialPtr);
layerStore.push_back(module);
layerStore.push_back(moduleElement);

// now deal with the potential backside
if (!m_cfg.posnegModuleBacksideGap.empty()) {
Expand All @@ -485,14 +485,14 @@ ProtoLayerCreatorT<detector_element_t>::createProtoLayers(
moduleTransform = std::const_pointer_cast<const Acts::Transform3>(
mutableModuleTransform);
// everything is set for the next module
auto bsmodule = std::make_shared<detector_element_t>(
auto bsModuleElement = std::make_shared<detector_element_t>(
moduleIdentifier, moduleTransform, moduleBounds,
moduleThickness, moduleMaterialPtr);
// Put into the detector store
layerStore.push_back(std::move(bsmodule));
layerStore.push_back(std::move(bsModuleElement));
}
// create the surface
esVector.push_back(module->surface().getSharedPtr());
esVector.push_back(moduleElement->surface().getSharedPtr());
}
// counter of rings
++ipnR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ template <typename T>
inline auto selectModule(const GeometryIdMultiset<T>& container,
Acts::GeometryIdentifier::Value volume,
Acts::GeometryIdentifier::Value layer,
Acts::GeometryIdentifier::Value module) {
Acts::GeometryIdentifier::Value sensitive) {
return selectModule(
container,
Acts::GeometryIdentifier().setVolume(volume).setLayer(layer).setSensitive(
module));
sensitive));
}

/// Select all elements for the lowest non-zero identifier component.
Expand All @@ -176,9 +176,9 @@ inline auto selectModule(const GeometryIdMultiset<T>& container,
/// applies to the lower components and not to intermediate zeros.
///
/// Examples:
/// - volume=2,layer=0,module=3 -> select all elements in the module
/// - volume=1,layer=2,module=0 -> select all elements in the layer
/// - volume=3,layer=0,module=0 -> select all elements in the volume
/// - volume=2,layer=0,sensitive=3 -> select all elements in the sensitive
/// - volume=1,layer=2,sensitive=0 -> select all elements in the layer
/// - volume=3,layer=0,sensitive=0 -> select all elements in the volume
///
/// @note An identifier with all components set to zero selects the whole input
/// container.
Expand Down
4 changes: 2 additions & 2 deletions Examples/Framework/include/ActsExamples/Utilities/Range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ template <typename Iterator>
class Range {
public:
Range(Iterator b, Iterator e) : m_begin(b), m_end(e) {}
Range(Range&&) = default;
Range(Range&&) noexcept = default;
Range(const Range&) = default;
~Range() = default;
Range& operator=(Range&&) = default;
Range& operator=(Range&&) noexcept = default;
Range& operator=(const Range&) = default;

Iterator begin() const { return m_begin; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FpeMonitor {
m_size{bufferSize} {}

Buffer(const Buffer &) = delete;
Buffer(Buffer &&other) {
Buffer(Buffer &&other) noexcept {
m_data = std::move(other.m_data);
m_size = other.m_size;
m_offset = other.m_offset;
Expand Down

0 comments on commit fe95173

Please sign in to comment.