Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ namespace config {
* @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);

Expand Down
5 changes: 2 additions & 3 deletions src/httpcommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ namespace http {
* @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;
Expand All @@ -227,7 +226,7 @@ namespace http {
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);
Expand Down
2 changes: 1 addition & 1 deletion src/nvhttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ namespace nvhttp {
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.
Expand Down
2 changes: 1 addition & 1 deletion src/platform/linux/vaapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ namespace va {
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));
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_confighttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ X4wnh1bwdiidqpcgyuKossLOPxbS786WmsesaAWPnpoY6M8aija+ALwNNuWWmyMg
*
* 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;
Expand Down Expand Up @@ -132,7 +132,7 @@ class ConfigHttpTest: public BaseTest { // NOSONAR(cpp:S3656) - protected membe
};

// 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
Expand Down Expand Up @@ -753,14 +753,14 @@ TEST_F(ConfigHttpTest, GetLocaleReturnsJson) {
* ├── 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)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ProcessPNGTest: public BaseTest {
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);
}

Expand Down
Loading