• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Alan-Jowett / bdd_test / 19213120744

09 Nov 2025 07:08PM UTC coverage: 88.802% (+0.6%) from 88.186%
19213120744

push

github

web-flow
refactor: eliminate code duplication and improve type safety (#17)

Major improvements to code quality:

**Code Duplication Elimination (expression_graph.cpp):**
- Added expression_constants namespace with named constants for all magic strings
- Created expression_traits template system to eliminate repetitive std::visit patterns
- Reduced code duplication by ~75% in DOT property methods
- Replaced fragile string-based variable detection with type-safe variant approach

**Type Safety Improvements (bdd_graph.cpp):**
- Added type-safe get_node() method returning const teddy::bdd_node*
- Maintained get_node_address() for template compatibility
- Eliminated unsafe reinterpret_cast in collect_bdd_nodes_topological()
- Extracted helper functions to reduce code complexity

**Template System Integration:**
- Improved integration with dag_walker for BDD and expression traversal
- Better leveraging of existing template infrastructure
- Cleaner separation of concerns between traversal and formatting

**Benefits:**
- More maintainable code with centralized constants
- Type-safe operations eliminate casting errors
- Easier to extend with new expression types
- All 24 tests continue to pass
- Clean build with no regressions

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>

645 of 759 branches covered (84.98%)

Branch coverage included in aggregate %.

54 of 56 new or added lines in 2 files covered. (96.43%)

2 existing lines in 1 file now uncovered.

600 of 643 relevant lines covered (93.31%)

222.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.21
/bdd_graph.cpp


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc