Enable readability-named-parameter checks
We don't have too many violations here, probably because we don't have
many optional parameters. Fix the existing instances, and enable the
check.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I4d512f0ec90b060fb60a42fe3cd6ba72fb6c6bcb
diff --git a/redfish-core/include/privileges.hpp b/redfish-core/include/privileges.hpp
index 23eada6..f5bc8b6 100644
--- a/redfish-core/include/privileges.hpp
+++ b/redfish-core/include/privileges.hpp
@@ -294,25 +294,4 @@
return isOperationAllowedWithPrivileges(it->second, userPrivileges);
}
-/**
- * @brief Checks if a user is allowed to call an HTTP method
- *
- * @param[in] method HTTP method
- * @param[in] user Username
- *
- * @return True if method allowed, false otherwise
- *
- */
-inline bool isMethodAllowedForUser(const boost::beast::http::verb method,
- const OperationMap& operationMap,
- const std::string&)
-{
- // TODO: load user privileges from configuration as soon as its available
- // now we are granting all privileges to everyone.
- Privileges userPrivileges{"Login", "ConfigureManager", "ConfigureSelf",
- "ConfigureUsers", "ConfigureComponents"};
-
- return isMethodAllowedWithPrivileges(method, operationMap, userPrivileges);
-}
-
} // namespace redfish
diff --git a/redfish-core/include/utils/json_utils.hpp b/redfish-core/include/utils/json_utils.hpp
index 0291fc9..22577ea 100644
--- a/redfish-core/include/utils/json_utils.hpp
+++ b/redfish-core/include/utils/json_utils.hpp
@@ -335,8 +335,8 @@
}
template <size_t Count, size_t Index>
-bool readJsonValues(const std::string& key, nlohmann::json&,
- crow::Response& res, std::bitset<Count>&)
+bool readJsonValues(const std::string& key, nlohmann::json& /*jsonValue*/,
+ crow::Response& res, std::bitset<Count>& /*handled*/)
{
BMCWEB_LOG_DEBUG << "Unable to find variable for key" << key;
messages::propertyUnknown(res, key);
@@ -368,7 +368,7 @@
}
template <size_t Index = 0, size_t Count>
-bool handleMissing(std::bitset<Count>&, crow::Response&)
+bool handleMissing(std::bitset<Count>& /*handled*/, crow::Response& /*res*/)
{
return true;
}
@@ -376,7 +376,8 @@
template <size_t Index = 0, size_t Count, typename ValueType,
typename... UnpackTypes>
bool handleMissing(std::bitset<Count>& handled, crow::Response& res,
- const char* key, ValueType&, UnpackTypes&... in)
+ const char* key, ValueType& /*unusedValue*/,
+ UnpackTypes&... in)
{
bool ret = true;
if (!handled.test(Index) && !IsOptional<ValueType>::value)
diff --git a/redfish-core/lib/bios.hpp b/redfish-core/lib/bios.hpp
index c2fb284..d8475ae 100644
--- a/redfish-core/lib/bios.hpp
+++ b/redfish-core/lib/bios.hpp
@@ -9,7 +9,7 @@
* BiosService class supports handle get method for bios.
*/
inline void
- handleBiosServiceGet(const crow::Request&,
+ handleBiosServiceGet(const crow::Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/Systems/system/Bios";
@@ -39,7 +39,7 @@
* Analyzes POST body message before sends Reset request data to D-Bus.
*/
inline void
- handleBiosResetPost(const crow::Request&,
+ handleBiosResetPost(const crow::Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
crow::connections::systemBus->async_method_call(
diff --git a/redfish-core/lib/message_registries.hpp b/redfish-core/lib/message_registries.hpp
index cfa2bf5..c2848c3 100644
--- a/redfish-core/lib/message_registries.hpp
+++ b/redfish-core/lib/message_registries.hpp
@@ -28,7 +28,8 @@
{
inline void handleMessageRegistryFileCollectionGet(
- const crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
+ const crow::Request& /*req*/,
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
// Collections don't include the static data added by SubRoute
// because it has a duplicate entry for members
@@ -59,7 +60,8 @@
}
inline void handleMessageRoutesMessageRegistryFileGet(
- const crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ const crow::Request& /*req*/,
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& registry)
{
const message_registries::Header* header = nullptr;
@@ -123,7 +125,8 @@
}
inline void handleMessageRegistryGet(
- const crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ const crow::Request& /*req*/,
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& registry, const std::string& registryMatch)
{
diff --git a/redfish-core/lib/service_root.hpp b/redfish-core/lib/service_root.hpp
index 62be63f..2a1803d 100644
--- a/redfish-core/lib/service_root.hpp
+++ b/redfish-core/lib/service_root.hpp
@@ -24,7 +24,7 @@
{
inline void
- handleServiceRootGet(const crow::Request&,
+ handleServiceRootGet(const crow::Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
diff --git a/redfish-core/lib/telemetry_service.hpp b/redfish-core/lib/telemetry_service.hpp
index c3082d7..5457530 100644
--- a/redfish-core/lib/telemetry_service.hpp
+++ b/redfish-core/lib/telemetry_service.hpp
@@ -10,7 +10,8 @@
{
inline void handleTelemetryServiceGet(
- const crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
+ const crow::Request& /*req*/,
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
asyncResp->res.jsonValue["@odata.type"] =
"#TelemetryService.v1_2_1.TelemetryService";