Skip to content

fix(PolygonsAroundVertex): handling of non-orientable meshes#1260

Open
MoulardM wants to merge 8 commits intonextfrom
fix/polygons_around_vertex
Open

fix(PolygonsAroundVertex): handling of non-orientable meshes#1260
MoulardM wants to merge 8 commits intonextfrom
fix/polygons_around_vertex

Conversation

@MoulardM
Copy link
Copy Markdown
Contributor

No description provided.

@MoulardM MoulardM requested review from BotellaA and panquez April 20, 2026 12:20
@github-actions github-actions Bot changed the base branch from master to next April 20, 2026 12:20
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v20.1.8) reports: 70 concern(s)
  • src/geode/mesh/core/surface_mesh.cpp:112:9: warning: [bugprone-easily-swappable-parameters]

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

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

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

      123 |     geode::internal::PolygonsAroundVertexImpl compute_polygons_around_vertex(
          |                                               ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:128:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      128 |         if( !first_polygon )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:141:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      141 |         do
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:152:42: note: +2, including nesting penalty of 1, nesting level increased to 2
      152 |                                          ? cur_polygon_vertex.value()
          |                                          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:157:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      157 |             if( adj_edge )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:159:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      159 |                 if( orientation_has_changed(
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:166:25: note: +3, including nesting penalty of 2, nesting level increased to 3
      166 |                         ? geode::PolygonVertex{ mesh.next_polygon_vertex(
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:170:13: note: +1, nesting level increased to 2
      170 |             else
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:176:18: note: +1
      176 |                  && safety_count < MAX_SAFETY_COUNT );
          |                  ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:179:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      179 |         if( result.vertex_is_on_border )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:184:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      184 |             if( adj_edge )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:186:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      186 |                 if( orientation_has_changed( mesh,
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:194:25: note: +3, including nesting penalty of 2, nesting level increased to 3
      194 |                         ? geode::PolygonVertex{ adj_edge.value() }
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:198:13: note: +1, nesting level increased to 2
      198 |             else
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:202:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      202 |             while( cur_polygon_vertex && safety_count < MAX_SAFETY_COUNT )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:202:39: note: +1
      202 |             while( cur_polygon_vertex && safety_count < MAX_SAFETY_COUNT )
          |                                       ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:212:46: note: +3, including nesting penalty of 2, nesting level increased to 3
      212 |                                              ? mesh.previous_polygon_vertex(
          |                                              ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:217:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      217 |                 if( adj_edge )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:219:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      219 |                     if( orientation_has_changed(
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:226:29: note: +4, including nesting penalty of 3, nesting level increased to 4
      226 |                             ? geode::PolygonVertex{ adj_edge.value() }
          |                             ^
  • src/geode/mesh/core/surface_mesh.cpp:141:9: warning: [cppcoreguidelines-avoid-do-while]

    avoid do-while loops

      141 |         do
          |         ^
  • src/geode/mesh/core/surface_mesh.cpp:264:39: warning: [readability-identifier-length]

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

      264 |                        { []( Archive& a, PolygonVertex& polygon_vertex ) {
          |                                       ^
  • src/geode/mesh/core/surface_mesh.cpp:270:41: warning: [readability-identifier-length]

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

      270 |                            []( Archive& a, PolygonVertex& polygon_vertex ) {
          |                                         ^
  • src/geode/mesh/core/surface_mesh.cpp:281:39: warning: [readability-identifier-length]

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

      281 |                        { []( Archive& a, PolygonEdge& polygon_edge ) {
          |                                       ^
  • src/geode/mesh/core/surface_mesh.cpp:287:41: warning: [readability-identifier-length]

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

      287 |                            []( Archive& a, PolygonEdge& polygon_edge ) {
          |                                         ^
  • src/geode/mesh/core/surface_mesh.cpp:303:9: warning: [google-explicit-constructor]

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

      303 |         Impl( SurfaceMesh& surface )
          |         ^
          |         explicit 
  • src/geode/mesh/core/surface_mesh.cpp:464:36: warning: [readability-identifier-length]

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

      464 |                     { []( Archive& a, Impl& impl ) {
          |                                    ^
  • src/geode/mesh/core/surface_mesh.cpp:484:38: warning: [readability-identifier-length]

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

      484 |                         []( Archive& a, Impl& impl ) {
          |                                      ^
  • src/geode/mesh/core/surface_mesh.cpp:508:38: warning: [readability-identifier-length]

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

      508 |                         []( Archive& a, Impl& impl ) {
          |                                      ^
  • src/geode/mesh/core/surface_mesh.cpp:533:38: warning: [readability-identifier-length]

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

      533 |                         []( Archive& a, Impl& impl ) {
          |                                      ^
  • src/geode/mesh/core/surface_mesh.cpp:674:80: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      674 |         const PolygonVertex& polygon_vertex, index_t vertex_id, SurfaceMeshKey )
          |                                                                                ^
          |                                                                                 /*unused*/
  • src/geode/mesh/core/surface_mesh.cpp:763:35: warning: [readability-function-cognitive-complexity]

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

      763 |         SurfaceMesh< dimension >::polygon_adjacent_edge(
          |                                   ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:767:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      767 |         if( !polygon_adj )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:777:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      777 |         for( const auto edge_id : LRange{ nb_edges } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:780:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      780 |             if( v0 == adj_vertices[edge_id] )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:784:25: note: +3, including nesting penalty of 2, nesting level increased to 3
      784 |                         ? 0u
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:786:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      786 |                 if( v1 == adj_vertices[enext] )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:788:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      788 |                     if( polygon_adjacent( polygon_adj_edge )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:796:18: note: +1, nesting level increased to 2
      796 |             else if( v1 == adj_vertices[edge_id] )
          |                  ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:800:25: note: +3, including nesting penalty of 2, nesting level increased to 3
      800 |                         ? 0u
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:802:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      802 |                 if( v0 == adj_vertices[enext] )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:804:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      804 |                     if( polygon_adjacent( polygon_adj_edge )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:813:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      813 |         if( failed_edges.empty() )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:827:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      827 |         for( const auto& edge : failed_edges )
          |         ^
  • src/geode/mesh/core/surface_mesh.cpp:772:20: warning: [readability-identifier-length]

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

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

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

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

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

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

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

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

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

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

    unchecked access to optional value

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

    unchecked access to optional value

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

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

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

      996 |             index_t from_vertex_id, index_t to_vertex_id ) const
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:996:21: note: the first parameter in the range is 'from_vertex_id'
      996 |             index_t from_vertex_id, index_t to_vertex_id ) const
          |                     ^~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/surface_mesh.cpp:996:45: note: the last parameter in the range is 'to_vertex_id'
      996 |             index_t from_vertex_id, index_t to_vertex_id ) const
          |                                             ^~~~~~~~~~~~
  • src/geode/mesh/core/surface_mesh.cpp:1069:80: warning: [hicpp-named-parameter]

    all parameters should be named in a function

     1069 |     SurfaceEdges< dimension >& SurfaceMesh< dimension >::edges( SurfaceMeshKey )
          |                                                                                ^
          |                                                                                 /*unused*/
  • src/geode/mesh/core/surface_mesh.cpp:1076:70: warning: [hicpp-named-parameter]

    all parameters should be named in a function

     1076 |         const SurfaceMesh< dimension >& surface_mesh, SurfaceMeshKey )
          |                                                                      ^
          |                                                                       /*unused*/
  • src/geode/mesh/core/surface_mesh.cpp:1094:32: warning: [readability-identifier-length]

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

     1094 |                 { []( Archive& a, SurfaceMesh& surface ) {
          |                                ^
  • src/geode/mesh/core/surface_mesh.cpp:1100:34: warning: [readability-identifier-length]

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

     1100 |                     []( Archive& a, SurfaceMesh& surface ) {
          |                                  ^
  • src/geode/mesh/core/surface_mesh.cpp:1105:34: warning: [readability-identifier-length]

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

     1105 |                     []( Archive& a, SurfaceMesh& surface ) {
          |                                  ^
  • src/geode/mesh/core/surface_mesh.cpp:1131:43: warning: [hicpp-named-parameter]

    all parameters should be named in a function

     1131 |         index_t vertex_id, SurfaceMeshKey )
          |                                           ^
          |                                            /*unused*/
  • src/geode/mesh/core/surface_mesh.cpp:1145:21: warning: [readability-identifier-length]

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

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

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

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

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

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

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

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

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

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

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

     1170 |             const auto& p3 = this->point( vertices[i + 1] );
          |                         ^
  • src/geode/mesh/core/surface_mesh.cpp:1192:14: warning: [modernize-type-traits]

    use c++14 style type templates

     1192 |     typename std::enable_if< T == 3, std::optional< Vector3D > >::type
          |     ~~~~~~~~ ^                                                  ~~~~~~
          |                            _t
  • src/geode/mesh/core/surface_mesh.cpp:1202:14: warning: [modernize-type-traits]

    use c++14 style type templates

     1202 |     typename std::enable_if< T == 3, std::optional< Vector3D > >::type
          |     ~~~~~~~~ ^                                                  ~~~~~~
          |                            _t
  • src/geode/mesh/helpers/detail/surface_merger.cpp:61:1: warning: [modernize-concat-nested-namespaces]

    nested namespaces can be concatenated

       61 | namespace geode
          | ^~~~~~~~~~~~~~~
       62 | {
          | ~
       63 |     namespace detail
          |     ~~~~~~~~~~~~~~~~
          |     namespace geode::detail
  • src/geode/mesh/helpers/detail/surface_merger.cpp:73:13: warning: [google-explicit-constructor]

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

       73 |             Impl( absl::Span< const std::reference_wrapper<
          |             ^
          |             explicit 
  • src/geode/mesh/helpers/detail/surface_merger.cpp:78:33: warning: [readability-identifier-length]

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

       78 |                 for( const auto s : Indices{ surfaces } )
          |                                 ^
  • src/geode/mesh/helpers/detail/surface_merger.cpp:111:13: warning: [modernize-use-nodiscard]

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

      111 |             index_t polygon_in_merged(
          |             ^
          |             [[nodiscard]] 
  • src/geode/mesh/helpers/detail/surface_merger.cpp:126:13: warning: [modernize-use-nodiscard]

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

      126 |             const PolygonOrigins& polygon_origins( index_t polygon ) const
          |             ^
          |             [[nodiscard]] 
  • src/geode/mesh/helpers/detail/surface_merger.cpp:146:18: warning: [readability-function-cognitive-complexity]

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

      146 |             void create_polygons( SurfaceMeshMerger< dimension >& merger )
          |                  ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:150:17: note: +1, including nesting penalty of 0, nesting level increased to 1
      150 |                 for( const auto s : Indices{ merger.meshes() } )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:153:21: note: +2, including nesting penalty of 1, nesting level increased to 2
      153 |                     for( const auto p : Range{ surface.nb_polygons() } )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:156:25: note: +3, including nesting penalty of 2, nesting level increased to 3
      156 |                         for( const auto v :
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:162:25: note: +3, including nesting penalty of 2, nesting level increased to 3
      162 |                         if( is_polygon_degenerated( vertices ) )
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:169:25: note: +3, including nesting penalty of 2, nesting level increased to 3
      169 |                         if( it.second )
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:186:25: note: +1, nesting level increased to 3
      186 |                         else
          |                         ^
  • src/geode/mesh/helpers/detail/surface_merger.cpp:150:33: warning: [readability-identifier-length]

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

      150 |                 for( const auto s : Indices{ merger.meshes() } )
          |                                 ^
  • src/geode/mesh/helpers/detail/surface_merger.cpp:166:36: warning: [readability-identifier-length]

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

      166 |                         const auto it =
          |                                    ^
  • src/geode/mesh/helpers/detail/surface_merger.cpp:204:18: warning: [readability-function-cognitive-complexity]

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

      204 |             void create_adjacencies( SurfaceMeshMerger< dimension >& merger )
          |                  ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:207:17: note: +1, including nesting penalty of 0, nesting level increased to 1
      207 |                 for( const auto p : Range{ merger.mesh().nb_polygons() } )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:209:21: note: +2, including nesting penalty of 1, nesting level increased to 2
      209 |                     for( const auto e :
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:215:25: note: +3, including nesting penalty of 2, nesting level increased to 3
      215 |                         if( !adj )
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:222:25: note: +3, including nesting penalty of 2, nesting level increased to 3
      222 |                         for( const auto& origin : polygons_origins_[p] )
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:228:29: note: +4, including nesting penalty of 3, nesting level increased to 4
      228 |                             if( !surface.is_edge_on_border( edge_origin ) )
          |                             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:234:25: note: +3, including nesting penalty of 2, nesting level increased to 3
      234 |                         if( !keep_adj )
          |                         ^
  • src/geode/mesh/helpers/detail/surface_merger.cpp:244:25: warning: [readability-function-cognitive-complexity]

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

      244 |             PolygonEdge find_edge_origin(
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:252:43: note: nesting level increased to 1
      252 |                 const auto is_same_edge = [&merger, &merged_edge_vertices,
          |                                           ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:255:21: note: +2, including nesting penalty of 1, nesting level increased to 2
      255 |                     for( const auto vertex :
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:260:25: note: +3, including nesting penalty of 2, nesting level increased to 3
      260 |                         if( merged_vertex != merged_edge_vertices[0]
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:261:29: note: +1
      261 |                             && merged_vertex != merged_edge_vertices[1] )
          |                             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:269:17: note: +1, including nesting penalty of 0, nesting level increased to 1
      269 |                 if( is_same_edge( hint_edge ) )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:273:17: note: +1, including nesting penalty of 0, nesting level increased to 1
      273 |                 for( const auto& e :
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:276:21: note: +2, including nesting penalty of 1, nesting level increased to 2
      276 |                     if( e == hint )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/detail/surface_merger.cpp:281:21: note: +2, including nesting penalty of 1, nesting level increased to 2
      281 |                     if( is_same_edge( edge ) )
          |                     ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:48:9: warning: [google-explicit-constructor]

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

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

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

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

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

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

    invalid case style for struct 'polygons_area_sign_info'

      162 |     struct polygons_area_sign_info
          |            ^~~~~~~~~~~~~~~~~~~~~~~
          |            PolygonsAreaSignInfo
      163 |     {
      164 |         polygons_area_sign_info( geode::index_t nb_init,
          |         ~~~~~~~~~~~~~~~~~~~~~~~
          |         PolygonsAreaSignInfo
      165 |             geode::index_t nb_polygons,
      166 |             geode::Sign sign_init )
      167 |             : nb_bad_polygons{ nb_init }, area_sign{ nb_polygons, sign_init }
      168 |         {
      169 |         }
      170 | 
      171 |         geode::index_t nb_bad_polygons;
      172 |         std::queue< geode::index_t > queue;
      173 |         absl::FixedArray< geode::Sign > area_sign;
      174 |     };
      175 | 
      176 |     polygons_area_sign_info compute_polygon_area_sign(
          |     ~~~~~~~~~~~~~~~~~~~~~~~
          |     PolygonsAreaSignInfo
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:164: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

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

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

      200 |     void process_null_area_polygons( const geode::SurfaceMesh2D& mesh,
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:203:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      203 |         while( !area_sign_info.queue.empty() )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:207:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      207 |             for( const auto e :
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:211:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      211 |                 if( mesh.is_edge_on_border( edge ) )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:216:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      216 |                 if( area_sign_info.area_sign[adj.polygon_id]
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:225:25: note: +1
      225 |                         && vertices[1] == adj_vertices[0] );
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:226:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      226 |                 if( same_orientation )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:232:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      232 |                 if( area_sign_info.area_sign[adj.polygon_id]
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:238:17: note: +1, nesting level increased to 3
      238 |                 else
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:245:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      245 |             if( area_sign_info.area_sign[cur_polygon] == geode::Sign::zero )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:249:18: note: +1, nesting level increased to 2
      249 |             else if( area_sign_info.area_sign[cur_polygon]
          |                  ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:215:34: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

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

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

      290 |     void reorient_bad_polygons( geode::SurfaceMeshBuilder< dimension >& builder,
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:294:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      294 |         for( const auto p : bad_polygons )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:300:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      300 |             for( const auto v : geode::LRange{ mesh.nb_polygon_vertices( p ) } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:307:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      307 |             for( const auto v : geode::LRange{ mesh.nb_polygon_vertices( p ) } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:312:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      312 |             for( const auto v : geode::LRange{ mesh.nb_polygon_vertices( p ) } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:317:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      317 |                 if( adjacents[v] )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:322:17: note: +1, nesting level increased to 3
      322 |                 else
          |                 ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:320:35: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

      320 |                         { p, v }, adjacents[v].value() );
          |                                   ^
  • tests/mesh/test-moebius-strip.cpp:32:6: warning: [misc-use-internal-linkage]

    function 'test_polygons_around_vertex' can be made static or moved into an anonymous namespace to enforce internal linkage

       32 | void test_polygons_around_vertex()
          |      ^
          | static 
  • tests/mesh/test-moebius-strip.cpp:44:5: warning: [readability-simplify-boolean-expr]

    boolean expression can be simplified by DeMorgan's theorem

       44 |     OPENGEODE_EXCEPTION( polygons_around_0[0].polygon_id == 159
          |     ^
    /__w/OpenGeode/OpenGeode/include/geode/basic/assert.hpp:121:29: note: expanded from macro 'OPENGEODE_EXCEPTION'
      121 |     if( ABSL_PREDICT_FALSE( !( condition ) ) )                                 \
          |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/base/optimization.h:189:59: note: expanded from macro 'ABSL_PREDICT_FALSE'
      189 | #define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
          |                                                           ^
  • tests/mesh/test-moebius-strip.cpp:47:5: warning: [readability-simplify-boolean-expr]

    boolean expression can be simplified by DeMorgan's theorem

       47 |     OPENGEODE_EXCEPTION( polygons_around_0[1].polygon_id == 0
          |     ^
    /__w/OpenGeode/OpenGeode/include/geode/basic/assert.hpp:121:29: note: expanded from macro 'OPENGEODE_EXCEPTION'
      121 |     if( ABSL_PREDICT_FALSE( !( condition ) ) )                                 \
          |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/base/optimization.h:189:59: note: expanded from macro 'ABSL_PREDICT_FALSE'
      189 | #define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
          |                                                           ^
  • tests/mesh/test-moebius-strip.cpp:58:5: warning: [readability-simplify-boolean-expr]

    boolean expression can be simplified by DeMorgan's theorem

       58 |     OPENGEODE_EXCEPTION( polygons_around_1[0].polygon_id == 159
          |     ^
    /__w/OpenGeode/OpenGeode/include/geode/basic/assert.hpp:121:29: note: expanded from macro 'OPENGEODE_EXCEPTION'
      121 |     if( ABSL_PREDICT_FALSE( !( condition ) ) )                                 \
          |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/base/optimization.h:189:59: note: expanded from macro 'ABSL_PREDICT_FALSE'
      189 | #define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
          |                                                           ^
  • tests/mesh/test-moebius-strip.cpp:61:5: warning: [readability-simplify-boolean-expr]

    boolean expression can be simplified by DeMorgan's theorem

       61 |     OPENGEODE_EXCEPTION( polygons_around_1[1].polygon_id == 158
          |     ^
    /__w/OpenGeode/OpenGeode/include/geode/basic/assert.hpp:121:29: note: expanded from macro 'OPENGEODE_EXCEPTION'
      121 |     if( ABSL_PREDICT_FALSE( !( condition ) ) )                                 \
          |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/base/optimization.h:189:59: note: expanded from macro 'ABSL_PREDICT_FALSE'
      189 | #define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
          |                                                           ^
  • tests/mesh/test-moebius-strip.cpp:64:5: warning: [readability-simplify-boolean-expr]

    boolean expression can be simplified by DeMorgan's theorem

       64 |     OPENGEODE_EXCEPTION( polygons_around_1[2].polygon_id == 157
          |     ^
    /__w/OpenGeode/OpenGeode/include/geode/basic/assert.hpp:121:29: note: expanded from macro 'OPENGEODE_EXCEPTION'
      121 |     if( ABSL_PREDICT_FALSE( !( condition ) ) )                                 \
          |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/base/optimization.h:189:59: note: expanded from macro 'ABSL_PREDICT_FALSE'
      189 | #define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
          |                                                           ^
  • tests/mesh/test-moebius-strip.cpp:67:5: warning: [readability-simplify-boolean-expr]

    boolean expression can be simplified by DeMorgan's theorem

       67 |     OPENGEODE_EXCEPTION( polygons_around_1[3].polygon_id == 2
          |     ^
    /__w/OpenGeode/OpenGeode/include/geode/basic/assert.hpp:121:29: note: expanded from macro 'OPENGEODE_EXCEPTION'
      121 |     if( ABSL_PREDICT_FALSE( !( condition ) ) )                                 \
          |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/base/optimization.h:189:59: note: expanded from macro 'ABSL_PREDICT_FALSE'
      189 | #define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
          |                                                           ^
  • tests/mesh/test-moebius-strip.cpp:70:5: warning: [readability-simplify-boolean-expr]

    boolean expression can be simplified by DeMorgan's theorem

       70 |     OPENGEODE_EXCEPTION( polygons_around_1[4].polygon_id == 1
          |     ^
    /__w/OpenGeode/OpenGeode/include/geode/basic/assert.hpp:121:29: note: expanded from macro 'OPENGEODE_EXCEPTION'
      121 |     if( ABSL_PREDICT_FALSE( !( condition ) ) )                                 \
          |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/base/optimization.h:189:59: note: expanded from macro 'ABSL_PREDICT_FALSE'
      189 | #define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
          |                                                           ^
  • tests/mesh/test-moebius-strip.cpp:73:5: warning: [readability-simplify-boolean-expr]

    boolean expression can be simplified by DeMorgan's theorem

       73 |     OPENGEODE_EXCEPTION( polygons_around_1[5].polygon_id == 0
          |     ^
    /__w/OpenGeode/OpenGeode/include/geode/basic/assert.hpp:121:29: note: expanded from macro 'OPENGEODE_EXCEPTION'
      121 |     if( ABSL_PREDICT_FALSE( !( condition ) ) )                                 \
          |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/base/optimization.h:189:59: note: expanded from macro 'ABSL_PREDICT_FALSE'
      189 | #define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
          |                                                           ^
  • tests/mesh/test-moebius-strip.cpp:84:5: warning: [readability-simplify-boolean-expr]

    boolean expression can be simplified by DeMorgan's theorem

       84 |     OPENGEODE_EXCEPTION( polygons_around_99[0].polygon_id == 153
          |     ^
    /__w/OpenGeode/OpenGeode/include/geode/basic/assert.hpp:121:29: note: expanded from macro 'OPENGEODE_EXCEPTION'
      121 |     if( ABSL_PREDICT_FALSE( !( condition ) ) )                                 \
          |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/base/optimization.h:189:59: note: expanded from macro 'ABSL_PREDICT_FALSE'
      189 | #define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
          |                                                           ^
  • tests/mesh/test-moebius-strip.cpp:87:5: warning: [readability-simplify-boolean-expr]

    boolean expression can be simplified by DeMorgan's theorem

       87 |     OPENGEODE_EXCEPTION( polygons_around_99[1].polygon_id == 152
          |     ^
    /__w/OpenGeode/OpenGeode/include/geode/basic/assert.hpp:121:29: note: expanded from macro 'OPENGEODE_EXCEPTION'
      121 |     if( ABSL_PREDICT_FALSE( !( condition ) ) )                                 \
          |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/base/optimization.h:189:59: note: expanded from macro 'ABSL_PREDICT_FALSE'
      189 | #define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
          |                                                           ^
  • tests/mesh/test-moebius-strip.cpp:90:5: warning: [readability-simplify-boolean-expr]

    boolean expression can be simplified by DeMorgan's theorem

       90 |     OPENGEODE_EXCEPTION( polygons_around_99[2].polygon_id == 6
          |     ^
    /__w/OpenGeode/OpenGeode/include/geode/basic/assert.hpp:121:29: note: expanded from macro 'OPENGEODE_EXCEPTION'
      121 |     if( ABSL_PREDICT_FALSE( !( condition ) ) )                                 \
          |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/base/optimization.h:189:59: note: expanded from macro 'ABSL_PREDICT_FALSE'
      189 | #define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
          |                                                           ^
  • tests/mesh/test-moebius-strip.cpp:93:5: warning: [readability-simplify-boolean-expr]

    boolean expression can be simplified by DeMorgan's theorem

       93 |     OPENGEODE_EXCEPTION( polygons_around_99[3].polygon_id == 7
          |     ^
    /__w/OpenGeode/OpenGeode/include/geode/basic/assert.hpp:121:29: note: expanded from macro 'OPENGEODE_EXCEPTION'
      121 |     if( ABSL_PREDICT_FALSE( !( condition ) ) )                                 \
          |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/base/optimization.h:189:59: note: expanded from macro 'ABSL_PREDICT_FALSE'
      189 | #define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
          |                                                           ^
  • tests/mesh/test-moebius-strip.cpp:98:6: warning: [misc-use-internal-linkage]

    function 'test' can be made static or moved into an anonymous namespace to enforce internal linkage

       98 | void test()
          |      ^
          | static 

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