Skip to content

Improve SonarCloud quality, Part 2 - #173

Merged
utilForever merged 9 commits into
mainfrom
code-quality
Aug 5, 2026
Merged

Improve SonarCloud quality, Part 2#173
utilForever merged 9 commits into
mainfrom
code-quality

Conversation

@utilForever

@utilForever utilForever commented Aug 4, 2026

Copy link
Copy Markdown
Owner

This revision includes:

  • Improve SonarCloud quality, Part 2 (Closes Improve SonarCloud quality, Part 2 #172)
    • Default trivial special members
    • Preserve scalar grid samplers on move
    • Rebuild vector grid samples on copy
    • Replace grid system layers on copy
    • Replace particle attributes on copy
    • Preserve surface state on assignment
    • Inline blocked boundary constraints

Summary by CodeRabbit

  • Bug Fixes
    • Improved copy and move behavior across grids, geometry, matrices, samplers, searchers, and particle data.
    • Preserved transforms, sampled values, data indices, and independent storage during object copying and movement.
    • Ensured grid sampler state remains valid after move operations.
  • Refactor
    • Simplified velocity constraint handling while maintaining collider and boundary behavior.
  • Tests
    • Expanded coverage for copy assignment, move semantics, data independence, transforms, and grid sampling.

@utilForever utilForever self-assigned this Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d478f0d1-4bcd-4819-b6cc-1db265121008

📥 Commits

Reviewing files that changed from the base of the PR and between bf328b6 and 7c246ce.

📒 Files selected for processing (2)
  • Tests/UnitTests/GridSystemData2Tests.cpp
  • Tests/UnitTests/GridSystemData3Tests.cpp
📜 Recent review details
⏰ Context from checks skipped due to timeout. (16)
  • GitHub Check: 🪟 Build - Windows Server 2025 + Visual Studio 2026
  • GitHub Check: 🪟 Build - Windows Server 2022 + Visual Studio 2022
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: 🍎 Build - macOS 15.7.4 + Xcode 16.4
  • GitHub Check: 🍎 Build - macOS 26.3 + Xcode 26.3
  • GitHub Check: 🐧 CUDA Build - Ubuntu 24.04 + gcc-12 + CUDA 12.6.3
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-17
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-18
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-16
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-12
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-13
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-14
  • GitHub Check: 🧪 Code Coverage - Codecov (Ubuntu 24.04 + gcc-14, ubuntu-24.04, gcc, 14)
  • GitHub Check: 🌞 Static Analysis - SonarCloud (Ubuntu 24.04 + gcc-14, ubuntu-24.04, gcc, 14)
  • GitHub Check: 🪟 CUDA Build - Windows Server 2022 + Visual Studio 2022 + CUDA 12.6.3 (Release)
  • GitHub Check: 🪟 CUDA Build - Windows Server 2025 + Visual Studio 2026 + CUDA 13.2.0 (Release)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{cpp,cu,hpp,h}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{cpp,cu,hpp,h}: Keep supported 2-D and 3-D behavior aligned; update dimensional counterparts, aliases, explicit instantiations, and tests when behavior applies to both dimensions.
Put dimension-independent logic in shared templates and preserve Foo2/Foo3 and pointer aliases exposed by public types.
Add explicit template instantiations for both supported dimensions when extending a dimensional template.
Preserve C++17 portability across GCC, Clang, and MSVC on Linux, macOS, and Windows; avoid compiler extensions unless isolated behind existing CMake checks.
Treat warnings as errors and fix project warnings instead of globally suppressing them.
Use project includes, keep code in the CubbyFlow namespace, follow existing -Impl.hpp conventions for visible template definitions, and reuse nearby ownership aliases and builder APIs.
Use existing repository patterns and abstractions before adding new code, abstractions, or dependencies.
Use the existing parallel helpers and keep behavior correct across TBB, OpenMP, HPX, CPP11Thread, and Serial backends.
Format touched C++ and CUDA files with .clang-format; follow four-space indentation, an 80-column limit, sorted includes, and project brace style.

Files:

  • Tests/UnitTests/GridSystemData2Tests.cpp
  • Tests/UnitTests/GridSystemData3Tests.cpp
Tests/UnitTests/**/*.{cpp,hpp,h}

📄 CodeRabbit inference engine (AGENTS.md)

Use GoogleTest/GMock macros such as TEST, EXPECT_*, and ASSERT_*, and prefer one focused regression scenario over broad fixtures or new test frameworks.

Files:

  • Tests/UnitTests/GridSystemData2Tests.cpp
  • Tests/UnitTests/GridSystemData3Tests.cpp
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not commit build output, test logs, caches, IDE state, or unrelated local changes.
Keep each commit focused on one logical change and use the conventional prefixes feat:, fix:, refactor:, test:, docs:, build:, ci:, or chore:.

Files:

  • Tests/UnitTests/GridSystemData2Tests.cpp
  • Tests/UnitTests/GridSystemData3Tests.cpp
🪛 Cppcheck (2.21.0)
Tests/UnitTests/GridSystemData2Tests.cpp

[error] 20-20: There is an unknown macro here somewhere. Configuration is required. If MANUALLY_ALIGNED_STRUCT is a macro then please configure it.

(unknownMacro)

Tests/UnitTests/GridSystemData3Tests.cpp

[error] 20-20: There is an unknown macro here somewhere. Configuration is required. If MANUALLY_ALIGNED_STRUCT is a macro then please configure it.

(unknownMacro)

🔇 Additional comments (8)
Tests/UnitTests/GridSystemData2Tests.cpp (4)

17-56: LGTM!


89-118: LGTM!


120-140: LGTM!


260-260: LGTM!

Tests/UnitTests/GridSystemData3Tests.cpp (4)

17-57: LGTM!


100-129: LGTM!


131-150: LGTM!


282-282: LGTM!


📝 Walkthrough

Walkthrough

The PR replaces manual copy and move implementations with compiler-generated special members across core types. It also updates grid and particle state transfer, simplifies blocked-boundary velocity helpers, and adds unit tests for copy, move, assignment, and state preservation.

Changes

Copy and Move Semantics Refactor

Layer / File(s) Summary
Core array and matrix special members
Includes/Core/Array/*, Includes/Core/Math/Quaternion-Impl.hpp, Includes/Core/Matrix/*
Array samplers, array views, matrices, quaternions, and MatrixCSR now use defaulted special members.
Geometry state copying
Includes/Core/Geometry/*, Sources/Core/Geometry/*
Geometry types use defaulted special members. SurfaceSet and TriangleMesh3 assign base surface state before derived data and cache updates.
Grid and particle state transfer
Sources/Core/Grid/*, Sources/Core/Particle/*
Grid and particle classes simplify copy and move operations. ScalarGrid refreshes its callable sampler after moves. GridSystemData preserves velocity selection, and particle assignment reuses complete copied state.
Searcher and solver helper simplification
Sources/Core/Searcher/*, Sources/Core/Solver/Grid/*
Searcher special members use compiler defaults. Blocked-boundary solvers use direct parameterized velocity-constraint helpers.
Copy and move behavior tests
Tests/UnitTests/*
Tests cover moved grid data, independent copied grids, copied particle layouts, preserved velocity selection, and preserved geometry state.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Poem

A rabbit checks each copied state,
Moves keep their values accurate and straight.
Grids retain their selected flow,
Helpers pass the data they know.
Defaulted members clear the way,
For cleaner code by close of day.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Linked Issues check ❓ Inconclusive The changes address all listed coding objectives, but the context does not verify the target SonarCloud metrics or vulnerability count. Provide SonarCloud results confirming Security A, zero vulnerabilities, and zero high-severity maintainability issues.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the SonarCloud quality improvements covered by the pull request and linked issue.
Out of Scope Changes check ✅ Passed The production and test changes align with the stated SonarCloud quality objectives, with no unrelated code changes identified.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch code-quality

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

@codacy-production

codacy-production Bot commented Aug 4, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics -82 complexity · -10 duplication

Metric Results
Complexity -82
Duplication -10

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
Tests/UnitTests/VertexCenteredScalarGrid2Tests.cpp (1)

57-57: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Wrap this declaration.

Line 57 exceeds the 80-column limit.

As per coding guidelines, format touched C++ files with .clang-format and follow an 80-column limit.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Tests/UnitTests/VertexCenteredScalarGrid2Tests.cpp` at line 57, Wrap the
VertexCenteredScalarGrid2 declaration in the affected test so it conforms to the
80-column limit, preserving the existing arguments and formatting it according
to the repository’s .clang-format style.

Source: Coding guidelines

Tests/UnitTests/CellCenteredScalarGrid2Tests.cpp (1)

57-57: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Wrap this declaration.

Line 57 exceeds the 80-column limit.

As per coding guidelines, format touched C++ files with .clang-format and follow an 80-column limit.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Tests/UnitTests/CellCenteredScalarGrid2Tests.cpp` at line 57, The
CellCenteredScalarGrid2 source declaration at line 57 exceeds the 80-column
limit and must be wrapped. Break the constructor call across multiple lines,
placing each argument or logical group of arguments on its own line with proper
indentation, ensuring no single line exceeds 80 columns while maintaining the
same initialization behavior and readability.

Source: Coding guidelines

Tests/UnitTests/GridSystemData2Tests.cpp (1)

44-70: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Assert replaced grid layer types in both dimensions.

Both tests create different source and destination grid types, but verify only category counts. A copy assignment that retains the destination layer types will pass.

  • Tests/UnitTests/GridSystemData2Tests.cpp#L44-L70: Assert each assigned scalar, vector, and advectable layer has the source concrete type.
  • Tests/UnitTests/GridSystemData3Tests.cpp#L53-L79: Assert each assigned scalar, vector, and advectable layer has the source concrete type.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Tests/UnitTests/GridSystemData2Tests.cpp` around lines 44 - 70, Extend the
copy-assignment assertions in Tests/UnitTests/GridSystemData2Tests.cpp lines
44-70 and Tests/UnitTests/GridSystemData3Tests.cpp lines 53-79 to verify that
every assigned scalar, vector, advectable scalar, and advectable vector layer
has the source’s concrete grid type, not merely matching category counts; use
the existing layer accessors and appropriate runtime type checks while
preserving the Velocity inequality assertion.
Tests/UnitTests/ParticleSystemData2Tests.cpp (1)

43-61: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Verify copied particle data in both dimensions.

Both tests verify registration indices only. They do not prove that assignment and Set copy particle count, data values, or independent attribute storage.

  • Tests/UnitTests/ParticleSystemData2Tests.cpp#L43-L61: Set non-default scalar and vector values, verify copied values and particle count, then mutate the source.
  • Tests/UnitTests/ParticleSystemData3Tests.cpp#L44-L62: Set non-default scalar and vector values, verify copied values and particle count, then mutate the source.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Tests/UnitTests/ParticleSystemData2Tests.cpp` around lines 43 - 61, Extend
the assignment and Set tests in Tests/UnitTests/ParticleSystemData2Tests.cpp
lines 43-61 and Tests/UnitTests/ParticleSystemData3Tests.cpp lines 44-62:
initialize non-default scalar and vector particle values, verify copied particle
counts and values after assigned = source and Set(source), then mutate the
source and confirm both copies retain their original values, proving independent
attribute storage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Sources/Core/Grid/GridSystemData.cpp`:
- Around line 89-93: Preserve the serialized velocity-layer index across copying
by updating the copy constructor, move constructor, and move assignment for
GridSystemData to copy m_velocityIdx before rebuilding m_velocity, then use that
index for the velocity lookup instead of defaulting to zero. Add a regression
test covering deserialization with a nonzero index targeting a FaceCenteredGrid
and verify assignment retains the selected layer.

---

Nitpick comments:
In `@Tests/UnitTests/CellCenteredScalarGrid2Tests.cpp`:
- Line 57: The CellCenteredScalarGrid2 source declaration at line 57 exceeds the
80-column limit and must be wrapped. Break the constructor call across multiple
lines, placing each argument or logical group of arguments on its own line with
proper indentation, ensuring no single line exceeds 80 columns while maintaining
the same initialization behavior and readability.

In `@Tests/UnitTests/GridSystemData2Tests.cpp`:
- Around line 44-70: Extend the copy-assignment assertions in
Tests/UnitTests/GridSystemData2Tests.cpp lines 44-70 and
Tests/UnitTests/GridSystemData3Tests.cpp lines 53-79 to verify that every
assigned scalar, vector, advectable scalar, and advectable vector layer has the
source’s concrete grid type, not merely matching category counts; use the
existing layer accessors and appropriate runtime type checks while preserving
the Velocity inequality assertion.

In `@Tests/UnitTests/ParticleSystemData2Tests.cpp`:
- Around line 43-61: Extend the assignment and Set tests in
Tests/UnitTests/ParticleSystemData2Tests.cpp lines 43-61 and
Tests/UnitTests/ParticleSystemData3Tests.cpp lines 44-62: initialize non-default
scalar and vector particle values, verify copied particle counts and values
after assigned = source and Set(source), then mutate the source and confirm both
copies retain their original values, proving independent attribute storage.

In `@Tests/UnitTests/VertexCenteredScalarGrid2Tests.cpp`:
- Line 57: Wrap the VertexCenteredScalarGrid2 declaration in the affected test
so it conforms to the 80-column limit, preserving the existing arguments and
formatting it according to the repository’s .clang-format style.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e15cef26-4179-447e-9631-f211fa752854

📥 Commits

Reviewing files that changed from the base of the PR and between 6c4c101 and 6760330.

📒 Files selected for processing (47)
  • Includes/Core/Array/ArraySamplers-Impl.hpp
  • Includes/Core/Array/ArrayView-Impl.hpp
  • Includes/Core/Geometry/BoundingBox-Impl.hpp
  • Includes/Core/Geometry/Ray-Impl.hpp
  • Includes/Core/Math/Quaternion-Impl.hpp
  • Includes/Core/Matrix/Matrix-Impl.hpp
  • Includes/Core/Matrix/Matrix.hpp
  • Includes/Core/Matrix/MatrixCSR-Impl.hpp
  • Sources/Core/Geometry/Box.cpp
  • Sources/Core/Geometry/ImplicitSurface.cpp
  • Sources/Core/Geometry/Plane.cpp
  • Sources/Core/Geometry/Sphere.cpp
  • Sources/Core/Geometry/Surface.cpp
  • Sources/Core/Geometry/SurfaceSet.cpp
  • Sources/Core/Geometry/SurfaceToImplicit.cpp
  • Sources/Core/Geometry/TriangleMesh3.cpp
  • Sources/Core/Grid/CellCenteredScalarGrid.cpp
  • Sources/Core/Grid/CellCenteredVectorGrid.cpp
  • Sources/Core/Grid/Grid.cpp
  • Sources/Core/Grid/GridSystemData.cpp
  • Sources/Core/Grid/ScalarGrid.cpp
  • Sources/Core/Grid/VectorGrid.cpp
  • Sources/Core/Grid/VertexCenteredScalarGrid.cpp
  • Sources/Core/Grid/VertexCenteredVectorGrid.cpp
  • Sources/Core/Particle/ParticleSystemData.cpp
  • Sources/Core/Particle/SPHSystemData.cpp
  • Sources/Core/Searcher/PointHashGridSearcher.cpp
  • Sources/Core/Searcher/PointKdTreeSearcher.cpp
  • Sources/Core/Searcher/PointParallelHashGridSearcher.cpp
  • Sources/Core/Searcher/PointSimpleListSearcher.cpp
  • Sources/Core/Solver/Grid/GridBlockedBoundaryConditionSolver2.cpp
  • Sources/Core/Solver/Grid/GridBlockedBoundaryConditionSolver3.cpp
  • Tests/UnitTests/CellCenteredScalarGrid2Tests.cpp
  • Tests/UnitTests/CellCenteredScalarGrid3Tests.cpp
  • Tests/UnitTests/CellCenteredVectorGrid2Tests.cpp
  • Tests/UnitTests/CellCenteredVectorGrid3Tests.cpp
  • Tests/UnitTests/GridSystemData2Tests.cpp
  • Tests/UnitTests/GridSystemData3Tests.cpp
  • Tests/UnitTests/ParticleSystemData2Tests.cpp
  • Tests/UnitTests/ParticleSystemData3Tests.cpp
  • Tests/UnitTests/SurfaceSet2Tests.cpp
  • Tests/UnitTests/SurfaceSet3Tests.cpp
  • Tests/UnitTests/TriangleMesh3Tests.cpp
  • Tests/UnitTests/VertexCenteredScalarGrid2Tests.cpp
  • Tests/UnitTests/VertexCenteredScalarGrid3Tests.cpp
  • Tests/UnitTests/VertexCenteredVectorGrid2Tests.cpp
  • Tests/UnitTests/VertexCenteredVectorGrid3Tests.cpp
📜 Review details
⏰ Context from checks skipped due to timeout. (16)
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-17
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-12
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-16
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-18
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-13
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-14
  • GitHub Check: 🌞 Static Analysis - SonarCloud (Ubuntu 24.04 + gcc-14, ubuntu-24.04, gcc, 14)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: 🪟 CUDA Build - Windows Server 2025 + Visual Studio 2026 + CUDA 13.2.0 (Release)
  • GitHub Check: 🪟 CUDA Build - Windows Server 2022 + Visual Studio 2022 + CUDA 12.6.3 (Release)
  • GitHub Check: 🐧 CUDA Build - Ubuntu 24.04 + gcc-12 + CUDA 12.6.3
  • GitHub Check: 🪟 Build - Windows Server 2022 + Visual Studio 2022
  • GitHub Check: 🧪 Code Coverage - Codecov (Ubuntu 24.04 + gcc-14, ubuntu-24.04, gcc, 14)
  • GitHub Check: 🪟 Build - Windows Server 2025 + Visual Studio 2026
  • GitHub Check: 🍎 Build - macOS 15.7.4 + Xcode 16.4
  • GitHub Check: 🍎 Build - macOS 26.3 + Xcode 26.3
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{cpp,cu,hpp,h}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{cpp,cu,hpp,h}: Keep supported 2-D and 3-D behavior aligned; update dimensional counterparts, aliases, explicit instantiations, and tests when behavior applies to both dimensions.
Put dimension-independent logic in shared templates and preserve Foo2/Foo3 and pointer aliases exposed by public types.
Add explicit template instantiations for both supported dimensions when extending a dimensional template.
Preserve C++17 portability across GCC, Clang, and MSVC on Linux, macOS, and Windows; avoid compiler extensions unless isolated behind existing CMake checks.
Treat warnings as errors and fix project warnings instead of globally suppressing them.
Use project includes, keep code in the CubbyFlow namespace, follow existing -Impl.hpp conventions for visible template definitions, and reuse nearby ownership aliases and builder APIs.
Use existing repository patterns and abstractions before adding new code, abstractions, or dependencies.
Use the existing parallel helpers and keep behavior correct across TBB, OpenMP, HPX, CPP11Thread, and Serial backends.
Format touched C++ and CUDA files with .clang-format; follow four-space indentation, an 80-column limit, sorted includes, and project brace style.

Files:

  • Sources/Core/Geometry/Sphere.cpp
  • Sources/Core/Grid/VectorGrid.cpp
  • Sources/Core/Geometry/TriangleMesh3.cpp
  • Includes/Core/Matrix/Matrix-Impl.hpp
  • Includes/Core/Geometry/BoundingBox-Impl.hpp
  • Tests/UnitTests/GridSystemData2Tests.cpp
  • Includes/Core/Array/ArraySamplers-Impl.hpp
  • Sources/Core/Grid/Grid.cpp
  • Includes/Core/Matrix/MatrixCSR-Impl.hpp
  • Tests/UnitTests/VertexCenteredScalarGrid2Tests.cpp
  • Sources/Core/Searcher/PointKdTreeSearcher.cpp
  • Sources/Core/Grid/GridSystemData.cpp
  • Sources/Core/Searcher/PointParallelHashGridSearcher.cpp
  • Sources/Core/Solver/Grid/GridBlockedBoundaryConditionSolver2.cpp
  • Sources/Core/Geometry/Box.cpp
  • Sources/Core/Grid/ScalarGrid.cpp
  • Sources/Core/Solver/Grid/GridBlockedBoundaryConditionSolver3.cpp
  • Sources/Core/Geometry/SurfaceSet.cpp
  • Tests/UnitTests/ParticleSystemData3Tests.cpp
  • Sources/Core/Geometry/ImplicitSurface.cpp
  • Includes/Core/Geometry/Ray-Impl.hpp
  • Tests/UnitTests/CellCenteredScalarGrid2Tests.cpp
  • Sources/Core/Grid/CellCenteredScalarGrid.cpp
  • Sources/Core/Grid/VertexCenteredVectorGrid.cpp
  • Includes/Core/Array/ArrayView-Impl.hpp
  • Tests/UnitTests/VertexCenteredVectorGrid2Tests.cpp
  • Tests/UnitTests/VertexCenteredVectorGrid3Tests.cpp
  • Sources/Core/Grid/CellCenteredVectorGrid.cpp
  • Sources/Core/Grid/VertexCenteredScalarGrid.cpp
  • Sources/Core/Particle/SPHSystemData.cpp
  • Tests/UnitTests/CellCenteredVectorGrid2Tests.cpp
  • Tests/UnitTests/SurfaceSet2Tests.cpp
  • Sources/Core/Geometry/SurfaceToImplicit.cpp
  • Tests/UnitTests/CellCenteredScalarGrid3Tests.cpp
  • Includes/Core/Matrix/Matrix.hpp
  • Includes/Core/Math/Quaternion-Impl.hpp
  • Tests/UnitTests/SurfaceSet3Tests.cpp
  • Tests/UnitTests/ParticleSystemData2Tests.cpp
  • Sources/Core/Searcher/PointSimpleListSearcher.cpp
  • Tests/UnitTests/GridSystemData3Tests.cpp
  • Sources/Core/Geometry/Surface.cpp
  • Sources/Core/Geometry/Plane.cpp
  • Tests/UnitTests/TriangleMesh3Tests.cpp
  • Tests/UnitTests/CellCenteredVectorGrid3Tests.cpp
  • Sources/Core/Particle/ParticleSystemData.cpp
  • Sources/Core/Searcher/PointHashGridSearcher.cpp
  • Tests/UnitTests/VertexCenteredScalarGrid3Tests.cpp
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not commit build output, test logs, caches, IDE state, or unrelated local changes.
Keep each commit focused on one logical change and use the conventional prefixes feat:, fix:, refactor:, test:, docs:, build:, ci:, or chore:.

Files:

  • Sources/Core/Geometry/Sphere.cpp
  • Sources/Core/Grid/VectorGrid.cpp
  • Sources/Core/Geometry/TriangleMesh3.cpp
  • Includes/Core/Matrix/Matrix-Impl.hpp
  • Includes/Core/Geometry/BoundingBox-Impl.hpp
  • Tests/UnitTests/GridSystemData2Tests.cpp
  • Includes/Core/Array/ArraySamplers-Impl.hpp
  • Sources/Core/Grid/Grid.cpp
  • Includes/Core/Matrix/MatrixCSR-Impl.hpp
  • Tests/UnitTests/VertexCenteredScalarGrid2Tests.cpp
  • Sources/Core/Searcher/PointKdTreeSearcher.cpp
  • Sources/Core/Grid/GridSystemData.cpp
  • Sources/Core/Searcher/PointParallelHashGridSearcher.cpp
  • Sources/Core/Solver/Grid/GridBlockedBoundaryConditionSolver2.cpp
  • Sources/Core/Geometry/Box.cpp
  • Sources/Core/Grid/ScalarGrid.cpp
  • Sources/Core/Solver/Grid/GridBlockedBoundaryConditionSolver3.cpp
  • Sources/Core/Geometry/SurfaceSet.cpp
  • Tests/UnitTests/ParticleSystemData3Tests.cpp
  • Sources/Core/Geometry/ImplicitSurface.cpp
  • Includes/Core/Geometry/Ray-Impl.hpp
  • Tests/UnitTests/CellCenteredScalarGrid2Tests.cpp
  • Sources/Core/Grid/CellCenteredScalarGrid.cpp
  • Sources/Core/Grid/VertexCenteredVectorGrid.cpp
  • Includes/Core/Array/ArrayView-Impl.hpp
  • Tests/UnitTests/VertexCenteredVectorGrid2Tests.cpp
  • Tests/UnitTests/VertexCenteredVectorGrid3Tests.cpp
  • Sources/Core/Grid/CellCenteredVectorGrid.cpp
  • Sources/Core/Grid/VertexCenteredScalarGrid.cpp
  • Sources/Core/Particle/SPHSystemData.cpp
  • Tests/UnitTests/CellCenteredVectorGrid2Tests.cpp
  • Tests/UnitTests/SurfaceSet2Tests.cpp
  • Sources/Core/Geometry/SurfaceToImplicit.cpp
  • Tests/UnitTests/CellCenteredScalarGrid3Tests.cpp
  • Includes/Core/Matrix/Matrix.hpp
  • Includes/Core/Math/Quaternion-Impl.hpp
  • Tests/UnitTests/SurfaceSet3Tests.cpp
  • Tests/UnitTests/ParticleSystemData2Tests.cpp
  • Sources/Core/Searcher/PointSimpleListSearcher.cpp
  • Tests/UnitTests/GridSystemData3Tests.cpp
  • Sources/Core/Geometry/Surface.cpp
  • Sources/Core/Geometry/Plane.cpp
  • Tests/UnitTests/TriangleMesh3Tests.cpp
  • Tests/UnitTests/CellCenteredVectorGrid3Tests.cpp
  • Sources/Core/Particle/ParticleSystemData.cpp
  • Sources/Core/Searcher/PointHashGridSearcher.cpp
  • Tests/UnitTests/VertexCenteredScalarGrid3Tests.cpp
Includes/Core/**/*.{hpp,h}

📄 CodeRabbit inference engine (AGENTS.md)

Keep public C++ declarations, Doxygen comments, and public contracts under Includes/Core/; place non-inline implementations in the matching Sources/Core/ domain.

Files:

  • Includes/Core/Matrix/Matrix-Impl.hpp
  • Includes/Core/Geometry/BoundingBox-Impl.hpp
  • Includes/Core/Array/ArraySamplers-Impl.hpp
  • Includes/Core/Matrix/MatrixCSR-Impl.hpp
  • Includes/Core/Geometry/Ray-Impl.hpp
  • Includes/Core/Array/ArrayView-Impl.hpp
  • Includes/Core/Matrix/Matrix.hpp
  • Includes/Core/Math/Quaternion-Impl.hpp
Tests/UnitTests/**/*.{cpp,hpp,h}

📄 CodeRabbit inference engine (AGENTS.md)

Use GoogleTest/GMock macros such as TEST, EXPECT_*, and ASSERT_*, and prefer one focused regression scenario over broad fixtures or new test frameworks.

Files:

  • Tests/UnitTests/GridSystemData2Tests.cpp
  • Tests/UnitTests/VertexCenteredScalarGrid2Tests.cpp
  • Tests/UnitTests/ParticleSystemData3Tests.cpp
  • Tests/UnitTests/CellCenteredScalarGrid2Tests.cpp
  • Tests/UnitTests/VertexCenteredVectorGrid2Tests.cpp
  • Tests/UnitTests/VertexCenteredVectorGrid3Tests.cpp
  • Tests/UnitTests/CellCenteredVectorGrid2Tests.cpp
  • Tests/UnitTests/SurfaceSet2Tests.cpp
  • Tests/UnitTests/CellCenteredScalarGrid3Tests.cpp
  • Tests/UnitTests/SurfaceSet3Tests.cpp
  • Tests/UnitTests/ParticleSystemData2Tests.cpp
  • Tests/UnitTests/GridSystemData3Tests.cpp
  • Tests/UnitTests/TriangleMesh3Tests.cpp
  • Tests/UnitTests/CellCenteredVectorGrid3Tests.cpp
  • Tests/UnitTests/VertexCenteredScalarGrid3Tests.cpp
🔇 Additional comments (43)
Includes/Core/Geometry/BoundingBox-Impl.hpp (1)

31-42: LGTM!

Includes/Core/Geometry/Ray-Impl.hpp (1)

30-39: LGTM!

Sources/Core/Geometry/Box.cpp (1)

42-51: LGTM!

Sources/Core/Geometry/ImplicitSurface.cpp (1)

25-36: LGTM!

Sources/Core/Geometry/Plane.cpp (1)

34-43: LGTM!

Sources/Core/Geometry/Sphere.cpp (1)

35-35: LGTM!

Also applies to: 47-47

Sources/Core/Geometry/Surface.cpp (1)

25-25: LGTM!

Sources/Core/Geometry/SurfaceSet.cpp (1)

56-56: LGTM!

Also applies to: 68-68

Sources/Core/Geometry/SurfaceToImplicit.cpp (1)

28-41: LGTM!

Sources/Core/Geometry/TriangleMesh3.cpp (1)

118-118: LGTM!

Sources/Core/Searcher/PointHashGridSearcher.cpp (1)

35-35: LGTM!

Also applies to: 50-50

Sources/Core/Searcher/PointKdTreeSearcher.cpp (1)

23-36: LGTM!

Sources/Core/Searcher/PointParallelHashGridSearcher.cpp (1)

40-40: LGTM!

Also applies to: 58-58

Sources/Core/Searcher/PointSimpleListSearcher.cpp (1)

21-33: LGTM!

Sources/Core/Solver/Grid/GridBlockedBoundaryConditionSolver2.cpp (1)

19-50: LGTM!

Also applies to: 65-69

Sources/Core/Solver/Grid/GridBlockedBoundaryConditionSolver3.cpp (1)

19-60: LGTM!

Also applies to: 77-80

Sources/Core/Grid/CellCenteredScalarGrid.cpp (1)

24-44: LGTM!

Also applies to: 150-150

Sources/Core/Grid/CellCenteredVectorGrid.cpp (1)

24-44: LGTM!

Also applies to: 179-179

Sources/Core/Grid/Grid.cpp (1)

16-25: LGTM!

Also applies to: 126-126

Sources/Core/Grid/GridSystemData.cpp (1)

46-61: LGTM!

Sources/Core/Grid/ScalarGrid.cpp (1)

76-80: LGTM!

Also applies to: 94-96

Sources/Core/Grid/VectorGrid.cpp (1)

60-69: LGTM!

Sources/Core/Grid/VertexCenteredScalarGrid.cpp (1)

24-44: LGTM!

Also applies to: 154-154

Sources/Core/Grid/VertexCenteredVectorGrid.cpp (1)

24-44: LGTM!

Also applies to: 185-185

Tests/UnitTests/VertexCenteredVectorGrid3Tests.cpp (1)

75-88: LGTM!

Also applies to: 466-466

Sources/Core/Particle/ParticleSystemData.cpp (1)

120-122: LGTM!

Also applies to: 430-430, 734-734

Sources/Core/Particle/SPHSystemData.cpp (1)

93-93: LGTM!

Also applies to: 110-111, 500-500

Tests/UnitTests/CellCenteredScalarGrid2Tests.cpp (1)

5-6: LGTM!

Also applies to: 55-56, 58-70, 333-333

Tests/UnitTests/CellCenteredScalarGrid3Tests.cpp (1)

5-6: LGTM!

Also applies to: 73-90, 430-430

Tests/UnitTests/CellCenteredVectorGrid2Tests.cpp (1)

58-71: LGTM!

Also applies to: 370-370

Tests/UnitTests/VertexCenteredScalarGrid2Tests.cpp (1)

5-6: LGTM!

Also applies to: 55-56, 58-70, 295-295

Tests/UnitTests/VertexCenteredScalarGrid3Tests.cpp (1)

5-6: LGTM!

Also applies to: 73-90, 377-377

Tests/UnitTests/VertexCenteredVectorGrid2Tests.cpp (1)

58-71: LGTM!

Also applies to: 371-371

Tests/UnitTests/CellCenteredVectorGrid3Tests.cpp (1)

75-87: LGTM!

Also applies to: 465-465

Tests/UnitTests/SurfaceSet2Tests.cpp (1)

49-54: LGTM!

Also applies to: 553-553

Tests/UnitTests/SurfaceSet3Tests.cpp (1)

54-60: LGTM!

Also applies to: 567-567

Tests/UnitTests/TriangleMesh3Tests.cpp (1)

16-22: LGTM!

Also applies to: 307-307

Includes/Core/Array/ArraySamplers-Impl.hpp (1)

187-200: LGTM!

Also applies to: 249-262, 349-362

Includes/Core/Array/ArrayView-Impl.hpp (1)

45-55: LGTM!

Also applies to: 111-114, 127-131

Includes/Core/Math/Quaternion-Impl.hpp (1)

60-69: LGTM!

Also applies to: 541-541

Includes/Core/Matrix/Matrix-Impl.hpp (1)

953-963: LGTM!

Also applies to: 1162-1173

Includes/Core/Matrix/Matrix.hpp (1)

70-76: LGTM!

Also applies to: 143-149, 219-225, 388-394

Includes/Core/Matrix/MatrixCSR-Impl.hpp (1)

97-97: LGTM!

Also applies to: 110-110

Comment thread Sources/Core/Grid/GridSystemData.cpp
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.61682% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.18%. Comparing base (6c4c101) to head (7c246ce).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #173      +/-   ##
==========================================
+ Coverage   82.46%   83.18%   +0.72%     
==========================================
  Files         414      414              
  Lines       23570    23286     -284     
==========================================
- Hits        19436    19370      -66     
+ Misses       4134     3916     -218     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Tests/UnitTests/GridSystemData2Tests.cpp`:
- Around line 19-20: Update the FaceCenteredGrid2 fixtures in
Tests/UnitTests/GridSystemData2Tests.cpp lines 19-20 to pass explicit unit grid
spacing { 1.0, 1.0 } for both velocity grids, and update the corresponding
FaceCenteredGrid3 fixtures in Tests/UnitTests/GridSystemData3Tests.cpp lines
19-20 to pass { 1.0, 1.0, 1.0 }. Keep the 2-D and 3-D test setup aligned with
the GridSystemData spacing.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5c01a60b-a9a9-4087-9bee-08671624c5bf

📥 Commits

Reviewing files that changed from the base of the PR and between 6760330 and bf328b6.

📒 Files selected for processing (3)
  • Sources/Core/Grid/GridSystemData.cpp
  • Tests/UnitTests/GridSystemData2Tests.cpp
  • Tests/UnitTests/GridSystemData3Tests.cpp
📜 Review details
⏰ Context from checks skipped due to timeout. (16)
  • GitHub Check: 🪟 Build - Windows Server 2022 + Visual Studio 2022
  • GitHub Check: 🪟 Build - Windows Server 2025 + Visual Studio 2026
  • GitHub Check: 🍎 Build - macOS 26.3 + Xcode 26.3
  • GitHub Check: 🍎 Build - macOS 15.7.4 + Xcode 16.4
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-14
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-18
  • GitHub Check: 🌞 Static Analysis - SonarCloud (Ubuntu 24.04 + gcc-14, ubuntu-24.04, gcc, 14)
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-17
  • GitHub Check: 🧪 Code Coverage - Codecov (Ubuntu 24.04 + gcc-14, ubuntu-24.04, gcc, 14)
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-13
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + clang-16
  • GitHub Check: 🐧 Build - Ubuntu 24.04 + gcc-12
  • GitHub Check: 🪟 CUDA Build - Windows Server 2025 + Visual Studio 2026 + CUDA 13.2.0 (Release)
  • GitHub Check: 🪟 CUDA Build - Windows Server 2022 + Visual Studio 2022 + CUDA 12.6.3 (Release)
  • GitHub Check: 🐧 CUDA Build - Ubuntu 24.04 + gcc-12 + CUDA 12.6.3
  • GitHub Check: Codacy Static Code Analysis
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{cpp,cu,hpp,h}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{cpp,cu,hpp,h}: Keep supported 2-D and 3-D behavior aligned; update dimensional counterparts, aliases, explicit instantiations, and tests when behavior applies to both dimensions.
Put dimension-independent logic in shared templates and preserve Foo2/Foo3 and pointer aliases exposed by public types.
Add explicit template instantiations for both supported dimensions when extending a dimensional template.
Preserve C++17 portability across GCC, Clang, and MSVC on Linux, macOS, and Windows; avoid compiler extensions unless isolated behind existing CMake checks.
Treat warnings as errors and fix project warnings instead of globally suppressing them.
Use project includes, keep code in the CubbyFlow namespace, follow existing -Impl.hpp conventions for visible template definitions, and reuse nearby ownership aliases and builder APIs.
Use existing repository patterns and abstractions before adding new code, abstractions, or dependencies.
Use the existing parallel helpers and keep behavior correct across TBB, OpenMP, HPX, CPP11Thread, and Serial backends.
Format touched C++ and CUDA files with .clang-format; follow four-space indentation, an 80-column limit, sorted includes, and project brace style.

Files:

  • Tests/UnitTests/GridSystemData2Tests.cpp
  • Sources/Core/Grid/GridSystemData.cpp
  • Tests/UnitTests/GridSystemData3Tests.cpp
Tests/UnitTests/**/*.{cpp,hpp,h}

📄 CodeRabbit inference engine (AGENTS.md)

Use GoogleTest/GMock macros such as TEST, EXPECT_*, and ASSERT_*, and prefer one focused regression scenario over broad fixtures or new test frameworks.

Files:

  • Tests/UnitTests/GridSystemData2Tests.cpp
  • Tests/UnitTests/GridSystemData3Tests.cpp
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not commit build output, test logs, caches, IDE state, or unrelated local changes.
Keep each commit focused on one logical change and use the conventional prefixes feat:, fix:, refactor:, test:, docs:, build:, ci:, or chore:.

Files:

  • Tests/UnitTests/GridSystemData2Tests.cpp
  • Sources/Core/Grid/GridSystemData.cpp
  • Tests/UnitTests/GridSystemData3Tests.cpp
🪛 Cppcheck (2.21.0)
Tests/UnitTests/GridSystemData2Tests.cpp

[error] 20-20: There is an unknown macro here somewhere. Configuration is required. If MANUALLY_ALIGNED_STRUCT is a macro then please configure it.

(unknownMacro)

Tests/UnitTests/GridSystemData3Tests.cpp

[error] 20-20: There is an unknown macro here somewhere. Configuration is required. If MANUALLY_ALIGNED_STRUCT is a macro then please configure it.

(unknownMacro)

🔇 Additional comments (3)
Sources/Core/Grid/GridSystemData.cpp (1)

44-46: LGTM!

Also applies to: 64-73, 76-88

Tests/UnitTests/GridSystemData2Tests.cpp (1)

89-118: LGTM!

Also applies to: 120-140, 260-260

Tests/UnitTests/GridSystemData3Tests.cpp (1)

98-127: LGTM!

Also applies to: 129-149, 280-280

Comment thread Tests/UnitTests/GridSystemData2Tests.cpp Outdated
@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

@utilForever
utilForever merged commit b4cce6c into main Aug 5, 2026
20 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve SonarCloud quality, Part 2

1 participant