Skip to content

feat(Attributes): add no-value property support - #1310

Open
BenPinet wants to merge 2 commits into
v18from
feat/add_no_value_property_to_attribute
Open

feat(Attributes): add no-value property support#1310
BenPinet wants to merge 2 commits into
v18from
feat/add_no_value_property_to_attribute

Conversation

@BenPinet

Copy link
Copy Markdown
Member

BREAKING CHANGE: create_attribute now requires an additional parameter to specify the no-value property.

BREAKING CHANGE: create_attribute now requires an additional parameter to specify the no-value property.
@BenPinet
BenPinet requested a review from BotellaA July 29, 2026 13:33
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v20.1.8) reports: 1340 concern(s)
  • bindings/python/src/basic/attribute.cpp:34:10: warning: [misc-use-internal-linkage]

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

       34 |     void python_attribute_class(
          |          ^
          |     static 
  • bindings/python/src/basic/attribute.cpp:67:10: warning: [misc-use-internal-linkage]

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

       67 |     void python_attribute_values_class(
          |          ^
          |     static 
  • bindings/python/src/basic/attribute.cpp:79:10: warning: [misc-use-internal-linkage]

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

       79 |     void define_attributes( pybind11::module& module )
          |          ^
          |     static 
  • bindings/python/src/basic/attribute_manager.cpp:36:10: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'python_attribute_class' is non-const and globally accessible, consider making it const

       36 |     void python_attribute_class( pybind11::class_< AttributeManager >& manager,
          |          ^
  • bindings/python/src/basic/attribute_manager.cpp:36:10: warning: [misc-use-internal-linkage]

    variable 'python_attribute_class' can be made static or moved into an anonymous namespace to enforce internal linkage

       36 |     void python_attribute_class( pybind11::class_< AttributeManager >& manager,
          |          ^
          |     static 
  • bindings/python/src/basic/attribute_manager.cpp:101:10: warning: [misc-use-internal-linkage]

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

      101 |     void define_attribute_manager( pybind11::module& module )
          |          ^
          |     static 
  • include/geode/basic/attribute.hpp:52:11: warning: [cppcoreguidelines-special-member-functions]

    class 'AttributeBase' defines a default destructor, a copy constructor and a copy assignment operator but does not define a move constructor or a move assignment operator

       52 |     class AttributeBase : public Identifier
          |           ^
  • include/geode/basic/attribute.hpp:82:27: warning: [hicpp-move-const-arg]

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

       82 |             properties_ = std::move( new_properties );
          |                           ^~~~~~~~~~                ~
  • include/geode/basic/attribute.hpp:156:28: warning: [hicpp-move-const-arg]

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

      156 |             : properties_( std::move( properties ) )
          |                            ^~~~~~~~~~            ~
  • include/geode/basic/attribute_utils.hpp:148:9: warning: [cppcoreguidelines-macro-usage]

    function-like macro 'IMPLICIT_ATTRIBUTE_LINEAR_INTERPOLATION' used; consider a 'constexpr' template function

      148 | #define IMPLICIT_ATTRIBUTE_LINEAR_INTERPOLATION( Type )                        \
          |         ^
  • include/geode/basic/attribute_utils.hpp:182:9: warning: [cppcoreguidelines-macro-usage]

    function-like macro 'IMPLICIT_ARRAY_ATTRIBUTE_LINEAR_INTERPOLATION' used; consider a 'constexpr' template function

      182 | #define IMPLICIT_ARRAY_ATTRIBUTE_LINEAR_INTERPOLATION( Type )                  \
          |         ^
  • include/geode/basic/attribute_utils.hpp:261:9: warning: [cppcoreguidelines-macro-usage]

    function-like macro 'IMPLICIT_GENERIC_ATTRIBUTE_CONVERSION' used; consider a 'constexpr' template function

      261 | #define IMPLICIT_GENERIC_ATTRIBUTE_CONVERSION( Type )                          \
          |         ^
  • include/geode/basic/attribute_utils.hpp:297:9: warning: [cppcoreguidelines-macro-usage]

    function-like macro 'IMPLICIT_ARRAY_GENERIC_ATTRIBUTE_CONVERSION' used; consider a 'constexpr' template function

      297 | #define IMPLICIT_ARRAY_GENERIC_ATTRIBUTE_CONVERSION( Type )                    \
          |         ^
  • include/geode/basic/cached_value.hpp:38:11: warning: [cppcoreguidelines-special-member-functions]

    class 'CachedValue' defines a copy constructor, a copy assignment operator, a move constructor and a move assignment operator but does not define a destructor

       38 |     class CachedValue
          |           ^
  • include/geode/basic/cached_value.hpp:43:22: warning: [modernize-type-traits]

    use c++14 style type templates

       43 |             typename std::add_pointer< ReturnType( Args... ) >::type;
          |             ~~~~~~~~ ^                                        ~~~~~~
          |                                      _t
  • include/geode/basic/cached_value.hpp:48:13: warning: [cppcoreguidelines-prefer-member-initializer]

    'value_' should be initialized in a member initializer of the constructor

       46 |         CachedValue( const CachedValue& other )
          |                                                
          |                                                 : value_(other.value_)
       47 |         {
       48 |             value_ = other.value_;
          |             ^~~~~~~~~~~~~~~~~~~~~~
  • include/geode/basic/cached_value.hpp:49:13: warning: [cppcoreguidelines-prefer-member-initializer]

    'computed_' should be initialized in a member initializer of the constructor

       46 |         CachedValue( const CachedValue& other )
          |                                                
          |                                                , computed_(other.computed_.load())
       47 |         {
       48 |             value_ = other.value_;
       49 |             computed_ = other.computed_.load();
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • include/geode/basic/cached_value.hpp:53:13: warning: [cppcoreguidelines-prefer-member-initializer]

    'value_' should be initialized in a member initializer of the constructor

       51 |         CachedValue( CachedValue&& other ) noexcept
          |                                                    
          |                                                     : value_(std::move( other.value_ ))
       52 |         {
       53 |             value_ = std::move( other.value_ );
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • include/geode/basic/cached_value.hpp:54:13: warning: [cppcoreguidelines-prefer-member-initializer]

    'computed_' should be initialized in a member initializer of the constructor

       51 |         CachedValue( CachedValue&& other ) noexcept
          |                                                    
          |                                                    , computed_(other.computed_.load())
       52 |         {
       53 |             value_ = std::move( other.value_ );
       54 |             computed_ = other.computed_.load();
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • include/geode/basic/cached_value.hpp:57:22: warning: [cert-oop54-cpp]

    operator=() does not handle self-assignment properly

       57 |         CachedValue& operator=( const CachedValue& other )
          |                      ^
  • include/geode/basic/cached_value.hpp:128:38: warning: [cppcoreguidelines-init-variables]

    variable 'computed' is not initialized

      128 |                                 bool computed;
          |                                      ^       
          |                                               = false
  • include/geode/basic/constant_attribute.hpp:121:9: warning: [google-explicit-constructor]

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

      121 |         ConstantAttribute( std::string_view name )
          |         ^
          |         explicit 
  • include/geode/basic/sparse_attribute.hpp:89:24: warning: [readability-simplify-boolean-expr]

    redundant boolean literal in conditional return statement

       87 |             if( value( element ) == default_values_.no_value )
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |             return static_cast<bool>(value( element ) != default_values_.no_value)
       88 |             {
          |             ~
       89 |                 return false;
          |                 ~~~~~~~^~~~~~
       90 |             }
          |             ~
       91 |             return true;
          |             ~~~~~~~~~~~
  • include/geode/basic/sparse_attribute.hpp:134:30: warning: [cppcoreguidelines-avoid-magic-numbers]

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

      134 |             values_.reserve( 10 );
          |                              ^
  • include/geode/basic/sparse_attribute.hpp:137:9: warning: [google-explicit-constructor]

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

      137 |         SparseAttribute( std::string_view name )
          |         ^
          |         explicit 
  • include/geode/basic/sparse_attribute.hpp:164:62: warning: [readability-identifier-length]

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

      164 |                              []( Archive& archive2, index_t& i, T& item ) {
          |                                                              ^
  • include/geode/basic/sparse_attribute.hpp:178:65: warning: [readability-identifier-length]

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

      178 |                                 []( Archive& archive2, index_t& i, T& item ) {
          |                                                                 ^
  • include/geode/basic/sparse_attribute.hpp:183:30: warning: [cppcoreguidelines-avoid-magic-numbers]

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

      183 |             values_.reserve( 10 );
          |                              ^
  • include/geode/basic/sparse_attribute.hpp:295:31: warning: [readability-identifier-length]

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

      295 |             for( const auto& [in, outs] : old2new_mapping.in2out_map() )
          |                               ^
  • include/geode/basic/sparse_attribute.hpp:347:31: warning: [readability-identifier-length]

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

      347 |             for( const auto& [in, outs] : old2new_mapping.in2out_map() )
          |                               ^
  • include/geode/basic/variable_attribute.hpp:78:24: warning: [readability-simplify-boolean-expr]

    redundant boolean literal in conditional return statement

       76 |             if( values_[element] == default_values_.no_value )
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |             return static_cast<bool>(values_[element] != default_values_.no_value)
       77 |             {
          |             ~
       78 |                 return false;
          |                 ~~~~~~~^~~~~~
       79 |             }
          |             ~
       80 |             return true;
          |             ~~~~~~~~~~~
  • include/geode/basic/variable_attribute.hpp:126:30: warning: [cppcoreguidelines-avoid-magic-numbers]

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

      126 |             values_.reserve( 10 );
          |                              ^
  • include/geode/basic/variable_attribute.hpp:129:9: warning: [google-explicit-constructor]

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

      129 |         VariableAttribute( std::string_view name )
          |         ^
          |         explicit 
  • include/geode/basic/variable_attribute.hpp:167:30: warning: [cppcoreguidelines-avoid-magic-numbers]

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

      167 |             values_.reserve( 10 );
          |                              ^
  • include/geode/basic/variable_attribute.hpp:322:31: warning: [readability-identifier-length]

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

      322 |             for( const auto& [in, outs] : old2new_mapping.in2out_map() )
          |                               ^
  • include/geode/basic/variable_attribute.hpp:351:55: warning: [hicpp-move-const-arg]

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

      351 |             : VariableAttribute( default_value, name, std::move( properties ) )
          |                                                       ^~~~~~~~~~            ~
  • include/geode/basic/variable_attribute.hpp:357:20: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

      357 |             return reinterpret_cast< const bool& >( values_[element] );
          |                    ^
  • include/geode/basic/variable_attribute.hpp:364:24: warning: [readability-simplify-boolean-expr]

    redundant boolean literal in conditional return statement

      362 |             if( value( element ) == default_values_.no_value )
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |             return value( element ) != default_values_.no_value
      363 |             {
          |             ~
      364 |                 return false;
          |                 ~~~~~~~^~~~~~
      365 |             }
          |             ~
      366 |             return true;
          |             ~~~~~~~~~~~
  • include/geode/basic/variable_attribute.hpp:371:32: warning: [hicpp-move-const-arg]

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

      371 |             values_[element] = std::move( value );
          |                                ^~~~~~~~~~       ~
  • include/geode/basic/variable_attribute.hpp:371:32: warning: [readability-implicit-bool-conversion]

    implicit conversion 'bool' -> 'value_type' (aka 'unsigned char')

      371 |             values_[element] = std::move( value );
          |                                ^                 
          |                                static_cast<value_type>( )
  • include/geode/basic/variable_attribute.hpp:382:23: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

      382 |             modifier( reinterpret_cast< bool& >( values_[element] ) );
          |                       ^
  • include/geode/basic/variable_attribute.hpp:409:48: warning: [hicpp-move-const-arg]

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

      409 |             : ReadOnlyAttribute< bool >( name, std::move( properties ) ),
          |                                                ^~~~~~~~~~            ~
  • include/geode/basic/variable_attribute.hpp:412:30: warning: [cppcoreguidelines-avoid-magic-numbers]

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

      412 |             values_.reserve( 10 );
          |                              ^
  • include/geode/basic/variable_attribute.hpp:415:9: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: default_values_

      415 |         VariableAttribute( std::string_view name )
          |         ^
  • include/geode/basic/variable_attribute.hpp:415:9: warning: [google-explicit-constructor]

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

      415 |         VariableAttribute( std::string_view name )
          |         ^
          |         explicit 
  • include/geode/basic/variable_attribute.hpp:418:9: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: default_values_

      418 |         VariableAttribute()
          |         ^
  • include/geode/basic/variable_attribute.hpp:430:31: warning: [cppcoreguidelines-init-variables]

    variable 'old_value' is not initialized

      430 |                          bool old_value;
          |                               ^        
          |                                         = false
  • include/geode/basic/variable_attribute.hpp:449:30: warning: [cppcoreguidelines-avoid-magic-numbers]

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

      449 |             values_.reserve( 10 );
          |                              ^
  • include/geode/basic/variable_attribute.hpp:488:38: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

      488 |                     default_values_, this->name().value(), this->properties() }
          |                                      ^
  • include/geode/basic/variable_attribute.hpp:506:34: warning: [readability-implicit-bool-conversion]

    implicit conversion 'bool' -> 'value_type' (aka 'unsigned char')

      506 |                     values_[i] = typed_attribute.value( i );
          |                                  ^                         
          |                                  static_cast<value_type>(  )
  • include/geode/basic/variable_attribute.hpp:518:38: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

      518 |                     default_values_, this->name().value(), this->properties() }
          |                                      ^
  • include/geode/basic/variable_attribute.hpp:549:38: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

      549 |                     default_values_, this->name().value(), this->properties() }
          |                                      ^
  • include/geode/basic/variable_attribute.hpp:553:31: warning: [readability-identifier-length]

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

      553 |             for( const auto& [in, outs] : old2new_mapping.in2out_map() )
          |                               ^
  • include/geode/basic/variable_attribute.hpp:604:31: warning: [readability-identifier-length]

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

      604 |             for( const auto& [in, outs] : old2new_mapping.in2out_map() )
          |                               ^
  • include/geode/basic/variable_attribute.hpp:615:45: warning: [readability-redundant-member-init]

    initializer for member 'values_' is redundant

      615 |         std::vector< unsigned char > values_{};
          |                                             ^~
  • include/geode/mesh/core/detail/facet_storage.hpp:39:1: warning: [modernize-concat-nested-namespaces]

    nested namespaces can be concatenated

       39 | namespace geode
          | ^~~~~~~~~~~~~~~
       40 | {
          | ~
       41 |     namespace detail
          |     ~~~~~~~~~~~~~~~~
          |     namespace geode::detail
  • include/geode/mesh/core/detail/facet_storage.hpp:60:13: warning: [google-explicit-constructor]

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

       60 |             FacetStorage( BITSERY ) {}
          |             ^
          |             explicit 
  • include/geode/mesh/core/detail/facet_storage.hpp:60:27: error: [clang-diagnostic-error]

    unknown type name 'BITSERY'

       60 |             FacetStorage( BITSERY ) {}
          |                           ^
  • include/geode/mesh/core/detail/facet_storage.hpp:60:35: warning: [hicpp-named-parameter]

    all parameters should be named in a function

       60 |             FacetStorage( BITSERY ) {}
          |                                   ^
          |                                    /*unused*/
  • include/geode/mesh/core/detail/facet_storage.hpp:68:17: warning: [cppcoreguidelines-pro-type-member-init]

    uninitialized record type: 'counter_values'

       68 |                 AttributeValues< index_t > counter_values;
          |                 ^                                        
          |                                                          {}
  • include/geode/mesh/core/detail/facet_storage.hpp:69:48: warning: [hicpp-uppercase-literal-suffix]

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

       69 |                 counter_values.default_value = 1u;
          |                                                ^~
          |                                                 U
  • include/geode/mesh/core/detail/facet_storage.hpp:110:28: warning: [readability-identifier-length]

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

      110 |                 const auto id = facet_indices_.size();
          |                            ^
  • include/geode/mesh/core/detail/facet_storage.hpp:113:28: warning: [readability-identifier-length]

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

      113 |                 const auto it = std::get< 0 >( output );
          |                            ^
  • include/geode/mesh/core/detail/facet_storage.hpp:128:28: warning: [readability-identifier-length]

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

      128 |                 const auto it = facet_indices_.find( vertices );
          |                            ^
  • include/geode/mesh/core/detail/facet_storage.hpp:133:28: warning: [readability-identifier-length]

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

      133 |                 const auto id = it->second;
          |                            ^
  • include/geode/mesh/core/detail/facet_storage.hpp:138:50: warning: [hicpp-uppercase-literal-suffix]

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

      138 |                 const auto new_count = std::max( 1u, old_count ) - 1;
          |                                                  ^~
          |                                                   U
  • include/geode/mesh/core/detail/facet_storage.hpp:216:36: warning: [readability-identifier-length]

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

      216 |                         const auto it =
          |                                    ^
  • include/geode/mesh/core/detail/facet_storage.hpp:261:17: warning: [cppcoreguidelines-pro-type-member-init]

    uninitialized record type: 'counter_values'

      261 |                 AttributeValues< index_t > counter_values;
          |                 ^                                        
          |                                                          {}
  • include/geode/mesh/core/detail/facet_storage.hpp:262:48: warning: [hicpp-uppercase-literal-suffix]

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

      262 |                 counter_values.default_value = 1u;
          |                                                ^~
          |                                                 U
  • include/geode/mesh/core/detail/facet_storage.hpp:320:48: error: [clang-diagnostic-error]

    no member named 'StdSmartPtr' in namespace 'bitsery::ext'

      320 |                                  bitsery::ext::StdSmartPtr{} );
          |                                  ~~~~~~~~~~~~~~^
  • include/geode/mesh/core/detail/facet_storage.hpp:322:48: error: [clang-diagnostic-error]

    no member named 'StdSmartPtr' in namespace 'bitsery::ext'

      322 |                                  bitsery::ext::StdSmartPtr{} );
          |                                  ~~~~~~~~~~~~~~^
  • include/geode/mesh/core/detail/facet_storage.hpp:350:51: error: [clang-diagnostic-error]

    no member named 'StdSmartPtr' in namespace 'bitsery::ext'

      350 |                                     bitsery::ext::StdSmartPtr{} );
          |                                     ~~~~~~~~~~~~~~^
  • include/geode/mesh/core/detail/facet_storage.hpp:352:51: error: [clang-diagnostic-error]

    no member named 'StdSmartPtr' in namespace 'bitsery::ext'

      352 |                                     bitsery::ext::StdSmartPtr{} );
          |                                     ~~~~~~~~~~~~~~^
  • include/geode/mesh/core/internal/edges_impl.hpp:33:1: warning: [modernize-concat-nested-namespaces]

    nested namespaces can be concatenated

       33 | namespace geode
          | ^~~~~~~~~~~~~~~
       34 | {
          | ~
       35 |     namespace internal
          |     ~~~~~~~~~~~~~~~~~~
          |     namespace geode::internal
  • include/geode/mesh/core/internal/edges_impl.hpp:37:15: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: edges_

       37 |         class EdgesImpl
          |               ^
  • include/geode/mesh/core/internal/edges_impl.hpp:42:13: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: edges_

       42 |             explicit EdgesImpl( Graph& graph ) : edges_()
          |             ^
  • include/geode/mesh/core/internal/edges_impl.hpp:48:17: warning: [cppcoreguidelines-pro-type-member-init]

    uninitialized record type: 'edges_values'

       48 |                 AttributeValues< std::array< index_t, 2 > > edges_values;
          |                 ^                                                       
          |                                                                         {}
  • include/geode/mesh/core/internal/edges_impl.hpp:53:53: error: [clang-diagnostic-error]

    use of undeclared identifier 'VariableAttribute'

       53 |                         .template create_attribute< VariableAttribute,
          |                                                     ^
  • include/geode/mesh/core/internal/edges_impl.hpp:55:29: warning: [clang-diagnostic-unused-value]

    left operand of comma operator has no effect

       55 |                             "edges", edges_values, attribute_properties );
          |                             ^~~~~~~
  • include/geode/mesh/core/internal/edges_impl.hpp:55:38: warning: [clang-diagnostic-unused-value]

    left operand of comma operator has no effect

       55 |                             "edges", edges_values, attribute_properties );
          |                                      ^~~~~~~~~~~~
  • include/geode/mesh/core/internal/edges_impl.hpp:58:51: error: [clang-diagnostic-error]

    use of undeclared identifier 'VariableAttribute'

       58 |                         .template find_attribute< VariableAttribute,
          |                                                   ^
  • include/geode/mesh/core/internal/edges_impl.hpp:96:61: error: [clang-diagnostic-error]

    no member named 'StdSmartPtr' in namespace 'bitsery::ext'

       96 |                                  impl.edges_, bitsery::ext::StdSmartPtr{} );
          |                                               ~~~~~~~~~~~~~~^
  • include/geode/mesh/core/internal/edges_impl.hpp:106:64: error: [clang-diagnostic-error]

    no member named 'StdSmartPtr' in namespace 'bitsery::ext'

      106 |                                     impl.edges_, bitsery::ext::StdSmartPtr{} );
          |                                                  ~~~~~~~~~~~~~~^
  • include/geode/mesh/core/internal/edges_impl.hpp:111:30: error: [clang-diagnostic-error]

    use of undeclared identifier 'VariableAttribute'

      111 |             std::shared_ptr< VariableAttribute< std::array< index_t, 2 > > >
          |                              ^
  • include/geode/mesh/core/internal/edges_impl.hpp:112:17: warning: [clang-diagnostic-unused-private-field]

    private field 'edges_' is not used

      112 |                 edges_;
          |                 ^
  • include/geode/mesh/core/internal/points_impl.hpp:39:1: warning: [modernize-concat-nested-namespaces]

    nested namespaces can be concatenated

       39 | namespace geode
          | ^~~~~~~~~~~~~~~
       40 | {
          | ~
       41 |     namespace internal
          |     ~~~~~~~~~~~~~~~~~~
          |     namespace geode::internal
  • include/geode/mesh/core/internal/points_impl.hpp:77:17: warning: [cppcoreguidelines-prefer-member-initializer]

    'points_' should be initialized in a member initializer of the constructor

       75 |             PointsImpl( AttributeManager& manager, const uuid& attribute_id )
          |                                                                              
       76 |             {
       77 |                 points_ = manager.template find_attribute< VariableAttribute,
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       78 |                     Point< dimension > >( attribute_id );
          |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • include/geode/mesh/core/internal/solid_mesh_impl.hpp:30:1: warning: [modernize-concat-nested-namespaces]

    nested namespaces can be concatenated

       30 | namespace geode
          | ^~~~~~~~~~~~~~~
       31 | {
          | ~
       32 |     namespace internal
          |     ~~~~~~~~~~~~~~~~~~
          |     namespace geode::internal
  • include/geode/mesh/core/internal/surface_mesh_impl.hpp:30:1: warning: [modernize-concat-nested-namespaces]

    nested namespaces can be concatenated

       30 | namespace geode
          | ^~~~~~~~~~~~~~~
       31 | {
          | ~
       32 |     namespace internal
          |     ~~~~~~~~~~~~~~~~~~
          |     namespace geode::internal
  • include/geode/mesh/core/internal/texture_impl.hpp:36:1: warning: [modernize-concat-nested-namespaces]

    nested namespaces can be concatenated

       36 | namespace geode
          | ^~~~~~~~~~~~~~~
       37 | {
          | ~
       38 |     namespace internal
          |     ~~~~~~~~~~~~~~~~~~
          |     namespace geode::internal
  • include/geode/mesh/core/internal/texture_impl.hpp:47:38: warning: [readability-identifier-naming]

    invalid case style for private member 'DEFAULT_COORD'

       47 |             const Point< dimension > DEFAULT_COORD;
          |                                      ^~~~~~~~~~~~~
          |                                      DEFAULT_COORD_
  • include/geode/mesh/core/internal/texture_impl.hpp:67:17: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'texture_coordinates_impl' of convertible types are easily swapped by mistake

       67 |                 index_t element, local_index_t vertex ) const
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/include/geode/mesh/core/internal/texture_impl.hpp:67:25: note: the first parameter in the range is 'element'
       67 |                 index_t element, local_index_t vertex ) const
          |                         ^~~~~~~
    /__w/OpenGeode/OpenGeode/include/geode/mesh/core/internal/texture_impl.hpp:67:48: note: the last parameter in the range is 'vertex'
       67 |                 index_t element, local_index_t vertex ) const
          |                                                ^~~~~~
    /__w/OpenGeode/OpenGeode/include/geode/mesh/core/internal/texture_impl.hpp:67:17: note: 
       67 |                 index_t element, local_index_t vertex ) const
          |                 ^
    /__w/OpenGeode/OpenGeode/include/geode/mesh/core/internal/texture_impl.hpp:67:34: note: 'index_t' and 'local_index_t' may be implicitly converted: 'index_t' (as 'unsigned int') -> 'local_index_t' (as 'unsigned char'), 'local_index_t' (as 'unsigned char') -> 'index_t' (as 'unsigned int')
       67 |                 index_t element, local_index_t vertex ) const
          |                                  ^
  • src/geode/mesh/builder/vertex_set_builder.cpp:59:24: warning: [performance-unnecessary-copy-initialization]

    the const qualified variable 'name' is copy-constructed from a const reference; consider making it a const reference

       59 |         if( const auto name = vertex_set.name() )
          |                        ^
          |                       &
  • src/geode/mesh/builder/vertex_set_builder.cpp:76:56: warning: [readability-identifier-length]

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

       76 |     index_t VertexSetBuilder::create_vertices( index_t nb )
          |                                                        ^
  • src/geode/mesh/core/geode/geode_tetrahedral_solid.cpp:58:13: warning: [cppcoreguidelines-pro-type-member-init]

    uninitialized record type: 'attribute_values'

       58 |             AttributeValues< std::array< index_t, 4 > > attribute_values;
          |             ^                                                           
          |                                                                         {}
  • src/geode/mesh/core/geode/geode_tetrahedral_solid.cpp:83:9: warning: [modernize-use-nodiscard]

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

       83 |         index_t get_polyhedron_vertex(
          |         ^
          |         [[nodiscard]] 
  • src/geode/mesh/core/geode/geode_tetrahedral_solid.cpp:90:9: warning: [modernize-use-nodiscard]

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

       90 |         PolyhedronVertex get_polyhedron_facet_vertex_id(
          |         ^
          |         [[nodiscard]] 
  • src/geode/mesh/core/geode/geode_tetrahedral_solid.cpp:100:9: warning: [modernize-use-nodiscard]

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

      100 |         std::optional< index_t > get_polyhedron_adjacent(
          |         ^
          |         [[nodiscard]] 
  • src/geode/mesh/core/geode/geode_triangulated_surface.cpp:56:13: warning: [cppcoreguidelines-pro-type-member-init]

    uninitialized record type: 'attribute_values'

       56 |             AttributeValues< std::array< index_t, 3 > > attribute_values;
          |             ^                                                           
          |                                                                         {}
  • src/geode/mesh/core/geode/geode_triangulated_surface.cpp:81:9: warning: [modernize-use-nodiscard]

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

       81 |         index_t get_polygon_vertex( const PolygonVertex& polygon_vertex ) const
          |         ^
          |         [[nodiscard]] 
  • src/geode/mesh/core/geode/geode_triangulated_surface.cpp:87:9: warning: [modernize-use-nodiscard]

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

       87 |         std::optional< index_t > get_polygon_adjacent(
          |         ^
          |         [[nodiscard]] 
  • src/geode/mesh/core/graph.cpp:94:13: warning: [llvm-qualified-auto]

    'const auto it' can be declared as 'const auto *const it'

       94 |             const auto it = absl::c_find( edges, edge_vertex );
          |             ^~~~~~~~~~
          |             const auto *const 
  • src/geode/mesh/core/graph.cpp:94:24: warning: [readability-identifier-length]

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

       94 |             const auto it = absl::c_find( edges, edge_vertex );
          |                        ^
  • src/geode/mesh/core/graph.cpp:112:17: warning: [llvm-qualified-auto]

    'const auto it' can be declared as 'const auto *const it'

      112 |                 const auto it = absl::c_find( edges, edge_vertex );
          |                 ^~~~~~~~~~
          |                 const auto *const 
  • src/geode/mesh/core/graph.cpp:112:28: warning: [readability-identifier-length]

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

      112 |                 const auto it = absl::c_find( edges, edge_vertex );
          |                            ^
  • src/geode/mesh/core/graph.cpp:173:27: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      173 |     Graph::Graph( BITSERY ) {}
          |                           ^
          |                            /*unused*/
  • src/geode/mesh/core/graph.cpp:249:17: warning: [readability-identifier-length]

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

      249 |         index_t v0, index_t v1 ) const
          |                 ^
  • src/geode/mesh/core/graph.cpp:249:29: warning: [readability-identifier-length]

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

      249 |         index_t v0, index_t v1 ) const
          |                             ^
  • src/geode/mesh/core/graph.cpp:269:9: warning: [readability-avoid-return-with-void-value]

    return statement within a void function should not have a specified return value

      269 |         return impl_->set_edges_around_vertex( vertex_id, std::move( edges ) );
          |         ^~~~~~
  • src/geode/mesh/core/solid_mesh.cpp:27:1: warning: [readability-duplicate-include]

    duplicate include

       26 | 
       27 | #include <stack>
          | ^~~~~~~~~~~~~~~~
  • src/geode/mesh/core/solid_mesh.cpp:165:52: warning: [readability-function-cognitive-complexity]

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

      165 |     std::tuple< geode::PolyhedraAroundEdge, bool > propagate_around_edge(
          |                                                    ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:174:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      174 |         do
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:176:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      176 |             if( const auto adj = solid.polyhedron_adjacent_facet( facet ) )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:180:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      180 |                 for( const auto f : geode::LRange{ solid.nb_polyhedron_facets(
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:183:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      183 |                     if( adj_facet.facet_id == f )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:187:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      187 |                     if( solid.is_edge_in_polyhedron_facet(
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:195:13: note: +1, nesting level increased to 2
      195 |             else
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:200:18: note: +1
      200 |                  && safety_count < MAX_SAFETY_COUNT );
          |                  ^
  • src/geode/mesh/core/solid_mesh.cpp:174:9: warning: [cppcoreguidelines-avoid-do-while]

    avoid do-while loops

      174 |         do
          |         ^
  • src/geode/mesh/core/solid_mesh.cpp:216:37: warning: [readability-function-cognitive-complexity]

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

      216 |     std::optional< geode::index_t > first_polyhedron_around_edge(
          |                                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:220:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      220 |         for( const auto vertex : vertices )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:222:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      222 |             for( const auto& polyhedron :
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:225:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      225 |                 for( const auto& edge_vertices :
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:229:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      229 |                     if( vertices == edge_vertices
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:230:25: note: +1
      230 |                         || ( vertices[0] == edge_vertices[1]
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:231:30: note: +1
      231 |                              && vertices[1] == edge_vertices[0] ) )
          |                              ^
  • src/geode/mesh/core/solid_mesh.cpp:258:48: warning: [readability-function-cognitive-complexity]

    function 'compute_polyhedra_around_vertex' has cognitive complexity of 14 (threshold 10)

      258 |     geode::internal::PolyhedraAroundVertexImpl compute_polyhedra_around_vertex(
          |                                                ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:263:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      263 |         if( !first_polyhedron )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:280:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      280 |         while( !S.empty() && safety_count < MAX_SAFETY_COUNT )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:280:27: note: +1
      280 |         while( !S.empty() && safety_count < MAX_SAFETY_COUNT )
          |                           ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:287:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      287 |             for( const auto& polyhedron_facet :
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:292:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      292 |                 if( !adj_polyhedron )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:298:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      298 |                 if( !polyhedra_visited.insert( p_adj ).second )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:302:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      302 |                 if( const auto v_adj =
          |                 ^
  • src/geode/mesh/core/solid_mesh.cpp:276:36: warning: [cppcoreguidelines-avoid-magic-numbers]

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

      276 |         polyhedra_visited.reserve( 20 );
          |                                    ^
  • src/geode/mesh/core/solid_mesh.cpp:277:47: warning: [readability-identifier-length]

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

      277 |         std::stack< geode::PolyhedronVertex > S;
          |                                               ^
  • src/geode/mesh/core/solid_mesh.cpp:277:47: warning: [readability-identifier-naming]

    invalid case style for variable 'S'

      277 |         std::stack< geode::PolyhedronVertex > S;
          |                                               ^
          |                                               s
      278 |         S.push( first_polyhedron.value() );
          |         ~
          |         s
      279 |         polyhedra_visited.insert( first_polyhedron->polyhedron_id );
      280 |         while( !S.empty() && safety_count < MAX_SAFETY_COUNT )
          |                 ~
          |                 s
      281 |         {
      282 |             safety_count++;
      283 |             result.polyhedra.push_back( S.top() );
          |                                         ~
          |                                         s
      284 |             const auto& polyhedron_vertex_id = result.polyhedra.back();
      285 |             S.pop();
          |             ~
          |             s
  • src/geode/mesh/core/solid_mesh.cpp:432:35: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: polyhedron_around_vertex_, polyhedra_around_vertex_

      432 |     class SolidMesh< dimension >::Impl
          |                                   ^
  • src/geode/mesh/core/solid_mesh.cpp:441:9: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: polyhedron_around_vertex_, polyhedra_around_vertex_

      441 |         explicit Impl( SolidMesh& solid )
          |         ^
  • src/geode/mesh/core/solid_mesh.cpp:452:49: error: [clang-diagnostic-error]

    use of undeclared identifier 'VariableAttribute'

      452 |                     .template create_attribute< VariableAttribute,
          |                                                 ^
  • src/geode/mesh/core/solid_mesh.cpp:457:47: error: [clang-diagnostic-error]

    use of undeclared identifier 'VariableAttribute'

      457 |                     .template find_attribute< VariableAttribute,
          |                                               ^
  • src/geode/mesh/core/solid_mesh.cpp:462:30: warning: [readability-function-cognitive-complexity]

    function 'vertices_around_vertex' has cognitive complexity of 15 (threshold 10)

      462 |         VerticesAroundVertex vertices_around_vertex(
          |                              ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:466:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      466 |             for( const auto& poly_vertex :
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:469:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      469 |                 for( const auto& poly_edge : mesh.polyhedron_edges_vertices(
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:472:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      472 |                     if( poly_edge[0] == vertex_id )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:474:25: note: +4, including nesting penalty of 3, nesting level increased to 4
      474 |                         if( absl::c_find( result, poly_edge[1] )
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:480:26: note: +1, nesting level increased to 3
      480 |                     else if( poly_edge[1] == vertex_id )
          |                          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/core/solid_mesh.cpp:482:25: note: +4, including nesting penalty of 3, nesting level increased to 4
      482 |                         if( absl::c_find( result, poly_edge[0] )
          |                         ^
  • src/geode/mesh/core/solid_mesh.cpp:700:49: error: [clang-diagnostic-error]

    use of undeclared identifier 'VariableAttribute'

      700 |                     .template create_attribute< VariableAttribute,
          |                                                 ^
  • src/geode/mesh/core/solid_mesh.cpp:705:47: error: [clang-diagnostic-error]

    use of undeclared identifier 'VariableAttribute'

      705 |                     .template find_attribute< VariableAttribute,
          |                                               ^
  • src/geode/mesh/core/solid_mesh.cpp:833:26: error: [clang-diagnostic-error]

    use of undeclared identifier 'VariableAttribute'

      833 |         std::shared_ptr< VariableAttribute< PolyhedronVertex > >
          |                          ^
  • src/geode/mesh/core/solid_mesh.cpp:835:34: error: [clang-diagnostic-error]

    use of undeclared identifier 'VariableAttribute'

      835 |         mutable std::shared_ptr< VariableAttribute< CachedPolyhedra > >
          |                                  ^
  • src/geode/mesh/core/solid_mesh.cpp:848:48: warning: [hicpp-named-parameter]

    all parameters should be named in a function

      848 |     SolidMesh< dimension >::SolidMesh( BITSERY )
          |                                                ^
          |                                                 /*unused*/
  • src/geode/mesh/core/solid_mesh.cpp:955:18: warning: [cppcoreguidelines-avoid-magic-numbers]

    1. is a magic number; consider replacing it with a named constant
      955 |                / 2.;
          |                  ^
  • src/geode/mesh/core/solid_mesh.cpp:989:21: warning: [readability-identifier-length]

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

      989 |         const auto& p0 = this->point( first_pt_index );
          |                     ^
  • src/geode/mesh/core/solid_mesh.cpp:1004:29: warning: [readability-identifier-length]

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

     1004 |                 const auto& p1 = this->point( facet_vertices[i - 2] );
          |                             ^
  • src/geode/mesh/core/solid_mesh.cpp:1005:29: warning: [readability-identifier-length]

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

     1005 |                 const auto& p2 = this->point( facet_vertices[i - 1] );
          |                             ^
  • src/geode/mesh/core/solid_mesh.cpp:1006:29: warning: [readability-identifier-length]

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

     1006 |                 const auto& p3 = this->point( facet_vertices[i] );
          |                             ^
  • src/geode/mesh/core/solid_mesh.cpp:1025:21: warning: [readability-identifier-length]

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

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

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

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

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

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

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

     1044 |         const auto& p0 = this->point( facet_vertices[0] );
          |                     ^
  • src/geode/mesh/core/solid_mesh.cpp:1048:25: warning: [readability-identifier-length]

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

     1048 |             const auto& p1 = this->point( facet_vertices[v - 1] );
          |                         ^
  • src/geode/mesh/core/solid_mesh.cpp:1049:25: warning: [readability-identifier-length]

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

     1049 |             const auto& p2 = this->point( facet_vertices[v] );
          |                         ^
  • src/geode/mesh/core/solid_mesh.cpp:1185:13: warning: [llvm-else-after-return]

    do not use 'else' after 'return'

     1185 |             else
          |             ^~~~
     1186 |             {
          |             ~
     1187 |                 return { facet.value() };
          |                 ~~~~~~~~~~~~~~~~~~~~~~~~~
     1188 |             }
          |             ~

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.

2 participants