Skip to content

fix(ComponentID): change componentid class to struct - #203

Merged
BotellaA merged 1 commit into
v18from
fix/change_ComponentID_to_struct
Aug 14, 2026
Merged

fix(ComponentID): change componentid class to struct#203
BotellaA merged 1 commit into
v18from
fix/change_ComponentID_to_struct

Conversation

@BenPinet

Copy link
Copy Markdown
Member

No description provided.

@BenPinet
BenPinet requested a review from panquez August 13, 2026 15:28
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v21.1.8) reports: 29 concern(s)
  • src/geode/io/model/gid_output.cpp:64:34: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

       64 |                                  attribute_ids.value().at( 0 ) );
          |                                  ^~~~~~~~~~~~~
  • src/geode/io/model/gid_output.cpp:81:34: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

       81 |                                  attribute_ids.value().at( 0 ) );
          |                                  ^~~~~~~~~~~~~
  • src/geode/io/model/msh_input.cpp:118:14: warning: [readability-function-cognitive-complexity]

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

      118 |         void build_topology()
          |              ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:120:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      120 |             if( version() == 4
          |             ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:121:17: note: +1
      121 |                 && ( absl::c_find( sections_, "$Entities" )
          |                 ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:129:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      129 |             for( const auto uv : geode::Range{ brep_.nb_unique_vertices() } )
          |             ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:139:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      139 |             for( const auto uv : geode::Range{ brep_.nb_unique_vertices() } )
          |             ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:150:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      150 |             for( const auto& c2l : corner_line_relations )
          |             ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:152:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      152 |                 for( const auto& line_id : c2l.second )
          |                 ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:158:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      158 |             for( const auto& l2s : line_surface_relations )
          |             ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:160:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      160 |                 for( const auto& surface_id : l2s.second )
          |                 ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:166:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      166 |             for( const auto& s2b : surface_block_relations )
          |             ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:168:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      168 |                 for( const auto& block_id : s2b.second )
          |                 ^
  • src/geode/io/model/msh_input.cpp:129:29: warning: [readability-identifier-length]

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

      129 |             for( const auto uv : geode::Range{ brep_.nb_unique_vertices() } )
          |                             ^
  • src/geode/io/model/msh_input.cpp:139:29: warning: [readability-identifier-length]

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

      139 |             for( const auto uv : geode::Range{ brep_.nb_unique_vertices() } )
          |                             ^
  • src/geode/io/model/msh_input.cpp:299:33: warning: [readability-identifier-length]

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

      299 |                 for( const auto b : geode::Range{ geode::string_to_index(
          |                                 ^
  • src/geode/io/model/msh_input.cpp:315:14: warning: [readability-function-cognitive-complexity]

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

      315 |         void create_surfaces( const geode::index_t nb_surfaces )
          |              ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:317:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      317 |             for( const auto unused : geode::Range{ nb_surfaces } )
          |             ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:334:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      334 |                 for( const auto b : geode::Range{ geode::string_to_index(
          |                 ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:343:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      343 |                     if( !it.second )
          |                     ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:348:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      348 |                 for( const auto& boundary : boundary_counter )
          |                 ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:354:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      354 |                     if( boundary.second == 1 )
          |                     ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:359:21: note: +1, nesting level increased to 3
      359 |                     else
          |                     ^
  • src/geode/io/model/msh_input.cpp:334:33: warning: [readability-identifier-length]

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

      334 |                 for( const auto b : geode::Range{ geode::string_to_index(
          |                                 ^
  • src/geode/io/model/msh_input.cpp:339:26: warning: [readability-identifier-length]

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

      339 |                     auto it = boundary_counter.emplace(
          |                          ^
  • src/geode/io/model/msh_input.cpp:392:33: warning: [readability-identifier-length]

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

      392 |                 for( const auto b : geode::Range{ geode::string_to_index(
          |                                 ^
  • src/geode/io/model/msh_input.cpp:428:32: warning: [cppcoreguidelines-init-variables]

    variable 'node_id' is not initialized

      428 |                 geode::index_t node_id;
          |                                ^      
          |                                        = 0
  • src/geode/io/model/msh_input.cpp:484:29: warning: [readability-identifier-length]

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

      484 |             for( const auto n : geode::Range{ nb_nodes } )
          |                             ^
  • src/geode/io/model/msh_input.cpp:593:42: warning: [readability-identifier-naming]

    invalid case style for constexpr variable 'physical_entity'

      593 |                 constexpr geode::index_t physical_entity{ 0 };
          |                                          ^~~~~~~~~~~~~~~
          |                                          PHYSICAL_ENTITY
      594 |                 const auto element =
      595 |                     geode::internal::GMSHElementFactory::create(
      596 |                         mesh_element_type_id, physical_entity, entity_id,
          |                                               ~~~~~~~~~~~~~~~
          |                                               PHYSICAL_ENTITY
  • src/geode/io/model/msh_input.cpp:604:30: warning: [readability-identifier-length]

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

      604 |             for( const auto& c : brep_.corners() )
          |                              ^
  • src/geode/io/model/msh_input.cpp:613:30: warning: [readability-identifier-length]

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

      613 |             for( const auto& l : brep_.lines() )
          |                              ^
  • src/geode/io/model/msh_input.cpp:626:14: warning: [readability-function-cognitive-complexity]

    function 'build_surfaces' has cognitive complexity of 42 (threshold 10)

      626 |         void build_surfaces()
          |              ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:628:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      628 |             for( const auto& surface : brep_.surfaces() )
          |             ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:633:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      633 |                 for( const auto v : geode::Range{ mesh.nb_vertices() } )
          |                 ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:641:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      641 |                 for( const auto& line : brep_.internal_lines( surface ) )
          |                 ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:644:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      644 |                     for( const auto edge_id : geode::Range{ edges.nb_edges() } )
          |                     ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:654:25: note: +4, including nesting penalty of 3, nesting level increased to 4
      654 |                         for( const auto& cmv0 : cmvs0 )
          |                         ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:656:29: note: +5, including nesting penalty of 4, nesting level increased to 5
      656 |                             if( cmv0.component_id.id != surface.id() )
          |                             ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:660:29: note: +5, including nesting penalty of 4, nesting level increased to 5
      660 |                             for( const auto& cmv1 : cmvs1 )
          |                             ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:662:33: note: +6, including nesting penalty of 5, nesting level increased to 6
      662 |                                 if( cmv1.component_id.id != surface.id() )
          |                                 ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:666:33: note: +6, including nesting penalty of 5, nesting level increased to 6
      666 |                                 if( const auto edge0 =
          |                                 ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:672:33: note: +6, including nesting penalty of 5, nesting level increased to 6
      672 |                                 if( const auto edge1 =
          |                                 ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:682:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      682 |                 for( const auto& edge : polygon_edges )
          |                 ^
  • src/geode/io/model/msh_input.cpp:646:36: warning: [readability-identifier-length]

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

      646 |                         const auto e0 = edges.edge_vertex( { edge_id, 0 } );
          |                                    ^
  • src/geode/io/model/msh_input.cpp:647:36: warning: [readability-identifier-length]

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

      647 |                         const auto e1 = edges.edge_vertex( { edge_id, 1 } );
          |                                    ^
  • src/geode/io/model/msh_input.cpp:691:30: warning: [readability-identifier-length]

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

      691 |             for( const auto& b : brep_.blocks() )
          |                              ^
  • src/geode/io/model/msh_input.cpp:707:13: warning: [bugprone-easily-swappable-parameters]

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

      707 |             geode::index_t old_line_vertex_id,
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      708 |             geode::index_t new_line_vertex_id )
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:707:28: note: the first parameter in the range is 'old_line_vertex_id'
      707 |             geode::index_t old_line_vertex_id,
          |                            ^~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:708:28: note: the last parameter in the range is 'new_line_vertex_id'
      708 |             geode::index_t new_line_vertex_id )
          |                            ^~~~~~~~~~~~~~~~~~
  • src/geode/io/model/msh_input.cpp:722:13: warning: [bugprone-easily-swappable-parameters]

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

      722 |             geode::index_t old_surface_vertex_id,
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      723 |             geode::index_t new_surface_vertex_id )
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:722:28: note: the first parameter in the range is 'old_surface_vertex_id'
      722 |             geode::index_t old_surface_vertex_id,
          |                            ^~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:723:28: note: the last parameter in the range is 'new_surface_vertex_id'
      723 |             geode::index_t new_surface_vertex_id )
          |                            ^~~~~~~~~~~~~~~~~~~~~
  • src/geode/io/model/msh_input.cpp:738:13: warning: [bugprone-easily-swappable-parameters]

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

      738 |             geode::index_t old_block_vertex_id,
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      739 |             geode::index_t new_block_vertex_id )
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:738:28: note: the first parameter in the range is 'old_block_vertex_id'
      738 |             geode::index_t old_block_vertex_id,
          |                            ^~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:739:28: note: the last parameter in the range is 'new_block_vertex_id'
      739 |             geode::index_t new_block_vertex_id )
          |                            ^~~~~~~~~~~~~~~~~~~
  • src/geode/io/model/msh_input.cpp:765:30: warning: [readability-identifier-length]

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

      765 |             for( const auto& uv : unique2component )
          |                              ^
  • src/geode/io/model/msh_input.cpp:803:13: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'add_potential_relationships' of similar type ('const std::vectorgeode::ComponentMeshVertex &') are easily swapped by mistake

      803 |             const std::vector< geode::ComponentMeshVertex >&
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      804 |                 boundary_type_vertices,
          |                 ~~~~~~~~~~~~~~~~~~~~~~~
      805 |             const std::vector< geode::ComponentMeshVertex >&
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      806 |                 incidence_type_vertices,
          |                 ~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:804:17: note: the first parameter in the range is 'boundary_type_vertices'
      804 |                 boundary_type_vertices,
          |                 ^~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:806:17: note: the last parameter in the range is 'incidence_type_vertices'
      806 |                 incidence_type_vertices,
          |                 ^~~~~~~~~~~~~~~~~~~~~~~
  • src/geode/io/model/msh_input.cpp:820:13: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'filter_potential_relationships' of similar type ('const std::vectorgeode::ComponentMeshVertex &') are easily swapped by mistake

      820 |             const std::vector< geode::ComponentMeshVertex >&
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      821 |                 boundary_type_vertices,
          |                 ~~~~~~~~~~~~~~~~~~~~~~~
      822 |             const std::vector< geode::ComponentMeshVertex >&
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      823 |                 incidence_type_vertices,
          |                 ~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:821:17: note: the first parameter in the range is 'boundary_type_vertices'
      821 |                 boundary_type_vertices,
          |                 ^~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/msh_input.cpp:823:17: note: the last parameter in the range is 'incidence_type_vertices'
      823 |                 incidence_type_vertices,
          |                 ^~~~~~~~~~~~~~~~~~~~~~~
  • src/geode/io/model/msh_input.cpp:836:22: warning: [readability-identifier-length]

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

      836 |                 auto it = incidences_in_relations.cbegin();
          |                      ^
  • src/geode/io/model/msh_input.cpp:859:57: warning: [readability-identifier-length]

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

      859 |             get_component_mesh_vertices( geode::index_t uv )
          |                                                         ^
  • src/geode/io/model/msh_input.cpp:908:1: warning: [modernize-concat-nested-namespaces]

    nested namespaces can be concatenated

      908 | namespace geode
          | ^~~~~~~~~~~~~~~
      909 | {
          | ~
      910 |     namespace internal
          |     ~~~~~~~~~~~~~~~~~~
          |     namespace geode::internal
  • src/geode/io/model/svg_input.cpp:281:24: warning: [readability-function-size]

    function 'apply_command' exceeds recommended size/complexity thresholds

      281 |         geode::index_t apply_command( const std::vector< std::string >& tokens,
          |                        ^
    /__w/OpenGeode-IO/OpenGeode-IO/src/geode/io/model/svg_input.cpp:281:24: note: 5 parameters (threshold 4)

Have any feedback or feature suggestions? Share it here.

@BotellaA
BotellaA merged commit f726392 into v18 Aug 14, 2026
26 of 34 checks passed
@BotellaA
BotellaA deleted the fix/change_ComponentID_to_struct branch August 14, 2026 15:09
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.

3 participants