Skip to content

fix(Mesh): robustness fixes found while reviewing OpenGeode-Inspector - #1354

Open
BotellaA wants to merge 8 commits into
nextfrom
fix/inspector-review-core
Open

BotellaA wants to merge 8 commits into
nextfrom
fix/inspector-review-core

Conversation

@BotellaA

Copy link
Copy Markdown
Member

Summary

OpenGeode root causes found while reviewing OpenGeode-Inspector. There is one commit per fix, and each fix comes with a test.

  • Mesh: concurrent polygons_around_vertex / polyhedra_around_vertex race. updated_polygons_around_vertex checked the cache without the lock, then reset and recomputed it. Two const callers could therefore reassign the cached vector while a third was reading it. The Inspector hits this by running topology checks (is_vertex_on_border) and mesh checks on the same meshes in parallel. An isolated vertex was also recomputed on every call. The new CachedValue::recompute_if_invalid keeps the lock-free fast path and re-checks validity under the lock. No lock is added on the hot read path.
  • Model: meshes without elements in the model meshes AABB trees. A surface with vertices but no polygons, or a line without edges, got an empty tree, and bounding_box() then threw. Such meshes are now skipped.
  • Geometry: polygon_area_sign with concave polygons. It used the first fan triangle, which is wrong for concave polygons, e.g. (0,0),(2,1),(4,0),(2,3). It now uses the exact corner orientation at the lexicographically smallest vertex.
  • Geometry: 3D segment_segment_intersection_detection projection. It dropped the thinnest bounding box axis, so segments whose plane contains that axis collapsed onto a single line. The dropped axis is now the largest component of the plane normal.
  • Mesh: 2D triangles intersection. A triangle inside another one, or nested in its corner, was not detected. Polygon fan triangles are also now computed once per pair.
  • Mesh: polygons_around_vertex safety bound. The fixed bound of 1000 polygons threw for valid high valence vertices; it now scales with the number of polygons. The propagate_around_edge safety counter was never incremented; it now is.

🤖 Generated with Claude Code

BotellaA and others added 8 commits October 14, 2026 17:54
…ger race

updated_polygons_around_vertex (and the solid equivalent) checked the cache
without the lock, then reset and recomputed it: two const callers could
reassign the cached vector while a third was reading it. An isolated vertex
was also recomputed on every call. CachedValue::recompute_if_invalid keeps the
lock-free fast path and re-checks validity under the lock before recomputing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
create_*_meshes_aabb_trees only skipped meshes without vertices: a surface with
vertices but no polygons (or a line without edges) got an empty mesh tree and
bounding_box() threw. Such components are now skipped like empty meshes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sign was taken from the first non-degenerate fan triangle from vertex 0,
which is wrong for concave polygons. It now uses the exact corner orientation
at the lexicographically smallest vertex, which is always convex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…normal

Coplanar segments were projected by dropping the thinnest bounding box axis;
when the segments plane contains that axis both segments collapse on a single
2D line and crossings are missed, e.g. (0,0,0)-(1,1,0.2) and (1,1,0)-(0,0,0.2).
The dropped axis is now the largest component of the plane normal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 2D triangle test only looked for crossing edges: a triangle strictly
inside another one, or nested in its corner at a common vertex, was not
reported. A non-common vertex of each triangle is now located in the other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
polygons_intersection_detection rebuilt the fan triangles of the other polygon
for every triangle of the first one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The propagation stopped after 1000 polygons and reported broken adjacencies
for any valid vertex with more polygons (e.g. a fan center). The bound now
depends on the number of polygons of the mesh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The safety counter of propagate_around_edge was never incremented, so the
guard against broken adjacencies could not trigger. It is now incremented and
scaled with the number of polyhedra. The new test checks broken adjacencies
around an edge are handled (it cannot loop forever with tetrahedra, so it
also passes without the counter fix).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v21.1.8) reports: 331 concern(s)
  • include/geode/basic/cached_value.hpp:38:11: warning: [cppcoreguidelines-special-member-functions]

    class 'CachedValue' defines a copy constructor, a copy assignment operator, a move constructor and a move assignment operator but does not define a destructor

       38 |     class CachedValue
          |           ^
  • include/geode/basic/cached_value.hpp:43:22: warning: [modernize-type-traits]

    use c++14 style type templates

       43 |             typename std::add_pointer< ReturnType( Args... ) >::type;
          |             ~~~~~~~~ ^                                        ~~~~~~
          |                                      _t
  • include/geode/basic/cached_value.hpp:48:13: warning: [cppcoreguidelines-prefer-member-initializer]

    'value_' should be initialized in a member initializer of the constructor

       46 |         CachedValue( const CachedValue& other )
          |                                                
          |                                                 : value_(other.value_)
       47 |         {
       48 |             value_ = other.value_;
          |             ^~~~~~~~~~~~~~~~~~~~~~
  • include/geode/basic/cached_value.hpp:49:13: warning: [cppcoreguidelines-prefer-member-initializer]

    'computed_' should be initialized in a member initializer of the constructor

       46 |         CachedValue( const CachedValue& other )
          |                                                
          |                                                , computed_(other.computed_.load())
       47 |         {
       48 |             value_ = other.value_;
       49 |             computed_ = other.computed_.load();
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • include/geode/basic/cached_value.hpp:53:13: warning: [cppcoreguidelines-prefer-member-initializer]

    'value_' should be initialized in a member initializer of the constructor

       51 |         CachedValue( CachedValue&& other ) noexcept
          |                                                    
          |                                                     : value_(std::move( other.value_ ))
       52 |         {
       53 |             value_ = std::move( other.value_ );
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • include/geode/basic/cached_value.hpp:54:13: warning: [cppcoreguidelines-prefer-member-initializer]

    'computed_' should be initialized in a member initializer of the constructor

       51 |         CachedValue( CachedValue&& other ) noexcept
          |                                                    
          |                                                    , computed_(other.computed_.load())
       52 |         {
       53 |             value_ = std::move( other.value_ );
       54 |             computed_ = other.computed_.load();
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • include/geode/basic/cached_value.hpp:57:22: warning: [cert-oop54-cpp]

    operator=() does not handle self-assignment properly

       57 |         CachedValue& operator=( const CachedValue& other )
          |                      ^
  • include/geode/basic/cached_value.hpp:152:38: warning: [cppcoreguidelines-init-variables]

    variable 'computed' is not initialized

      152 |                                 bool computed;
          |                                      ^       
          |                                               = false
  • src/geode/geometry/intersection_detection.cpp:75:39: warning: [readability-function-cognitive-complexity]

    function 'segment_segment_intersection_detection2D' has cognitive complexity of 17 (threshold 10)

       75 |     geode::SegmentSegmentIntersection segment_segment_intersection_detection2D(
          |                                       ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:86:9: note: +1, including nesting penalty of 0, nesting level increased to 1
       86 |         if( s0_p0_side == s0_p1_side || s1_p0_side == s1_p1_side )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:86:38: note: +1
       86 |         if( s0_p0_side == s0_p1_side || s1_p0_side == s1_p1_side )
          |                                      ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:88:13: note: +2, including nesting penalty of 1, nesting level increased to 2
       88 |             if( s0_p0_side == geode::SIDE::zero
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:89:17: note: +1
       89 |                 && s1_p0_side == geode::SIDE::zero )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:95:9: note: +1, including nesting penalty of 0, nesting level increased to 1
       95 |         if( s0_p0_side == geode::SIDE::zero )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:97:13: note: +2, including nesting penalty of 1, nesting level increased to 2
       97 |             if( s1_p0_side == geode::SIDE::zero )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:101:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      101 |             if( s1_p1_side == geode::SIDE::zero )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:107:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      107 |         if( s0_p1_side == geode::SIDE::zero )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:109:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      109 |             if( s1_p0_side == geode::SIDE::zero )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:113:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      113 |             if( s1_p1_side == geode::SIDE::zero )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:119:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      119 |         if( s1_p0_side == geode::SIDE::zero )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:123:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      123 |         if( s1_p1_side == geode::SIDE::zero )
          |         ^
  • src/geode/geometry/intersection_detection.cpp:75:39: warning: [readability-identifier-naming]

    invalid case style for function 'segment_segment_intersection_detection2D'

       75 |     geode::SegmentSegmentIntersection segment_segment_intersection_detection2D(
          |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                       segment_segment_intersection_detection2_d
  • src/geode/geometry/intersection_detection.cpp:131:9: warning: [readability-function-cognitive-complexity]

    function 'segment_triangle_plane_intersection_detection' has cognitive complexity of 17 (threshold 10)

      131 |         segment_triangle_plane_intersection_detection(
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:142:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      142 |         for( const auto triangle_pt : geode::LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:150:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      150 |         for( const auto edge_v0 : geode::LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:156:56: note: +2, including nesting penalty of 1, nesting level increased to 2
      156 |                                                        ? 0
          |                                                        ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:158:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      158 |             if( seg_edge_inter.first == geode::POSITION::outside
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:159:17: note: +1
      159 |                 || seg_edge_inter.first == geode::POSITION::parallel )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:163:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      163 |             if( ( seg_edge_inter.first == geode::POSITION::vertex0
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:165:17: note: +1
      165 |                 && ( seg_edge_inter.second == geode::POSITION::vertex0
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:164:21: note: +1
      164 |                     || seg_edge_inter.first == geode::POSITION::vertex1 )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:166:22: note: +1
      166 |                      || seg_edge_inter.second == geode::POSITION::vertex1 ) )
          |                      ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:172:47: note: +3, including nesting penalty of 2, nesting level increased to 3
      172 |                                               ? edge_v0
          |                                               ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:182:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      182 |         if( geode::point_triangle_position(
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:185:13: note: +1
      185 |             && geode::point_triangle_position(
          |             ^
  • src/geode/geometry/intersection_detection.cpp:242:39: warning: [readability-identifier-naming]

    invalid case style for function 'segment_segment_intersection_detection3D'

      242 |     geode::SegmentSegmentIntersection segment_segment_intersection_detection3D(
          |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                       segment_segment_intersection_detection3_d
  • src/geode/geometry/intersection_detection.cpp:303:32: warning: [readability-function-cognitive-complexity]

    function 'colinear_segment_segment_intersection_detection' has cognitive complexity of 18 (threshold 10)

      303 |     SegmentSegmentIntersection colinear_segment_segment_intersection_detection(
          |                                ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:319:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      319 |         if( s0_p0_position == POSITION::inside
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:322:13: note: +1
      322 |             || s1_p1_position == POSITION::inside )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:326:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      326 |         if( s0_p0_position == POSITION::vertex0 )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:328:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      328 |             if( s0_p1_position == POSITION::outside
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:329:17: note: +1
      329 |                 || s0_p1_position == POSITION::vertex0 )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:336:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      336 |         if( s0_p0_position == POSITION::vertex1 )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:338:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      338 |             if( s0_p1_position == POSITION::outside
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:339:17: note: +1
      339 |                 || s0_p1_position == POSITION::vertex1 )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:346:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      346 |         if( s1_p0_position == POSITION::vertex0 )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:348:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      348 |             if( s1_p1_position == POSITION::outside
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:349:17: note: +1
      349 |                 || s1_p1_position == POSITION::vertex0 )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:356:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      356 |         if( s1_p0_position == POSITION::vertex1 )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:358:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      358 |             if( s1_p1_position == POSITION::outside
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:359:17: note: +1
      359 |                 || s1_p1_position == POSITION::vertex1 )
          |                 ^
  • src/geode/geometry/sign.cpp:34:66: warning: [readability-identifier-naming]

    invalid case style for global constant 'new_axis'

       34 |     const std::array< std::array< geode::local_index_t, 2 >, 3 > new_axis{
          |                                                                  ^~~~~~~~
          |                                                                  NEW_AXIS
  • src/geode/geometry/sign.cpp:83:21: warning: [readability-identifier-length]

    variable name 'p1' is too short, expected at least 3 characters

       83 |         const auto& p1 = polygon_vertices[0];
          |                     ^
  • src/geode/geometry/sign.cpp:86:25: warning: [readability-identifier-length]

    variable name 'p2' is too short, expected at least 3 characters

       86 |             const auto& p2 = polygon_vertices[other_index];
          |                         ^
  • src/geode/geometry/sign.cpp:87:25: warning: [readability-identifier-length]

    variable name 'p3' is too short, expected at least 3 characters

       87 |             const auto& p3 = polygon_vertices[static_cast< local_index_t >(
          |                         ^
  • src/geode/mesh/core/solid_mesh.cpp:27:1: warning: [readability-duplicate-include]

    duplicate include

       26 | 
       27 | #include <stack>
          | ^~~~~~~~~~~~~~~~
  • src/geode/mesh/core/solid_mesh.cpp:167:52: warning: [readability-function-cognitive-complexity]

    function 'propagate_around_edge' has cognitive complexity of 16 (threshold 10)

      167 |     std::tuple< geode::PolyhedraAroundEdge, bool > propagate_around_edge(
          |                                                    ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:179:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      179 |         do
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:182:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      182 |             if( const auto adj = solid.polyhedron_adjacent_facet( facet ) )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:186:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      186 |                 for( const auto f : geode::LRange{ solid.nb_polyhedron_facets(
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:189:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      189 |                     if( adj_facet.facet_id == f )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:193:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      193 |                     if( solid.is_edge_in_polyhedron_facet(
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:201:13: note: +1, nesting level increased to 2
      201 |             else
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:207:18: note: +1
      207 |                  && safety_count < MAX_SAFETY_COUNT );
          |                  ^
  • src/geode/mesh/core/solid_mesh.cpp:177:20: warning: [readability-identifier-naming]

    invalid case style for variable 'MAX_SAFETY_COUNT'

      177 |         const auto MAX_SAFETY_COUNT =
          |                    ^~~~~~~~~~~~~~~~
          |                    max_safety_count
  • src/geode/mesh/core/solid_mesh.cpp:179:9: warning: [cppcoreguidelines-avoid-do-while]

    avoid do-while loops

      179 |         do
          |         ^
  • src/geode/mesh/core/solid_mesh.cpp:224:37: warning: [readability-function-cognitive-complexity]

    function 'first_polyhedron_around_edge' has cognitive complexity of 12 (threshold 10)

      224 |     std::optional< geode::index_t > first_polyhedron_around_edge(
          |                                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:228:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      228 |         for( const auto vertex : vertices )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:230:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      230 |             for( const auto& polyhedron :
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:233:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      233 |                 for( const auto& edge_vertices :
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:237:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      237 |                     if( vertices == edge_vertices
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:238:25: note: +1
      238 |                         || ( vertices[0] == edge_vertices[1]
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:239:30: note: +1
      239 |                              && vertices[1] == edge_vertices[0] ) )
          |                              ^
  • src/geode/mesh/core/solid_mesh.cpp:266:48: warning: [readability-function-cognitive-complexity]

    function 'compute_polyhedra_around_vertex' has cognitive complexity of 14 (threshold 10)

      266 |     geode::internal::PolyhedraAroundVertexImpl compute_polyhedra_around_vertex(
          |                                                ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:271:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      271 |         if( !first_polyhedron )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:288:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      288 |         while( !S.empty() && safety_count < MAX_SAFETY_COUNT )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:288:27: note: +1
      288 |         while( !S.empty() && safety_count < MAX_SAFETY_COUNT )
          |                           ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:295:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      295 |             for( const auto& polyhedron_facet :
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:300:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      300 |                 if( !adj_polyhedron )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:306:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      306 |                 if( !polyhedra_visited.insert( p_adj ).second )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:310:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      310 |                 if( const auto v_adj =
          |                 ^
  • src/geode/mesh/core/solid_mesh.cpp:284:36: warning: [cppcoreguidelines-avoid-magic-numbers]

    20 is a magic number; consider replacing it with a named constant

      284 |         polyhedra_visited.reserve( 20 );
          |                                    ^
  • src/geode/mesh/core/solid_mesh.cpp:285:47: warning: [readability-identifier-length]

    variable name 'S' is too short, expected at least 3 characters

      285 |         std::stack< geode::PolyhedronVertex > S;
          |                                               ^
  • src/geode/mesh/core/solid_mesh.cpp:285:47: warning: [readability-identifier-naming]

    invalid case style for variable 'S'

      285 |         std::stack< geode::PolyhedronVertex > S;
          |                                               ^
          |                                               s
      286 |         S.push( first_polyhedron.value() );
          |         ~
          |         s
      287 |         polyhedra_visited.insert( first_polyhedron->polyhedron_id );
      288 |         while( !S.empty() && safety_count < MAX_SAFETY_COUNT )
          |                 ~
          |                 s
      289 |         {
      290 |             safety_count++;
      291 |             result.polyhedra.push_back( S.top() );
          |                                         ~
          |                                         s
      292 |             const auto& polyhedron_vertex_id = result.polyhedra.back();
      293 |             S.pop();
          |             ~
          |             s
  • src/geode/mesh/core/solid_mesh.cpp:447:30: warning: [readability-function-cognitive-complexity]

    function 'vertices_around_vertex' has cognitive complexity of 15 (threshold 10)

      447 |         VerticesAroundVertex vertices_around_vertex(
          |                              ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:451:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      451 |             for( const auto& poly_vertex :
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:454:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      454 |                 for( const auto& poly_edge : mesh.polyhedron_edges_vertices(
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:457:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      457 |                     if( poly_edge[0] == vertex_id )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:459:25: note: +4, including nesting penalty of 3, nesting level increased to 4
      459 |                         if( absl::c_find( result, poly_edge[1] )
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:465:26: note: +1, nesting level increased to 3
      465 |                     else if( poly_edge[1] == vertex_id )
          |                          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:467:25: note: +4, including nesting penalty of 3, nesting level increased to 4
      467 |                         if( absl::c_find( result, poly_edge[0] )
          |                         ^
  • src/geode/mesh/core/solid_mesh.cpp:810:48: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      810 |     SolidMesh< dimension >::SolidMesh( BITSERY )
          |                                                ^
          |                                                 /*unused*/
  • src/geode/mesh/core/solid_mesh.cpp:917:18: warning: [cppcoreguidelines-avoid-magic-numbers]

    1. is a magic number; consider replacing it with a named constant
      917 |                / 2.;
          |                  ^
  • src/geode/mesh/core/solid_mesh.cpp:951:21: warning: [readability-identifier-length]

    variable name 'p0' is too short, expected at least 3 characters

      951 |         const auto& p0 = this->point( first_pt_index );
          |                     ^
  • src/geode/mesh/core/solid_mesh.cpp:966:29: warning: [readability-identifier-length]

    variable name 'p1' is too short, expected at least 3 characters

      966 |                 const auto& p1 = this->point( facet_vertices[i - 2] );
          |                             ^
  • src/geode/mesh/core/solid_mesh.cpp:967:29: warning: [readability-identifier-length]

    variable name 'p2' is too short, expected at least 3 characters

      967 |                 const auto& p2 = this->point( facet_vertices[i - 1] );
          |                             ^
  • src/geode/mesh/core/solid_mesh.cpp:968:29: warning: [readability-identifier-length]

    variable name 'p3' is too short, expected at least 3 characters

      968 |                 const auto& p3 = this->point( facet_vertices[i] );
          |                             ^
  • src/geode/mesh/core/solid_mesh.cpp:987:21: warning: [readability-identifier-length]

    variable name 'p1' is too short, expected at least 3 characters

      987 |         const auto& p1 = this->point( vertices[0] );
          |                     ^
  • src/geode/mesh/core/solid_mesh.cpp:990:25: warning: [readability-identifier-length]

    variable name 'p2' is too short, expected at least 3 characters

      990 |             const auto& p2 = this->point( vertices[i] );
          |                         ^
  • src/geode/mesh/core/solid_mesh.cpp:991:25: warning: [readability-identifier-length]

    variable name 'p3' is too short, expected at least 3 characters

      991 |             const auto& p3 = this->point( vertices[i + 1] );
          |                         ^
  • src/geode/mesh/core/solid_mesh.cpp:1006:21: warning: [readability-identifier-length]

    variable name 'p0' is too short, expected at least 3 characters

     1006 |         const auto& p0 = this->point( facet_vertices[0] );
          |                     ^
  • src/geode/mesh/core/solid_mesh.cpp:1010:25: warning: [readability-identifier-length]

    variable name 'p1' is too short, expected at least 3 characters

     1010 |             const auto& p1 = this->point( facet_vertices[v - 1] );
          |                         ^
  • src/geode/mesh/core/solid_mesh.cpp:1011:25: warning: [readability-identifier-length]

    variable name 'p2' is too short, expected at least 3 characters

     1011 |             const auto& p2 = this->point( facet_vertices[v] );
          |                         ^
  • src/geode/mesh/core/solid_mesh.cpp:1080:33: warning: [readability-function-cognitive-complexity]

    function 'polyhedron_facet_edge_from_vertices' has cognitive complexity of 23 (threshold 10)

     1080 |         SolidMesh< dimension >::polyhedron_facet_edge_from_vertices(
          |                                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1085:9: note: +1, including nesting penalty of 0, nesting level increased to 1
     1085 |         for( const auto f : LIndices{ facet_vertices } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1088:13: note: +2, including nesting penalty of 1, nesting level increased to 2
     1088 |             for( const auto v : LIndices{ vertices } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1090:17: note: +3, including nesting penalty of 2, nesting level increased to 3
     1090 |                 if( vertices[v] == edge_vertices[0] )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1092:64: note: +4, including nesting penalty of 3, nesting level increased to 4
     1092 |                     const auto next = v == vertices.size() - 1 ? 0 : v + 1;
          |                                                                ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1093:21: note: +4, including nesting penalty of 3, nesting level increased to 4
     1093 |                     if( vertices[next] == edge_vertices[1] )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1101:22: note: +1, nesting level increased to 3
     1101 |                 else if( vertices[v] == edge_vertices[1] )
          |                      ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1103:64: note: +4, including nesting penalty of 3, nesting level increased to 4
     1103 |                     const auto next = v == vertices.size() - 1 ? 0 : v + 1;
          |                                                                ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1104:21: note: +4, including nesting penalty of 3, nesting level increased to 4
     1104 |                     if( vertices[next] == edge_vertices[0] )
          |                     ^
  • src/geode/mesh/core/solid_mesh.cpp:1147:13: warning: [llvm-else-after-return]

    do not use 'else' after 'return'

     1147 |             else
          |             ^~~~
     1148 |             {
          |             ~
     1149 |                 return { facet.value() };
          |                 ~~~~~~~~~~~~~~~~~~~~~~~~~
     1150 |             }
          |             ~
  • src/geode/mesh/core/solid_mesh.cpp:1182:34: warning: [readability-function-cognitive-complexity]

    function 'is_edge_in_polyhedron_facet' has cognitive complexity of 13 (threshold 10)

     1182 |     bool SolidMesh< dimension >::is_edge_in_polyhedron_facet(
          |                                  ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1188:9: note: +1, including nesting penalty of 0, nesting level increased to 1
     1188 |         if( it == facet_vertices.end() )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1193:9: note: +1, including nesting penalty of 0, nesting level increased to 1
     1193 |         if( it_next != facet_vertices.end() )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1195:13: note: +2, including nesting penalty of 1, nesting level increased to 2
     1195 |             if( *it_next == edge_vertices[1] )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1200:9: note: +1, nesting level increased to 1
     1200 |         else
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1202:13: note: +2, including nesting penalty of 1, nesting level increased to 2
     1202 |             if( facet_vertices[0] == edge_vertices[1] )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1208:9: note: +1, including nesting penalty of 0, nesting level increased to 1
     1208 |         if( it != facet_vertices.begin() )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1211:13: note: +2, including nesting penalty of 1, nesting level increased to 2
     1211 |             if( *it_prev == edge_vertices[1] )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1216:9: note: +1, nesting level increased to 1
     1216 |         else
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1218:13: note: +2, including nesting penalty of 1, nesting level increased to 2
     1218 |             if( facet_vertices[facet_vertices.size() - 1] == edge_vertices[1] )
          |             ^
  • src/geode/mesh/core/solid_mesh.cpp:1187:20: warning: [readability-identifier-length]

    variable name 'it' is too short, expected at least 3 characters

     1187 |         const auto it = absl::c_find( facet_vertices, edge_vertices[0] );
          |                    ^
  • src/geode/mesh/core/solid_mesh.cpp:1243:45: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

     1243 |         return is_edge_on_border( vertices, first_polyhedron.value() );
          |                                             ^~~~~~~~~~~~~~~~
  • src/geode/mesh/core/solid_mesh.cpp:1400:42: warning: [hicpp-move-const-arg]

    std::move of the variable 'polyhedron_facet' of the trivially-copyable type 'PolyhedronFacet' has no effect; remove std::move()

     1400 |                     facets.emplace_back( std::move( polyhedron_facet ) );
          |                                          ^~~~~~~~~~                  ~
  • src/geode/mesh/core/solid_mesh.cpp:1517:20: warning: [readability-identifier-length]

    variable name 'v0' is too short, expected at least 3 characters

     1517 |         const auto v0 =
          |                    ^
  • src/geode/mesh/core/solid_mesh.cpp:1526:20: warning: [readability-identifier-length]

    variable name 'v1' is too short, expected at least 3 characters

     1526 |         const auto v1 = polyhedron_facet_vertex(
          |                    ^
  • src/geode/mesh/core/solid_mesh.cpp:1553:33: warning: [readability-function-cognitive-complexity]

    function 'polyhedron_adjacent_facet' has cognitive complexity of 12 (threshold 10)

     1553 |         SolidMesh< dimension >::polyhedron_adjacent_facet(
          |                                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1557:9: note: +1, including nesting penalty of 0, nesting level increased to 1
     1557 |         if( !opt_polyhedron_adj )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1563:9: note: +1, including nesting penalty of 0, nesting level increased to 1
     1563 |         for( const auto v : LIndices{ vertices } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1568:9: note: +1, including nesting penalty of 0, nesting level increased to 1
     1568 |         for( const auto f : LRange{ nb_polyhedron_facets( polyhedron_adj ) } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1570:13: note: +2, including nesting penalty of 1, nesting level increased to 2
     1570 |             if( polyhedron_adjacent( { polyhedron_adj, f } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1576:13: note: +2, including nesting penalty of 1, nesting level increased to 2
     1576 |             for( const auto v : LRange{
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1579:17: note: +3, including nesting penalty of 2, nesting level increased to 3
     1579 |                 if( absl::c_find( vertices, polyhedron_facet_vertex(
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:1587:13: note: +2, including nesting penalty of 1, nesting level increased to 2
     1587 |             if( all_contained )
          |             ^
  • src/geode/mesh/core/surface_mesh.cpp:119:9: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'not_same_orientation' of similar type ('const geode::PolygonEdge &') are easily swapped by mistake

      119 |         const geode::PolygonEdge& current_edge,
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      120 |         const geode::PolygonEdge& adj_edge )
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:119:35: note: the first parameter in the range is 'current_edge'
      119 |         const geode::PolygonEdge& current_edge,
          |                                   ^~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:120:35: note: the last parameter in the range is 'adj_edge'
      120 |         const geode::PolygonEdge& adj_edge )
          |                                   ^~~~~~~~
  • src/geode/mesh/core/surface_mesh.cpp:154:47: warning: [readability-function-cognitive-complexity]

    function 'compute_polygons_around_vertex' has cognitive complexity of 11 (threshold 10)

      154 |     geode::internal::PolygonsAroundVertexImpl compute_polygons_around_vertex(
          |                                               ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:159:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      159 |         if( !first_polygon )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:174:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      174 |         do
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:186:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      186 |             if( !cur_polygon_vertex )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:191:18: note: +1
      191 |                  && safety_count < MAX_SAFETY_COUNT );
          |                  ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:194:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      194 |         if( result.vertex_is_on_border )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:200:9: note: +1, nesting level increased to 1
      200 |         else
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:204:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      204 |         while( cur_polygon_vertex && safety_count < MAX_SAFETY_COUNT )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:204:35: note: +1
      204 |         while( cur_polygon_vertex && safety_count < MAX_SAFETY_COUNT )
          |                                   ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:214:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      214 |             if( !cur_polygon_vertex )
          |             ^
  • src/geode/mesh/core/surface_mesh.cpp:169:20: warning: [readability-identifier-naming]

    invalid case style for variable 'MAX_SAFETY_COUNT'

      169 |         const auto MAX_SAFETY_COUNT =
          |                    ^~~~~~~~~~~~~~~~
          |                    max_safety_count
  • src/geode/mesh/core/surface_mesh.cpp:174:9: warning: [cppcoreguidelines-avoid-do-while]

    avoid do-while loops

      174 |         do
          |         ^
  • src/geode/mesh/core/surface_mesh.cpp:546:52: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      546 |     SurfaceMesh< dimension >::SurfaceMesh( BITSERY )
          |                                                    ^
          |                                                     /*unused*/
  • src/geode/mesh/core/surface_mesh.cpp:737:35: warning: [readability-function-cognitive-complexity]

    function 'polygon_adjacent_edge' has cognitive complexity of 27 (threshold 10)

      737 |         SurfaceMesh< dimension >::polygon_adjacent_edge(
          |                                   ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:741:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      741 |         if( !polygon_adj )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:751:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      751 |         for( const auto edge_id : LRange{ nb_edges } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:754:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      754 |             if( v0 == adj_vertices[edge_id] )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:758:25: note: +3, including nesting penalty of 2, nesting level increased to 3
      758 |                         ? 0u
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:760:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      760 |                 if( v1 == adj_vertices[enext] )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:762:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      762 |                     if( polygon_adjacent( polygon_adj_edge )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:770:18: note: +1, nesting level increased to 2
      770 |             else if( v1 == adj_vertices[edge_id] )
          |                  ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:774:25: note: +3, including nesting penalty of 2, nesting level increased to 3
      774 |                         ? 0u
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:776:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      776 |                 if( v0 == adj_vertices[enext] )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:778:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      778 |                     if( polygon_adjacent( polygon_adj_edge )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:787:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      787 |         if( failed_edges.empty() )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:802:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      802 |         for( const auto& edge : failed_edges )
          |         ^
  • src/geode/mesh/core/surface_mesh.cpp:746:20: warning: [readability-identifier-length]

    variable name 'v0' is too short, expected at least 3 characters

      746 |         const auto v0 = polygon_vertex( PolygonVertex{ polygon_edge } );
          |                    ^
  • src/geode/mesh/core/surface_mesh.cpp:747:20: warning: [readability-identifier-length]

    variable name 'v1' is too short, expected at least 3 characters

      747 |         const auto v1 = polygon_edge_vertex( polygon_edge, 1 );
          |                    ^
  • src/geode/mesh/core/surface_mesh.cpp:758:27: warning: [hicpp-uppercase-literal-suffix]

    integer literal has suffix 'u', which is not uppercase

      758 |                         ? 0u
          |                           ^~
          |                            U
  • src/geode/mesh/core/surface_mesh.cpp:774:27: warning: [hicpp-uppercase-literal-suffix]

    integer literal has suffix 'u', which is not uppercase

      774 |                         ? 0u
          |                           ^~
          |                            U
  • src/geode/mesh/core/surface_mesh.cpp:834:39: warning: [hicpp-move-const-arg]

    std::move of the variable 'edge' of the trivially-copyable type 'PolygonEdge' has no effect; remove std::move()

      834 |                 borders.emplace_back( std::move( edge ) );
          |                                       ^~~~~~~~~~      ~
  • src/geode/mesh/core/surface_mesh.cpp:852:17: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

      852 |                 polygon_adjacent_edge( next_border ).value() );
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • src/geode/mesh/core/surface_mesh.cpp:870:17: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

      870 |                 polygon_adjacent_edge( previous_border ).value() );
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • src/geode/mesh/core/surface_mesh.cpp:903:18: warning: [cppcoreguidelines-avoid-magic-numbers]

    1. is a magic number; consider replacing it with a named constant
      903 |                / 2.;
          |                  ^
  • src/geode/mesh/core/surface_mesh.cpp:974:13: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'polygon_edge_from_vertices' of similar type ('index_t') are easily swapped by mistake

      974 |             index_t from_vertex_id, index_t to_vertex_id ) const
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:974:21: note: the first parameter in the range is 'from_vertex_id'
      974 |             index_t from_vertex_id, index_t to_vertex_id ) const
          |                     ^~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:974:45: note: the last parameter in the range is 'to_vertex_id'
      974 |             index_t from_vertex_id, index_t to_vertex_id ) const
          |                                             ^~~~~~~~~~~~
  • src/geode/mesh/core/surface_mesh.cpp:1152:21: warning: [readability-identifier-length]

    variable name 'p1' is too short, expected at least 3 characters

     1152 |         const auto& p1 = this->point( vertices[0] );
          |                     ^
  • src/geode/mesh/core/surface_mesh.cpp:1155:25: warning: [readability-identifier-length]

    variable name 'p2' is too short, expected at least 3 characters

     1155 |             const auto& p2 = this->point( vertices[i] );
          |                         ^
  • src/geode/mesh/core/surface_mesh.cpp:1156:25: warning: [readability-identifier-length]

    variable name 'p3' is too short, expected at least 3 characters

     1156 |             const auto& p3 = this->point( vertices[i + 1] );
          |                         ^
  • src/geode/mesh/core/surface_mesh.cpp:1173:21: warning: [readability-identifier-length]

    variable name 'p1' is too short, expected at least 3 characters

     1173 |         const auto& p1 = this->point( vertices[0] );
          |                     ^
  • src/geode/mesh/core/surface_mesh.cpp:1176:25: warning: [readability-identifier-length]

    variable name 'p2' is too short, expected at least 3 characters

     1176 |             const auto& p2 = this->point( vertices[i] );
          |                         ^
  • src/geode/mesh/core/surface_mesh.cpp:1177:25: warning: [readability-identifier-length]

    variable name 'p3' is too short, expected at least 3 characters

     1177 |             const auto& p3 = this->point( vertices[i + 1] );
          |                         ^
  • src/geode/mesh/core/surface_mesh.cpp:1229:35: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

     1229 |                 normal = normal + p_normal.value() * angle.radians();
          |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                   (                                 )
  • src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:40:9: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'triangles_common_points' of similar type ('const geode::PolygonVertices &') are easily swapped by mistake

       40 |         const geode::PolygonVertices& vertices,
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       41 |         const geode::PolygonVertices& other_vertices )
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:40:39: note: the first parameter in the range is 'vertices'
       40 |         const geode::PolygonVertices& vertices,
          |                                       ^~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:41:39: note: the last parameter in the range is 'other_vertices'
       41 |         const geode::PolygonVertices& other_vertices )
          |                                       ^~~~~~~~~~~~~~
  • src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:85:39: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'third_point_index' of similar type ('const geode::PolygonVertices &') are easily swapped by mistake

       85 |     geode::index_t third_point_index( const geode::PolygonVertices& vertices,
          |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       86 |         const geode::PolygonVertices& vertices_to_avoid )
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:85:69: note: the first parameter in the range is 'vertices'
       85 |     geode::index_t third_point_index( const geode::PolygonVertices& vertices,
          |                                                                     ^~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:86:39: note: the last parameter in the range is 'vertices_to_avoid'
       86 |         const geode::PolygonVertices& vertices_to_avoid )
          |                                       ^~~~~~~~~~~~~~~~~
  • src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:103:10: warning: [readability-function-cognitive-complexity]

    function 'triangle_intersects_other' has cognitive complexity of 15 (threshold 10)

      103 |     bool triangle_intersects_other( const geode::Triangle3D& triangle,
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:109:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      109 |         for( const auto v_id : geode::LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:111:42: note: +2, including nesting penalty of 1, nesting level increased to 2
      111 |             const auto v2_id = v_id == 2 ? 0 : v_id + 1;
          |                                          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:115:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      115 |             if( intersection.first == geode::POSITION::outside )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:119:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      119 |             if( common_points.size() != 1 )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:127:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      127 |             if( edge_inter_pt_id == geode::NO_LID
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:128:17: note: +1
      128 |                 || triangle_inter_pt_id == geode::NO_LID )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:132:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      132 |             if( triangle_vertices[edge_inter_pt_id == 0 ? v_id : v2_id]
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:134:17: note: +1
      134 |                 || other_triangle_vertices[triangle_inter_pt_id]
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:132:57: note: +2, including nesting penalty of 1, nesting level increased to 2
      132 |             if( triangle_vertices[edge_inter_pt_id == 0 ? v_id : v2_id]
          |                                                         ^
  • src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:103:10: warning: [readability-function-size]

    function 'triangle_intersects_other' exceeds recommended size/complexity thresholds

      103 |     bool triangle_intersects_other( const geode::Triangle3D& triangle,
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:103:10: note: 5 parameters (threshold 4)
  • src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:179:19: warning: [readability-suspicious-call-argument]

    1st argument 'other_triangle' (passed to 'triangle') looks like it might be swapped with the 2nd, 'triangle' (passed to 'other_triangle')

      179 |                || triangle_intersects_other( other_triangle, triangle,
          |                   ^                          ~~~~~~~~~~~~~~  ~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:103:10: note: in the call to 'triangle_intersects_other', declared here
      103 |     bool triangle_intersects_other( const geode::Triangle3D& triangle,
          |          ^                                                   ~~~~~~~~
      104 |         const geode::Triangle3D& other_triangle,
          |                                  ~~~~~~~~~~~~~~
  • src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:179:19: warning: [readability-suspicious-call-argument]

    3rd argument 'other_triangle_vertices' (passed to 'triangle_vertices') looks like it might be swapped with the 4th, 'triangle_vertices' (passed to 'other_triangle_vertices')

      179 |                || triangle_intersects_other( other_triangle, triangle,
          |                   ^
      180 |                    other_triangle_vertices, triangle_vertices, common_points );
          |                    ~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:103:10: note: in the call to 'triangle_intersects_other', declared here
      103 |     bool triangle_intersects_other( const geode::Triangle3D& triangle,
          |          ^
      104 |         const geode::Triangle3D& other_triangle,
      105 |         const geode::PolygonVertices& triangle_vertices,
          |                                       ~~~~~~~~~~~~~~~~~
      106 |         const geode::PolygonVertices& other_triangle_vertices,
          |                                       ~~~~~~~~~~~~~~~~~~~~~~~
  • src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:185:9: warning: [bugprone-easily-swappable-parameters]

    3 adjacent parameters of 'non_common_vertex_inside' of similar type ('const geode::PolygonVertices &') are easily swapped by mistake

      185 |         const geode::PolygonVertices& triangle_vertices,
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      186 |         const geode::PolygonVertices& other_triangle_vertices,
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      187 |         const geode::PolygonVertices& common_points )
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:185:39: note: the first parameter in the range is 'triangle_vertices'
      185 |         const geode::PolygonVertices& triangle_vertices,
          |                                       ^~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/mesh_intersection_detection.cpp:187:39: note: the last parameter in the range is 'common_points'
      187 |         const geode::PolygonVertices& common_points )
          |                                       ^~~~~~~~~~~~~
  • tests/basic/test-cached-value.cpp:37:5: warning: [modernize-use-nodiscard]

    function 'test' should be marked [[nodiscard]]

       37 |     double test() const
          |     ^
          |     [[nodiscard]] 

Have any feedback or feature suggestions? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant