diff --git a/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/MonitoredGroup.h b/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/MonitoredGroup.h index 40bcbe9be996d9aa0ec46520c7a9a5ebeffe21c1..f9f1141244d2d84ddba52d0a92606939381a76fa 100644 --- a/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/MonitoredGroup.h +++ b/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/MonitoredGroup.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef AthenaMonitoringKernel_MonitoredGroup_h @@ -163,7 +163,7 @@ namespace Monitored { template<typename V,typename std::enable_if_t<std::is_integral_v<V>>* =nullptr> std::map<std::string,int> buildToolMap(ToolHandleArray<GenericMonitoringTool> tools, const std::string& baseName, const std::vector<std::string>& labels) { std::map<std::string,int> indexMap; - for ( auto label : labels ) { + for ( const std::string& label : labels ) { std::string groupName = baseName + "_" + label; indexMap[label] = detail::findToolIndex(tools,groupName); } @@ -174,7 +174,7 @@ namespace Monitored { template<typename V,typename std::enable_if_t<!std::is_integral_v<V>>* =nullptr,typename...T> std::map<std::string,V> buildToolMap(ToolHandleArray<GenericMonitoringTool> tools, const std::string& baseName, const std::vector<std::string>& labels, T... dimensions) { std::map<std::string,V> indexMap; - for ( auto label : labels ) { + for ( const std::string& label : labels ) { std::string groupName = baseName + "_" + label; indexMap[label] = buildToolMap<typename V::mapped_type>(tools,groupName,dimensions...); } diff --git a/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/MonitoredScalar.h b/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/MonitoredScalar.h index b98afe02f0ca70c0f1783f86c7055a520a4db92f..1895e97f3e246460d9dfa610ec534bf5a05cc6b4 100644 --- a/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/MonitoredScalar.h +++ b/Control/AthenaMonitoringKernel/AthenaMonitoringKernel/MonitoredScalar.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef AthenaMonitoringKernel_MonitoredScalar_h @@ -88,6 +88,7 @@ namespace Monitored { Scalar(Scalar const&) = delete; Scalar& operator=(Scalar const&) = delete; + // cppcheck-suppress passedByValue T operator=(T value) { m_value = value; diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFactory.cxx b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFactory.cxx index db7acb878e748098653c4a072cc29e078d6ae994..a0a3ddc45fbe042535fa398fa8c608ce95f0a666 100644 --- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFactory.cxx +++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFactory.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "CxxUtils/checker_macros.h" @@ -16,7 +16,7 @@ using namespace Monitored; HistogramFactory::HistogramFactory(const ServiceHandle<ITHistSvc>& histSvc, - std::string histoPath) + const std::string& histoPath) : m_histSvc(histSvc) { size_t whereToStart = 0; diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFactory.h b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFactory.h index e4039d3afd4449092e3dedf9c777fff13ea4278c..fbd93e215db3e3ddf0aff50edbb5aabc28308c38 100644 --- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFactory.h +++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFactory.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef AthenaMonitoringKernel_HistogramFiller_HistogramFactory_h @@ -26,12 +26,12 @@ namespace Monitored { class HistogramFactory { public: /** - * @brief Defualt constructor + * @brief Default constructor * * @param histSvc ROOT framework histogramming service * @param groupName Name of the group to which produced histograms will belong */ - HistogramFactory(const ServiceHandle<ITHistSvc>& histSvc, std::string groupName); + HistogramFactory(const ServiceHandle<ITHistSvc>& histSvc, const std::string& groupName); /** * @brief Virtual destructor */ diff --git a/Control/AthenaMonitoringKernel/test/HistogramFillerFactoryTestSuite.cxx b/Control/AthenaMonitoringKernel/test/HistogramFillerFactoryTestSuite.cxx index a62e401b2280e52438e24e4ddda6da1ed455e723..cc8eda50495219d08bc1177e36b245013ee92282 100644 --- a/Control/AthenaMonitoringKernel/test/HistogramFillerFactoryTestSuite.cxx +++ b/Control/AthenaMonitoringKernel/test/HistogramFillerFactoryTestSuite.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #undef NDEBUG @@ -207,7 +207,7 @@ class HistogramFillerFactoryTestSuite { private: typedef void (HistogramFillerFactoryTestSuite::*TestCase)(void); - function<void(void)> registerTestCase(TestCase testCase, string testCaseName) { + function<void(void)> registerTestCase(TestCase testCase, const string& testCaseName) { return [this, testCase, testCaseName]() { m_log << MSG::INFO << "Current test case: " << testCaseName << endmsg; beforeEach(); diff --git a/Control/AthenaMonitoringKernel/test/HistogramProviderTestSuite.cxx b/Control/AthenaMonitoringKernel/test/HistogramProviderTestSuite.cxx index ab692597edbe87eeda6b57d65ba2d86dc0d1d4ba..6244bc97978e687b37523a2c7b0f4d3a47053d89 100644 --- a/Control/AthenaMonitoringKernel/test/HistogramProviderTestSuite.cxx +++ b/Control/AthenaMonitoringKernel/test/HistogramProviderTestSuite.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #undef NDEBUG @@ -273,7 +273,7 @@ class LumiblockHistogramProviderTestSuite { private: typedef void (LumiblockHistogramProviderTestSuite::*TestCase)(void); - function<void(void)> registerTestCase(TestCase testCase, string testCaseName) { + function<void(void)> registerTestCase(TestCase testCase, const string& testCaseName) { return [this, testCase, testCaseName]() { m_log << MSG::INFO << "Current test case: " << testCaseName << endmsg; beforeEach();