Skip to content

fix(InspectionIssues): count issues in InspectionIssuesMap, CLI usage - #204

Merged
BotellaA merged 4 commits into
nextfrom
fix/inspection-issues-cli-review
Oct 15, 2026
Merged

BotellaA merged 4 commits into
nextfrom
fix/inspection-issues-cli-review

Conversation

@BotellaA

Copy link
Copy Markdown
Member

Summary

Fixes from a review of OpenGeode-Inspector for the inspection issues containers and the CLI tools. There is one commit per fix.

  • InspectionIssuesMap::nb_issues(): it returned the number of components that have issues, not the number of issues, so one surface with 10k unlinked vertices counted as 1. It now sums the issues, and the previous value is available as nb_components_with_issues(), which is also exposed in the Python bindings. This changes the expected topology issue counts in the tests:
    • model_A1 / model_A1_valid: 5191 → 6182
    • mss: 50 → 65
  • Report strings: InspectionIssuesMap::string() now appends each component's report in place, into a reserved buffer, instead of building and copying a temporary string per component.
  • CLI: the usage messages advertised --noXXX flags that do not exist; they are removed.

New test: tests/inspection/test-information.cpp.

Question for review

  • The CLI tools return 0 even when the inspection finds issues. Returning a non-zero code would let them gate CI, but it changes behavior for existing scripts, so it is not done here.

🤖 Generated with Claude Code

BotellaA and others added 3 commits October 14, 2026 17:46
…not components

nb_issues() returned the number of components having issues, so a surface
with 10k unlinked vertices counted as 1 issue. It now sums the issues of every
component; the former value is available as nb_components_with_issues().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
InspectionIssuesMap::string() built a temporary string per component then
copied it; issues are now appended in place into a reserved buffer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inspector tools advertised --noXXX flags to disable criteria, but only
--input exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BotellaA
BotellaA requested a review from panquez October 14, 2026 17:33
@github-actions

