github-actions[bot] commented on code in PR #43440: URL: https://github.com/apache/doris/pull/43440#discussion_r1832398462
########## be/src/io/cache/fs_file_cache_storage.cpp: ########## @@ -588,6 +588,114 @@ void FSFileCacheStorage::load_cache_info_into_memory(BlockFileCache* _mgr) const TEST_SYNC_POINT_CALLBACK("BlockFileCache::TmpFile2"); } +void FSFileCacheStorage::check_consistency( Review Comment: warning: function 'check_consistency' has cognitive complexity of 59 (threshold 50) [readability-function-cognitive-complexity] ```cpp void FSFileCacheStorage::check_consistency( ^ ``` <details> <summary>Additional context</summary> **be/src/io/cache/fs_file_cache_storage.cpp:596:** nesting level increased to 1 ```cpp auto check = [_mgr, &cache_lock, &confirmed_blocks, &inconsistent_cache_context, ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:598:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp for (; key_it != std::filesystem::directory_iterator(); ++key_it) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:607:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (ec) [[unlikely]] { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:613:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp for (; offset_it != std::filesystem::directory_iterator(); ++offset_it) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:618:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if (!this->parse_filename_suffix_to_cache_type( ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:627:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if (!cell || cell->is_deleted) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:627:** +1 ```cpp if (!cell || cell->is_deleted) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:636:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp ? cell->dowloading_size() ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:635:** +1 ```cpp (is_tmp && cell->file_block->state() == FileBlock::State::DOWNLOADING) ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:639:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if (size != expected_size) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:643:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if (cache_type != cell->file_block->cache_type()) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:647:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if (expiration_time != cell->file_block->expiration_time()) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:652:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if (inconsistent_type != InconsistentCacheContext::InconsistentType::NONE) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:659:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if constexpr (USE_CACHE_VERSION2) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:661:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (ec) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:665:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp for (; key_prefix_it != std::filesystem::directory_iterator(); ++key_prefix_it) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:666:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (!key_prefix_it->is_directory()) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:670:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (key_prefix_it->path().filename().native().size() != KEY_PREFIX_LENGTH) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:675:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if (ec) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:682:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (ec) { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:688:** +1, nesting level increased to 1 ```cpp } else { ^ ``` **be/src/io/cache/fs_file_cache_storage.cpp:690:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (ec) { ^ ``` </details> ########## be/test/io/cache/block_file_cache_test.cpp: ########## @@ -21,6 +21,7 @@ #include <gen_cpp/Types_types.h> Review Comment: warning: 'gen_cpp/Types_types.h' file not found [clang-diagnostic-error] ```cpp #include <gen_cpp/Types_types.h> ^ ``` ########## be/test/io/cache/block_file_cache_test.cpp: ########## @@ -5284,6 +5285,145 @@ } } +TEST_F(BlockFileCacheTest, check_fs_file_cache_consistency) { Review Comment: warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size] ```cpp ^ ``` <details> <summary>Additional context</summary> **be/test/io/cache/block_file_cache_test.cpp:5287:** 137 lines including whitespace and comments (threshold 80) ```cpp ^ ``` </details> ########## be/src/io/cache/fs_file_cache_storage.cpp: ########## @@ -588,6 +588,114 @@ TEST_SYNC_POINT_CALLBACK("BlockFileCache::TmpFile2"); } +void FSFileCacheStorage::check_consistency( Review Comment: warning: function 'check_consistency' exceeds recommended size/complexity thresholds [readability-function-size] ```cpp void FSFileCacheStorage::check_consistency( ^ ``` <details> <summary>Additional context</summary> **be/src/io/cache/fs_file_cache_storage.cpp:590:** 102 lines including whitespace and comments (threshold 80) ```cpp void FSFileCacheStorage::check_consistency( ^ ``` </details> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org