Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions src/geode/inspector/inspection/topology/brep_corners_topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
{
}

bool BRepCornersTopology::brep_corner_topology_is_valid(

Check warning on line 102 in src/geode/inspector/inspection/topology/brep_corners_topology.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/topology/brep_corners_topology.cpp:102:31 [readability-function-cognitive-complexity]

function 'brep_corner_topology_is_valid' has cognitive complexity of 14 (threshold 10)
index_t unique_vertex_index ) const
{
bool corner_found{ false };
Expand Down Expand Up @@ -177,7 +177,7 @@
}

std::optional< std::string >
BRepCornersTopology::corner_is_multiply_embedded(

Check warning on line 180 in src/geode/inspector/inspection/topology/brep_corners_topology.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/topology/brep_corners_topology.cpp:180:30 [readability-function-cognitive-complexity]

function 'corner_is_multiply_embedded' has cognitive complexity of 12 (threshold 10)
index_t unique_vertex_index ) const
{
for( const auto& cmv :
Expand Down Expand Up @@ -233,7 +233,7 @@
}

std::optional< std::string >
BRepCornersTopology::corner_is_part_of_line_but_not_boundary(

Check warning on line 236 in src/geode/inspector/inspection/topology/brep_corners_topology.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/topology/brep_corners_topology.cpp:236:30 [readability-function-cognitive-complexity]

function 'corner_is_part_of_line_but_not_boundary' has cognitive complexity of 27 (threshold 10)
index_t unique_vertex_index ) const
{
for( const auto& cmv :
Expand All @@ -244,63 +244,63 @@
{
continue;
}
const auto& corner_uuid = cmv.component_id.id();
const auto& corner = brep_.corner( cmv.component_id.id() );
absl::linked_hash_map< uuid, index_t > line_to_nb_cmvs;
for( const auto& cmv_line :
brep_.component_mesh_vertices( unique_vertex_index ) )
{
const auto& line_id = cmv_line.component_id.id();
if( cmv_line.component_id.type()
!= Line3D::component_type_static()
|| !brep_.line( cmv_line.component_id.id() ).is_active() )
|| !brep_.line( line_id ).is_active() )
{
continue;
}
if( brep_.Relationships::is_boundary(
corner_uuid, cmv_line.component_id.id() ) )
line_to_nb_cmvs.try_emplace( line_id, 0 ).first->second++;
}
for( const auto& [line_id, nb_cmvs] : line_to_nb_cmvs )
{
const auto& line = brep_.line( line_id );
if( brep_.is_boundary( corner, line ) )
{
if( nb_cmvs != 1 && nb_cmvs != 2 )
{
return absl::StrCat( "unique vertex with index ",
unique_vertex_index, " is associated with Corner ",
corner.name().value_or( corner.id().string() ),
" (", corner.id().string(),
"), which is boundary to Line ",
line.name().value_or( line_id.string() ), " (",
line_id.string(),
"), so Line should have 1 or 2 cmv on this unique "
"vertex, but has ",
nb_cmvs, " vertices on it instead." );
}
continue;
}
if( brep_.Relationships::is_internal(
corner_uuid, cmv_line.component_id.id() ) )
if( brep_.is_internal( corner, line ) )
{
index_t line_vertex_count{ 0 };
for( const auto& cmv2 :
brep_.component_mesh_vertices( unique_vertex_index ) )
{
if( cmv2.component_id.id() == corner_uuid )
{
line_vertex_count++;
}
}
if( line_vertex_count != 2 )
if( nb_cmvs != 2 )
{
return absl::StrCat( "unique vertex with index ",
unique_vertex_index, " is associated with Corner ",
brep_.corner( corner_uuid )
.name()
.value_or( corner_uuid.string() ),
" (", corner_uuid.string(),
corner.name().value_or( corner.id().string() ),
" (", corner.id().string(),
"), which is internal to Line ",
brep_.line( cmv_line.component_id.id() )
.name()
.value_or(
cmv_line.component_id.id().string() ),
" (", cmv_line.component_id.id().string(),
line.name().value_or( line_id.string() ), " (",
line_id.string(),
"), so Line should be closed and have two "
"different vertices on unique vertex, but has ",
line_vertex_count, " vertices on it instead." );
nb_cmvs, " vertices on it instead." );
}
continue;
}
return absl::StrCat( "unique vertex ", unique_vertex_index,
" is associated with Corner ",
brep_.corner( corner_uuid )
.name()
.value_or( corner_uuid.string() ),
" (", corner_uuid.string() + "), part of line ",
brep_.line( cmv_line.component_id.id() )
.name()
.value_or( cmv_line.component_id.id().string() ),
" (", cmv_line.component_id.id().string(),
corner.name().value_or( corner.id().string() ), " (",
corner.id().string() + "), part of line ",
line.name().value_or( line.id().string() ), " (",
line_id.string(),
"), but is neither boundary nor internal of it." );
}
}
Expand All @@ -308,7 +308,7 @@
}

BRepCornersTopologyInspectionResult
BRepCornersTopology::inspect_corners_topology() const

Check warning on line 311 in src/geode/inspector/inspection/topology/brep_corners_topology.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/topology/brep_corners_topology.cpp:311:30 [readability-function-cognitive-complexity]

function 'inspect_corners_topology' has cognitive complexity of 14 (threshold 10)
{
BRepCornersTopologyInspectionResult result;
for( const auto& corner : brep_.active_corners() )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
}

std::optional< std::string >
BRepLinesTopology::vertex_is_part_of_invalid_embedded_line(

Check warning on line 164 in src/geode/inspector/inspection/topology/brep_lines_topology.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/topology/brep_lines_topology.cpp:164:28 [readability-function-cognitive-complexity]

function 'vertex_is_part_of_invalid_embedded_line' has cognitive complexity of 17 (threshold 10)
index_t unique_vertex_index ) const
{
for( const auto& line_cmv :
Expand Down Expand Up @@ -222,7 +222,7 @@
}

std::optional< std::string >
BRepLinesTopology::vertex_is_part_of_invalid_single_line(

Check warning on line 225 in src/geode/inspector/inspection/topology/brep_lines_topology.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/topology/brep_lines_topology.cpp:225:28 [readability-function-cognitive-complexity]

function 'vertex_is_part_of_invalid_single_line' has cognitive complexity of 23 (threshold 10)
index_t unique_vertex_index ) const
{
const auto line_uuids = internal::components_uuids(
Expand All @@ -249,7 +249,7 @@
if( surface_uuids.size() == 1 )
{
if( !brep_.Relationships::is_internal( line_id, surface_uuids[0] )
&& !( brep_.Relationships::nb_embeddings( surface_uuids[0] ) > 0

Check warning on line 252 in src/geode/inspector/inspection/topology/brep_lines_topology.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/topology/brep_lines_topology.cpp:252:20 [readability-simplify-boolean-expr]

boolean expression can be simplified by DeMorgan's theorem
|| brep_.Relationships::is_boundary(
line_id, surface_uuids[0] ) ) )
{
Expand Down Expand Up @@ -313,7 +313,7 @@
}

std::optional< std::string > BRepLinesTopology::
vertex_is_part_of_line_with_wrong_relationships_to_surface(

Check warning on line 316 in src/geode/inspector/inspection/topology/brep_lines_topology.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/topology/brep_lines_topology.cpp:316:9 [readability-function-cognitive-complexity]

function 'vertex_is_part_of_line_with_wrong_relationships_to_surface' has cognitive complexity of 38 (threshold 10)
index_t unique_vertex_index ) const
{
for( const auto& cmv :
Expand Down Expand Up @@ -445,7 +445,7 @@
}

std::optional< std::string >
BRepLinesTopology::line_edge_has_wrong_component_edges_around(

Check warning on line 448 in src/geode/inspector/inspection/topology/brep_lines_topology.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/topology/brep_lines_topology.cpp:448:28 [readability-function-cognitive-complexity]

function 'line_edge_has_wrong_component_edges_around' has cognitive complexity of 36 (threshold 10)
const Line3D& line, const index_t edge_index ) const
{
const auto cme = component_mesh_edges( brep_, line, edge_index );
Expand All @@ -466,7 +466,8 @@
surface.name().value_or( surface_id.string() ), " (",
surface_id.string(), "), but has ",
surface_edges.size(),
" edges of this Surface around it, it should be 1." );
" edges of this Surface around edge ", edge_index,
", it should be 1." );
}
continue;
}
Expand All @@ -479,7 +480,8 @@
surface.name().value_or( surface_id.string() ), " (",
surface_id.string(), "), but has ",
surface_edges.size(),
" edges of this surface around it, it should be 2." );
" edges of this surface around edge ", edge_index,
", it should be 2." );
}
continue;
}
Expand Down Expand Up @@ -562,7 +564,7 @@
}

BRepLinesTopologyInspectionResult
BRepLinesTopology::inspect_lines_topology() const

Check warning on line 567 in src/geode/inspector/inspection/topology/brep_lines_topology.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/topology/brep_lines_topology.cpp:567:28 [readability-function-cognitive-complexity]

function 'inspect_lines_topology' has cognitive complexity of 21 (threshold 10)
{
BRepLinesTopologyInspectionResult result;
for( const auto& line : brep_.active_lines() )
Expand Down
Loading