Copy link
Copy Markdown

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v21.1.8) reports: 51 concern(s)
  • bindings/python/src/inspection/information.hpp:34:9: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       34 |         pybind11::module& module, const std::string& typestr )
          |         ^
  • bindings/python/src/inspection/information.hpp:38:9: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       38 |         pybind11::class_< InspectionIssues >( module, name.c_str() )
          |         ^
  • bindings/python/src/inspection/information.hpp:38:27: error: [clang-diagnostic-error]

    unexpected type name 'InspectionIssues': expected expression

       38 |         pybind11::class_< InspectionIssues >( module, name.c_str() )
          |                           ^
  • bindings/python/src/inspection/information.hpp:47:9: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       47 |         pybind11::class_< InspectionIssuesMap >( module, map_name.c_str() )
          |         ^
  • bindings/python/src/inspection/information.hpp:47:27: error: [clang-diagnostic-error]

    unexpected type name 'InspectionIssuesMap': expected expression

       47 |         pybind11::class_< InspectionIssuesMap >( module, map_name.c_str() )
          |                           ^
  • bindings/python/src/inspection/information.hpp:57:37: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       57 |     inline void define_information( pybind11::module& module )
          |                                     ^
  • bindings/python/src/inspection/information.hpp:62:32: error: [clang-diagnostic-error]

    use of undeclared identifier 'PolyhedronFacet'

       62 |         do_define_information< PolyhedronFacet >( module, "PolyhedronFacet" );
          |                                ^~~~~~~~~~~~~~~
  • bindings/python/src/inspection/information.hpp:65:32: error: [clang-diagnostic-error]

    use of undeclared identifier 'PolyhedronFacetVertices'

       65 |         do_define_information< PolyhedronFacetVertices >(
          |                                ^~~~~~~~~~~~~~~~~~~~~~~
  • bindings/python/src/inspection/information.hpp:67:32: error: [clang-diagnostic-error]

    use of undeclared identifier 'PolygonEdge'

       67 |         do_define_information< PolygonEdge >( module, "PolygonEdge" );
          |                                ^~~~~~~~~~~
  • bindings/python/src/inspection/information.hpp:71:50: error: [clang-diagnostic-error]

    no member named 'ComponentMeshElement' in namespace 'geode'

       71 |         do_define_information< std::pair< geode::ComponentMeshElement,
          |                                                  ^~~~~~~~~~~~~~~~~~~~
  • include/geode/inspector/inspection/information.hpp:86:64: warning: [cppcoreguidelines-avoid-magic-numbers]

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

       86 |             auto size = message.size() + description_.size() + 32;
          |                                                                ^
  • include/geode/inspector/inspection/information.hpp:141:21: warning: [readability-identifier-length]

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

      141 |             index_t nb{ 0 };
          |                     ^
  • src/bin/geode-inspector-brep.cpp:44:6: warning: [misc-use-internal-linkage]

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

       44 | void inspect_brep( const geode::BRep& brep )
          |      ^
          | static 
  • src/bin/geode-inspector-brep.cpp:57:36: warning: [cppcoreguidelines-pro-bounds-pointer-arithmetic]

    do not use pointer arithmetic

       57 |                 "Sample usage:\n", argv[0], " --input my_brep.og_brep\n" ) );
          |                                    ^
  • src/bin/geode-inspector-edgedcurve.cpp:47:6: warning: [misc-use-internal-linkage]

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

       47 | void inspect_edged_curve( const geode::EdgedCurve< dimension >& edged_curve )
          |      ^
          | static 
  • src/bin/geode-inspector-edgedcurve.cpp:61:13: warning: [cppcoreguidelines-pro-bounds-pointer-arithmetic]

    do not use pointer arithmetic

       61 |             argv[0], " --input my_edgedcurve.og_edc3d\n" ) );
          |             ^
  • src/bin/geode-inspector-section.cpp:43:6: warning: [misc-use-internal-linkage]

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

       43 | void inspect_section( const geode::Section& section )
          |      ^
          | static 
  • src/bin/geode-inspector-section.cpp:57:36: warning: [cppcoreguidelines-pro-bounds-pointer-arithmetic]

    do not use pointer arithmetic

       57 |                 "Sample usage:\n", argv[0], " --input my_section.og_sctn\n" ) );
          |                                    ^
  • src/bin/geode-inspector-solid.cpp:53:6: warning: [misc-use-internal-linkage]

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

       53 | void inspect_solid( const geode::SolidMesh< dimension >& solid )
          |      ^
          | static 
  • src/bin/geode-inspector-solid.cpp:66:36: warning: [cppcoreguidelines-pro-bounds-pointer-arithmetic]

    do not use pointer arithmetic

       66 |                 "Sample usage:\n", argv[0], " --input my_solid.og_tsf3d\n" ) );
          |                                    ^
  • src/bin/geode-inspector-surface.cpp:51:6: warning: [misc-use-internal-linkage]

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

       51 | void inspect_surface( const geode::SurfaceMesh< dimension >& surface )
          |      ^
          | static 
  • src/bin/geode-inspector-surface.cpp:64:13: warning: [cppcoreguidelines-pro-bounds-pointer-arithmetic]

    do not use pointer arithmetic

       64 |             argv[0], " --input my_surface.og_tsf3d\n" ) );
          |             ^
  • tests/inspection/test-brep.cpp:34:16: warning: [misc-use-internal-linkage]

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

       34 | geode::index_t corners_topological_validity(
          |                ^
          | static 
  • tests/inspection/test-brep.cpp:62:16: warning: [misc-use-internal-linkage]

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

       62 | geode::index_t lines_topological_validity(
          |                ^
          | static 
  • tests/inspection/test-brep.cpp:96:16: warning: [misc-use-internal-linkage]

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

       96 | geode::index_t surfaces_topological_validity(
          |                ^
          | static 
  • tests/inspection/test-brep.cpp:128:16: warning: [misc-use-internal-linkage]

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

      128 | geode::index_t blocks_topological_validity(
          |                ^
          | static 
  • tests/inspection/test-brep.cpp:163:16: warning: [misc-use-internal-linkage]

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

      163 | geode::index_t launch_topological_validity_checks(
          |                ^
          | static 
  • tests/inspection/test-brep.cpp:173:16: warning: [misc-use-internal-linkage]

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

      173 | geode::index_t meshes_adjacencies_validity(
          |                ^
          | static 
  • tests/inspection/test-brep.cpp:196:16: warning: [misc-use-internal-linkage]

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

      196 | geode::index_t meshes_degenerations_validity(
          |                ^
          | static 
  • tests/inspection/test-brep.cpp:224:16: warning: [misc-use-internal-linkage]

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

      224 | geode::index_t meshes_intersections_validity(
          |                ^
          | static 
  • tests/inspection/test-brep.cpp:225:56: warning: [performance-unnecessary-value-param]

    the const qualified parameter 'result' is copied for each invocation; consider making it a reference

      225 |     const geode::ElementsIntersectionsInspectionResult result, bool string )
          |                                                        ^
          |                                                       &
  • tests/inspection/test-brep.cpp:239:16: warning: [misc-use-internal-linkage]

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

      239 | geode::index_t meshes_manifolds_validity(
          |                ^
          | static 
  • tests/inspection/test-brep.cpp:268:16: warning: [misc-use-internal-linkage]

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

      268 | geode::index_t meshes_colocations_validity(
          |                ^
          | static 
  • tests/inspection/test-brep.cpp:285:16: warning: [misc-use-internal-linkage]

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

      285 | geode::index_t meshes_unique_vertices_validity(
          |                ^
          | static 
  • tests/inspection/test-brep.cpp:304:16: warning: [misc-use-internal-linkage]

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

      304 | geode::index_t launch_component_meshes_validity_checks(
          |                ^
          | static 
  • tests/inspection/test-brep.cpp:307:10: warning: [clang-analyzer-deadcode.DeadStores]

    Value stored to 'nb_issues' during its initialization is never read

      307 |     auto nb_issues =
          |          ^~~~~~~~~
      308 |         meshes_adjacencies_validity( result.meshes_adjacencies, string );
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/tests/inspection/test-brep.cpp:307:10: note: Value stored to 'nb_issues' during its initialization is never read
      307 |     auto nb_issues =
          |          ^~~~~~~~~
      308 |         meshes_adjacencies_validity( result.meshes_adjacencies, string );
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • tests/inspection/test-brep.cpp:322:6: warning: [misc-use-internal-linkage]

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

      322 | void check_model_a1( bool string )
          |      ^
          | static 
  • tests/inspection/test-brep.cpp:335:34: warning: [cppcoreguidelines-avoid-magic-numbers]

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

      335 |         nb_topological_issues == 6182, "model_A1 has ", nb_topological_issues,
          |                                  ^
  • tests/inspection/test-brep.cpp:341:39: warning: [cppcoreguidelines-avoid-magic-numbers]

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

      341 |         nb_component_meshes_issues == 13494, "model_A1 has ",
          |                                       ^
  • tests/inspection/test-brep.cpp:345:6: warning: [misc-use-internal-linkage]

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

      345 | void check_model_a1_valid( bool string )
          |      ^
          | static 
  • tests/inspection/test-brep.cpp:358:34: warning: [cppcoreguidelines-avoid-magic-numbers]

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

      358 |         nb_topological_issues == 6182, "model_A1_valid has ",
          |                                  ^
  • tests/inspection/test-brep.cpp:364:39: warning: [cppcoreguidelines-avoid-magic-numbers]

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

      364 |         nb_component_meshes_issues == 13494, "model_A1_valid has ",
          |                                       ^
  • tests/inspection/test-brep.cpp:368:6: warning: [misc-use-internal-linkage]

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

      368 | void check_model_mss( bool string )
          |      ^
          | static 
  • tests/inspection/test-brep.cpp:381:34: warning: [cppcoreguidelines-avoid-magic-numbers]

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

      381 |         nb_topological_issues == 65, "mss has ", nb_topological_issues,
          |                                  ^
  • tests/inspection/test-brep.cpp:391:6: warning: [misc-use-internal-linkage]

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

      391 | void check_model_D( bool string )
          |      ^
          | static 
  • tests/inspection/test-brep.cpp:391:6: warning: [readability-identifier-naming]

    invalid case style for global function 'check_model_D'

      391 | void check_model_D( bool string )
          |      ^~~~~~~~~~~~~
          |      check_model_d
  • tests/inspection/test-brep.cpp:412:6: warning: [misc-use-internal-linkage]

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

      412 | void check_wrong_bsurfaces_model()
          |      ^
          | static 
  • tests/inspection/test-brep.cpp:440:6: warning: [misc-use-internal-linkage]

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

      440 | void check_segmented_cube()
          |      ^
          | static 
  • tests/inspection/test-brep.cpp:450:16: warning: [clang-analyzer-deadcode.DeadStores]

    Value stored to 'nb_component_meshes_issues' during its initialization is never read

      450 |     const auto nb_component_meshes_issues =
          |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
      451 |         launch_component_meshes_validity_checks( result.meshes, false );
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/tests/inspection/test-brep.cpp:450:16: note: Value stored to 'nb_component_meshes_issues' during its initialization is never read
      450 |     const auto nb_component_meshes_issues =
          |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
      451 |         launch_component_meshes_validity_checks( result.meshes, false );
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • tests/inspection/test-information.cpp:45:6: warning: [misc-use-internal-linkage]

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

       45 | void check_issues()
          |      ^
          | static 
  • tests/inspection/test-information.cpp:63:6: warning: [misc-use-internal-linkage]

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

       63 | void check_issues_map()
          |      ^
          | static 

Have any feedback or feature suggestions? Share it here.

@panquez panquez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes the CLI should still return 0, since it is not a failure of the CLI if issues have been found.

@BotellaA
BotellaA merged commit de1f77a into next Oct 15, 2026
23 checks passed
@BotellaA
BotellaA deleted the fix/inspection-issues-cli-review branch October 15, 2026 18:49
@BotellaA

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 6.12.4-rc.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants