Skip to content

fix(SurfaceBuilder): enable reproductible computation of polygon adja…#1258

Closed
panquez wants to merge 1 commit intonextfrom
fix/reproductible-compute-adj
Closed

fix(SurfaceBuilder): enable reproductible computation of polygon adja…#1258
panquez wants to merge 1 commit intonextfrom
fix/reproductible-compute-adj

Conversation

@panquez
Copy link
Copy Markdown
Member

@panquez panquez commented Apr 5, 2026

…cencies

@panquez panquez requested a review from BotellaA April 5, 2026 09:31
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v20.1.8) reports: 41 concern(s)
  • src/geode/mesh/builder/surface_mesh_builder.cpp:175:10: warning: [readability-function-cognitive-complexity]

    function 'update_polygon_around' has cognitive complexity of 20 (threshold 10)

      175 |     void update_polygon_around( const geode::SurfaceMesh< dimension >& surface,
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:179:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      179 |         for( const auto v : geode::Range{ surface.nb_vertices() } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:182:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      182 |             if( !polygon_vertex )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:188:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      188 |             if( new_polygon_vertex.polygon_id == geode::NO_ID )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:190:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      190 |                 for( const auto& polygon : surface.polygons_around_vertex( v ) )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:193:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      193 |                     if( new_polygon != geode::NO_ID )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:200:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      200 |             if( new_polygon_vertex.polygon_id == geode::NO_ID )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:204:13: note: +1, nesting level increased to 2
      204 |             else
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:210:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      210 |         for( const auto p : geode::Indices{ old2new } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:212:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      212 |             if( p == old2new[p] )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:216:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      216 |             for( const auto v : surface.polygon_vertices( p ) )
          |             ^
  • src/geode/mesh/builder/surface_mesh_builder.cpp:301:47: warning: [readability-function-size]

    function 'update_edge' exceeds recommended size/complexity thresholds

      301 |     geode::BijectiveMapping< geode::index_t > update_edge(
          |                                               ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:301:47: note: 5 parameters (threshold 4)
  • src/geode/mesh/builder/surface_mesh_builder.cpp:440:43: warning: [readability-function-cognitive-complexity]

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

      440 |     void SurfaceMeshBuilder< dimension >::replace_vertices(
          |                                           ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:443:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      443 |         for( const auto p : Range{ surface_mesh_.nb_polygons() } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:445:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      445 |             for( const auto v :
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:451:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      451 |                 if( !vertices_mapping.has_mapping_input( old_vertex_id ) )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:460:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      460 |                 if( old_vertex_id == new_vertex_id )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:466:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      466 |                 if( surface_mesh_.are_edges_enabled() )
          |                 ^
  • src/geode/mesh/builder/surface_mesh_builder.cpp:455:28: warning: [performance-unnecessary-copy-initialization]

    the const qualified variable 'old2news' is copy-constructed from a const reference; consider making it a const reference

      455 |                 const auto old2news = vertices_mapping.in2out( old_vertex_id );
          |                            ^
          |                           &
  • src/geode/mesh/builder/surface_mesh_builder.cpp:526:37: warning: [readability-identifier-length]

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

      526 |                 const PolygonVertex id{ p, v };
          |                                     ^
  • src/geode/mesh/builder/surface_mesh_builder.cpp:619:43: warning: [readability-function-cognitive-complexity]

    function 'compute_polygon_adjacencies' has cognitive complexity of 40 (threshold 10)

      619 |     void SurfaceMeshBuilder< dimension >::compute_polygon_adjacencies(
          |                                           ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:622:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      622 |         if( surface_mesh_.are_edges_enabled() )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:627:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      627 |             for( const auto polygon : polygons_to_connect )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:632:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      632 |                 for( const auto e : LRange{ nb_vertices } )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:635:60: note: +4, including nesting penalty of 3, nesting level increased to 4
      635 |                     const auto next = e + 1 == nb_vertices ? 0 : e + 1;
          |                                                            ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:642:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      642 |             for( const auto& polygon_edges : polygon_edges_around )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:644:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      644 |                 if( polygon_edges.size() != 2 )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:654:9: note: +1, nesting level increased to 1
      654 |         else
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:658:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      658 |             for( const auto polygon : polygons_to_connect )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:660:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      660 |                 for( const auto e :
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:664:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      664 |                     if( !surface_mesh_.is_edge_on_border( edge ) )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:670:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      670 |                     if( !output.second )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:674:25: note: +5, including nesting penalty of 4, nesting level increased to 5
      674 |                         if( surface_mesh_.is_edge_on_border( adj_edge ) )
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:678:25: note: +1, nesting level increased to 5
      678 |                         else
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:691:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      691 |             for( const auto& polygon_edges : edges )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:694:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      694 |                 if( const auto polygon_adj =
          |                 ^
  • src/geode/mesh/builder/surface_mesh_builder.cpp:713:61: warning: [readability-function-cognitive-complexity]

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

      713 |     std::vector< index_t > SurfaceMeshBuilder< dimension >::delete_polygons(
          |                                                             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:717:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      717 |         if( absl::c_find( to_delete, true ) == to_delete.end() )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:721:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      721 |         if( surface_mesh_.are_edges_enabled() )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:724:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      724 |             for( const auto p : Range{ surface_mesh_.nb_polygons() } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:726:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      726 |                 if( to_delete[p] )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:728:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      728 |                     for( const auto e :
          |                     ^
  • src/geode/mesh/builder/surface_mesh_builder.cpp:716:38: error: [clang-diagnostic-error]

    no member named 'mapping_after_deletion' in namespace 'geode::detail'

      716 |         const auto old2new = detail::mapping_after_deletion( to_delete );
          |                              ~~~~~~~~^
  • src/geode/mesh/builder/surface_mesh_builder.cpp:780:43: warning: [readability-function-cognitive-complexity]

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

      780 |     void SurfaceMeshBuilder< dimension >::update_polygon_adjacencies(
          |                                           ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:783:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      783 |         for( const auto p : geode::Range{ surface_mesh_.nb_polygons() } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:785:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      785 |             for( const auto e :
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:789:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      789 |                 if( const auto adj = surface_mesh_.polygon_adjacent( id ) )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:792:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      792 |                     if( new_adjacent == geode::NO_ID )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/builder/surface_mesh_builder.cpp:796:21: note: +1, nesting level increased to 4
      796 |                     else
          |                     ^
  • src/geode/mesh/builder/surface_mesh_builder.cpp:788:42: warning: [readability-identifier-length]

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

      788 |                 const geode::PolygonEdge id{ p, e };
          |                                          ^
  • src/geode/mesh/core/solid_edges.cpp:66:9: warning: [google-explicit-constructor]

    single-argument constructors must be marked explicit to avoid unintentional implicit conversions

       66 |         Impl( const SolidMesh< dimension >& solid )
          |         ^
          |         explicit 
  • src/geode/mesh/core/solid_edges.cpp:82:59: warning: [readability-identifier-length]

    parameter name 'a' is too short, expected at least 3 characters

       82 |                 Growable< Archive, Impl >{ { []( Archive& a, Impl& impl ) {
          |                                                           ^
  • src/geode/mesh/core/solid_edges.cpp:141:60: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      141 |         absl::Span< const index_t > old2new, SolidEdgesKey )
          |                                                            ^
          |                                                             /*unused*/
  • src/geode/mesh/core/solid_edges.cpp:151:23: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      151 |         SolidEdgesKey )
          |                       ^
          |                        /*unused*/
  • src/geode/mesh/core/solid_edges.cpp:159:63: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      159 |         std::array< index_t, 2 > edge_vertices, SolidEdgesKey )
          |                                                               ^
          |                                                                /*unused*/
  • src/geode/mesh/core/solid_edges.cpp:166:23: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      166 |         SolidEdgesKey )
          |                       ^
          |                        /*unused*/
  • src/geode/mesh/core/solid_edges.cpp:173:61: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      173 |         const std::vector< bool >& to_delete, SolidEdgesKey )
          |                                                             ^
          |                                                              /*unused*/
  • src/geode/mesh/core/solid_edges.cpp:180:60: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      180 |         const SolidEdges< dimension >& from, SolidEdgesKey )
          |                                                            ^
          |                                                             /*unused*/
  • src/geode/mesh/core/solid_edges.cpp:202:48: warning: [readability-identifier-length]

    parameter name 'a' is too short, expected at least 3 characters

      202 |                                 { []( Archive& a, SolidEdges& solid ) {
          |                                                ^
  • src/geode/mesh/core/solid_facets.cpp:70:9: warning: [google-explicit-constructor]

    single-argument constructors must be marked explicit to avoid unintentional implicit conversions

       70 |         Impl( const SolidMesh< dimension >& solid )
          |         ^
          |         explicit 
  • src/geode/mesh/core/solid_facets.cpp:151:75: warning: [readability-identifier-length]

    parameter name 'a' is too short, expected at least 3 characters

      151 |             archive.ext( *this, Growable< Archive, Impl >{ { []( Archive& a,
          |                                                                           ^
  • src/geode/mesh/core/solid_facets.cpp:211:61: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      211 |         absl::Span< const index_t > old2new, SolidFacetsKey )
          |                                                             ^
          |                                                              /*unused*/
  • src/geode/mesh/core/solid_facets.cpp:221:24: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      221 |         SolidFacetsKey )
          |                        ^
          |                         /*unused*/
  • src/geode/mesh/core/solid_facets.cpp:229:64: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      229 |         PolyhedronFacetVertices facet_vertices, SolidFacetsKey )
          |                                                                ^
          |                                                                 /*unused*/
  • src/geode/mesh/core/solid_facets.cpp:236:24: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      236 |         SolidFacetsKey )
          |                        ^
          |                         /*unused*/
  • src/geode/mesh/core/solid_facets.cpp:243:62: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      243 |         const std::vector< bool >& to_delete, SolidFacetsKey )
          |                                                              ^
          |                                                               /*unused*/
  • src/geode/mesh/core/solid_facets.cpp:250:62: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      250 |         const SolidFacets< dimension >& from, SolidFacetsKey )
          |                                                              ^
          |                                                               /*unused*/
  • src/geode/mesh/core/solid_facets.cpp:272:48: warning: [readability-identifier-length]

    parameter name 'a' is too short, expected at least 3 characters

      272 |                                 { []( Archive& a, SolidFacets& solid ) {
          |                                                ^
  • src/geode/mesh/core/texture_manager.cpp:47:9: warning: [modernize-use-nodiscard]

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

       47 |         index_t nb_textures() const
          |         ^
          |         [[nodiscard]] 
  • src/geode/mesh/core/texture_manager.cpp:57:9: warning: [modernize-use-nodiscard]

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

       57 |         const Texture< dimension >& find_texture( std::string_view name ) const
          |         ^
          |         [[nodiscard]] 
  • src/geode/mesh/core/texture_manager.cpp:62:9: warning: [modernize-use-nodiscard]

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

       62 |         absl::FixedArray< std::string_view > texture_names() const
          |         ^
          |         [[nodiscard]] 
  • src/geode/mesh/core/texture_manager.cpp:67:9: warning: [modernize-use-nodiscard]

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

       67 |         bool texture_exists( std::string_view name ) const
          |         ^
          |         [[nodiscard]] 
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:46:9: warning: [google-explicit-constructor]

    single-argument constructors must be marked explicit to avoid unintentional implicit conversions

       46 |         PolygonOrientationChecker( const geode::SurfaceMesh< dimension >& mesh )
          |         ^
          |         explicit 
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:82:14: warning: [readability-function-cognitive-complexity]

    function 'process_polygon_queue' has cognitive complexity of 20 (threshold 10)

       82 |         void process_polygon_queue( absl::FixedArray< bool >& visited )
          |              ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:84:13: note: +1, including nesting penalty of 0, nesting level increased to 1
       84 |             while( !queue_.empty() )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:91:17: note: +2, including nesting penalty of 1, nesting level increased to 2
       91 |                 for( const auto e : geode::LIndices{ vertices } )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:95:21: note: +3, including nesting penalty of 2, nesting level increased to 3
       95 |                     if( !adj )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:99:66: note: +3, including nesting penalty of 2, nesting level increased to 3
       99 |                     const auto e_next = e == vertices.size() - 1 ? 0 : e + 1;
          |                                                                  ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:104:29: note: +1
      104 |                             && vertices[e_next] == adj_vertices[0] );
          |                             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:105:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      105 |                     if( visited[adj->polygon_id] )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:109:33: note: +4, including nesting penalty of 3, nesting level increased to 4
      109 |                                 ? cur_polygon_reorient
          |                                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:123:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      123 |                     if( reorient_polygon_[adj_polygon] )
          |                     ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:132:9: warning: [modernize-use-nodiscard]

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

      132 |         absl::FixedArray< geode::index_t > get_bad_oriented_polygons() const
          |         ^
          |         [[nodiscard]] 
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:153:12: warning: [readability-identifier-naming]

    invalid case style for struct 'polygons_area_sign_info'

      153 |     struct polygons_area_sign_info
          |            ^~~~~~~~~~~~~~~~~~~~~~~
          |            PolygonsAreaSignInfo
      154 |     {
      155 |         polygons_area_sign_info( geode::index_t nb_init,
          |         ~~~~~~~~~~~~~~~~~~~~~~~
          |         PolygonsAreaSignInfo
      156 |             geode::index_t nb_polygons,
      157 |             geode::Sign sign_init )
      158 |             : nb_bad_polygons{ nb_init }, area_sign{ nb_polygons, sign_init }
      159 |         {
      160 |         }
      161 | 
      162 |         geode::index_t nb_bad_polygons;
      163 |         std::queue< geode::index_t > queue;
      164 |         absl::FixedArray< geode::Sign > area_sign;
      165 |     };
      166 | 
      167 |     polygons_area_sign_info compute_polygon_area_sign(
          |     ~~~~~~~~~~~~~~~~~~~~~~~
          |     PolygonsAreaSignInfo
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:155:34: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'polygons_area_sign_info' of similar type ('geode::index_t') are easily swapped by mistake

      155 |         polygons_area_sign_info( geode::index_t nb_init,
          |                                  ^~~~~~~~~~~~~~~~~~~~~~~
      156 |             geode::index_t nb_polygons,
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:155:49: note: the first parameter in the range is 'nb_init'
      155 |         polygons_area_sign_info( geode::index_t nb_init,
          |                                                 ^~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:156:28: note: the last parameter in the range is 'nb_polygons'
      156 |             geode::index_t nb_polygons,
          |                            ^~~~~~~~~~~
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:191:10: warning: [readability-function-cognitive-complexity]

    function 'process_null_area_polygons' has cognitive complexity of 20 (threshold 10)

      191 |     void process_null_area_polygons( const geode::SurfaceMesh2D& mesh,
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:194:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      194 |         while( !area_sign_info.queue.empty() )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:198:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      198 |             for( const auto e :
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:202:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      202 |                 if( mesh.is_edge_on_border( edge ) )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:207:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      207 |                 if( area_sign_info.area_sign[adj.polygon_id]
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:216:25: note: +1
      216 |                         && vertices[1] == adj_vertices[0] );
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:217:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      217 |                 if( same_orientation )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:223:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      223 |                 if( area_sign_info.area_sign[adj.polygon_id]
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:229:17: note: +1, nesting level increased to 3
      229 |                 else
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:236:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      236 |             if( area_sign_info.area_sign[cur_polygon] == geode::Sign::zero )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:240:18: note: +1, nesting level increased to 2
      240 |             else if( area_sign_info.area_sign[cur_polygon]
          |                  ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:206:34: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

      206 |                 const auto adj = mesh.polygon_adjacent_edge( edge ).value();
          |                                  ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:281:10: warning: [readability-function-cognitive-complexity]

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

      281 |     void reorient_bad_polygons( geode::SurfaceMeshBuilder< dimension >& builder,
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:285:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      285 |         for( const auto p : bad_polygons )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:291:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      291 |             for( const auto v : geode::LRange{ mesh.nb_polygon_vertices( p ) } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:298:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      298 |             for( const auto v : geode::LRange{ mesh.nb_polygon_vertices( p ) } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:303:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      303 |             for( const auto v : geode::LRange{ mesh.nb_polygon_vertices( p ) } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:308:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      308 |                 if( adjacents[v] )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:313:17: note: +1, nesting level increased to 3
      313 |                 else
          |                 ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:311:35: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

      311 |                         { p, v }, adjacents[v].value() );
          |                                   ^

Have any feedback or feature suggestions? Share it here.

@panquez panquez closed this Apr 5, 2026
@panquez panquez deleted the fix/reproductible-compute-adj branch April 5, 2026 12:15
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