Skip to content

fix(quality): resolve SonarQube S3490 and S1186 critical findings#1609

Merged
rapids-bot[bot] merged 3 commits into
mainfrom
fix/sonarqube-style-critical
Jul 24, 2026
Merged

fix(quality): resolve SonarQube S3490 and S1186 critical findings#1609
rapids-bot[bot] merged 3 commits into
mainfrom
fix/sonarqube-style-critical

Conversation

@ramakrishnap-nv

Copy link
Copy Markdown
Collaborator

Summary

Resolves two groups of SonarQube CRITICAL findings that have straightforward, zero-behavior-change fixes.

S3490 — Replace empty {} with = default (8 instances):

  • cuts.hpp: mixed_integer_gomory_cut_t()
  • internals.hpp: virtual ~Callback()
  • initial_problem_check.hpp: violation()
  • waypoint_matrix_test.cpp: three test class default constructors

S1186 — Add /* no-op */ comment to intentionally empty overrides (9 cuOpt instances):

  • branch_and_bound.cpp: on_node_completed, on_numerical_issue, graphviz, on_optimal_callback, update_objective_estimate
  • deterministic_workers.hpp: collect_worker_events
  • waypoint_matrix_test.cpp: TearDown (×3)
  • grpc_client_test.cpp: WaitForInitialMetadata

Note: cxxopts.hpp (third-party) is excluded.

S3490 — Use =default for empty special member functions (no behavior change):
- cuts.hpp: mixed_integer_gomory_cut_t() = default
- internals.hpp: virtual ~Callback() = default
- initial_problem_check.hpp: violation() = default
- waypoint_matrix_test.cpp: three test class default constructors

S1186 — Add /* no-op */ comment to intentionally empty overrides:
- branch_and_bound.cpp: on_node_completed, on_numerical_issue,
  graphviz, on_optimal_callback, update_objective_estimate
- deterministic_workers.hpp: collect_worker_events
- waypoint_matrix_test.cpp: TearDown (×3)
- grpc_client_test.cpp: WaitForInitialMetadata

Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@ramakrishnap-nv

Copy link
Copy Markdown
Collaborator Author

/ok to test 31f7a8b

@ramakrishnap-nv ramakrishnap-nv self-assigned this Jul 23, 2026
@ramakrishnap-nv ramakrishnap-nv added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels Jul 23, 2026
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

CI Test Summary

✅ All 31 test job(s) passed.

…orward decl

As of rmm 26.10, rmm::device_uvector is defined inside the ABI inline namespace
rmm::RMM_ABI_NAMESPACE (rmm/detail/export.hpp). cuOpt's manual
  namespace rmm { template <typename T> class device_uvector; }
forward declaration in problem_checking.cuh injects a *second*, distinct
rmm::device_uvector into the plain rmm namespace, so every use becomes ambiguous
('rmm::device_uvector is ambiguous'), which fails the build against rmm 26.10.

Replace the hand-rolled forward declaration with #include <rmm/device_uvector.hpp>
so the correctly ABI-namespaced declaration is used. (cuOpt already disables the
analogous thrust/cub ABI namespaces via -DTHRUST_DISABLE_ABI_NAMESPACE /
-DCUB_DISABLE_NAMESPACE_MAGIC; rmm's ABI namespace is newer and has no such opt-out.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Max Buckley <maxwbuckley@gmail.com>
@ramakrishnap-nv
ramakrishnap-nv marked this pull request as ready for review July 24, 2026 15:04
@ramakrishnap-nv
ramakrishnap-nv requested a review from a team as a code owner July 24, 2026 15:04
Drop on_optimal_callback overrides removed from the base class
tree_update_policy_t in main; keep /* no-op */ style on remaining
empty overrides (on_node_completed, on_numerical_issue, graphviz).

Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1f064c6b-3efe-473b-acfc-c94bb44e5898

📥 Commits

Reviewing files that changed from the base of the PR and between 1dbe5c2 and ded5045.

📒 Files selected for processing (3)
  • cpp/src/branch_and_bound/branch_and_bound.cpp
  • cpp/src/branch_and_bound/deterministic_workers.hpp
  • cpp/tests/linear_programming/grpc/grpc_client_test.cpp
🚧 Files skipped from review as they are similar to previous changes (3)
  • cpp/tests/linear_programming/grpc/grpc_client_test.cpp
  • cpp/src/branch_and_bound/deterministic_workers.hpp
  • cpp/src/branch_and_bound/branch_and_bound.cpp

📝 Walkthrough

Walkthrough

Changes

The PR replaces empty C++ constructors and a virtual destructor with = default, and marks unchanged no-op callbacks, worker methods, and test methods with explicit comments.

Implementation cleanup

Layer / File(s) Summary
Defaulted special members
benchmarks/linear_programming/cuopt/initial_problem_check.hpp, cpp/include/cuopt/.../internals.hpp, cpp/src/cuts/cuts.hpp
Empty constructors and the virtual callback destructor now use explicitly defaulted declarations.
Explicit no-op callbacks
cpp/src/branch_and_bound/branch_and_bound.cpp, cpp/src/branch_and_bound/deterministic_workers.hpp
Branch-and-bound callbacks and worker event collection retain no-op behavior with explicit comments.
Supporting test methods
cpp/tests/distance_engine/waypoint_matrix_test.cpp, cpp/tests/linear_programming/grpc/grpc_client_test.cpp
Test fixture constructors and teardown methods, plus the gRPC mock method, retain behavior while using defaulted or commented no-op implementations.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested reviewers: akifcorduk, chris-maes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the SonarQube S3490 and S1186 cleanup performed in this PR.
Description check ✅ Passed The description is directly related to the code changes and correctly lists the SonarQube fixes and exclusions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sonarqube-style-critical

Comment @coderabbitai help to get the list of available commands.

@ramakrishnap-nv ramakrishnap-nv added this to the 26.08 milestone Jul 24, 2026
@ramakrishnap-nv

Copy link
Copy Markdown
Collaborator Author

/merge

@rapids-bot
rapids-bot Bot merged commit 67c9667 into main Jul 24, 2026
155 of 163 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants