ref:24cbf6f833fcd85f165322c8df6a484b21303569

chore(sonar): change NOSONAR comment style (#5410)

SHA: 24cbf6f833fcd85f165322c8df6a484b21303569
Author: Dave Lane <42013603+ReenigneArcher@users.noreply.github.com>
Date: 2026-07-13 21:31
Parents: 0d1dfe4
6 files changed +10 -11
Type
src/config.cpp +1 −1
@@ -1004,6 +1004,6 @@
* @param name Setting name.
* @param output Parsed string list.
*/
void string_list_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, std::vector<std::string> &output) { // NOSONAR(cpp:S6045) - transparent hasher not available for unordered_map in this codebase
void string_list_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, std::vector<std::string> &output) { // NOSONAR(cpp:S6045): transparent hasher not available for unordered_map in this codebase
std::string temp;
string_f(vars, name, temp);
src/httpcommon.cpp +2 −3
@@ -207,8 +207,7 @@
* @brief Send a static file response for a Web UI request.
*/
bool download_file(const std::string &url, const std::string &file, long ssl_version) {
// sonar complains about weak ssl and tls versions; however sonar cannot detect the fix
CURL *curl = curl_easy_init(); // NOSONAR
CURL *curl = curl_easy_init();
if (!curl) {
BOOST_LOG(error) << "Couldn't create CURL instance";
return false;
@@ -227,7 +226,7 @@
return false;
}
curl_easy_setopt(curl, CURLOPT_SSLVERSION, ssl_version); // NOSONAR
curl_easy_setopt(curl, CURLOPT_SSLVERSION, ssl_version);
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
src/nvhttp.cpp +1 −1
@@ -175,7 +175,7 @@
std::atomic<uint32_t> session_id_counter; ///< Monotonic counter used to allocate GameStream session IDs.
// Set by TLS verify callback, read by launch/resume handler (single-threaded HTTPS server)
std::string last_verified_client_cert; ///< Last client certificate accepted by the TLS verify callback. // NOSONAR(cpp:S5421) - intentionally mutable global
std::string last_verified_client_cert; ///< Last client certificate accepted by the TLS verify callback. // NOSONAR(cpp:S5421): intentionally mutable global
/**
* @brief Case-insensitive map used for HTTP headers and query parameters.
src/platform/linux/vaapi.cpp +1 −1
@@ -749,7 +749,7 @@
std::unique_ptr<platf::avcodec_encode_device_t> make_avcodec_encode_device(int width, int height, int offset_x, int offset_y, bool vram) {
auto render_device = platf::resolve_render_device();
file_t file = ::open(render_device.c_str(), O_RDWR); // NOSONAR(cpp:S1874) - `_sopen_s` not available
file_t file = ::open(render_device.c_str(), O_RDWR); // NOSONAR(cpp:S1874): `_sopen_s` not available
if (file.el < 0) {
char string[1024];
BOOST_LOG(error) << "Couldn't open "sv << render_device << ": " << strerror_r(errno, string, sizeof(string));
tests/unit/test_confighttp.cpp +4 −4
@@ -89,7 +89,7 @@
*
* This fixture creates a real server to test the actual confighttp functions.
*/
class ConfigHttpTest: public BaseTest { // NOSONAR(cpp:S3656) - protected members are intentional for test fixture subclassing
class ConfigHttpTest: public BaseTest { // NOSONAR(cpp:S3656): protected members are intentional for test fixture subclassing
protected:
std::unique_ptr<SimpleWeb::Server<SimpleWeb::HTTPS>> server;
std::unique_ptr<SimpleWeb::Client<SimpleWeb::HTTPS>> client;
@@ -132,7 +132,7 @@
};
// Create test web directory in temp
test_web_dir = std::filesystem::temp_directory_path() / "sunshine_test_confighttp"; // NOSONAR(cpp:S5443) - safe for tests
test_web_dir = std::filesystem::temp_directory_path() / "sunshine_test_confighttp"; // NOSONAR(cpp:S5443): safe for tests
std::filesystem::create_directories(test_web_dir / "web");
// Create test HTML file in WEB_DIR, creating parent directories with proper permissions
@@ -753,14 +753,14 @@
* ├── file_beta.txt
* └── test_exec[.exe] (executable file)
*/
class BrowseDirectoryTest: public ConfigHttpTest { // NOSONAR(cpp:S3656) - protected members are intentional for test fixture subclassing
class BrowseDirectoryTest: public ConfigHttpTest { // NOSONAR(cpp:S3656): protected members are intentional for test fixture subclassing
protected:
std::filesystem::path browse_test_dir;
void SetUp() override {
ConfigHttpTest::SetUp();
browse_test_dir = std::filesystem::temp_directory_path() / "sunshine_browse_test"; // NOSONAR(cpp:S5443) - safe for tests
browse_test_dir = std::filesystem::temp_directory_path() / "sunshine_browse_test"; // NOSONAR(cpp:S5443): safe for tests
// Remove any leftover directory from a previous interrupted run
if (std::filesystem::exists(browse_test_dir)) {
tests/unit/test_process.cpp +1 −1
@@ -19,6 +19,6 @@
void SetUp() override {
BaseTest::SetUp();
// Create test directory
test_dir = fs::temp_directory_path() / "sunshine_process_png_test"; // NOSONAR(cpp:S5443) - safe for tests
test_dir = fs::temp_directory_path() / "sunshine_process_png_test"; // NOSONAR(cpp:S5443): safe for tests
fs::create_directories(test_dir);
}