Repository Analysis

diem/diem

Diem’s mission is to build a trusted and innovative financial network that empowers people and businesses around the world.

2.3 Likely human-written View on GitHub
2.3
Adjusted Score
2.3
Raw Score
100%
Time Factor
2026-05-29
Last Push
16,677
Stars
Rust
Language
664,480
Lines of Code
2852
Files
1922
Pattern Hits
2026-05-31
Scan Date

Score History

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

CRITICAL 6HIGH 14MEDIUM 13LOW 1889

Pattern Findings

1922 matches across 13 categories. Click a row to expand file-level details.

Over-Commented Block1861 hits · 1293 pts
SeverityFileLineSnippet
LOWx.toml201allow = ["clap"]
LOWx.toml321]
LOWconsensus/consensus-types/src/block_data.rs21 Proposal {
LOWconsensus/consensus-types/src/block_data.rs41 /// Epoch number corresponds to the set of validators that are active for this block.
LOWconsensus/safety-rules/src/tests/suite.rs361 let etimeout = Timeout::new(timeout.epoch() + 1, round + 1);
LOWconsensus/src/network_interface.rs41 BlockRetrievalResponse(Box<BlockRetrievalResponse>),
LOWconsensus/src/network_interface.rs61 CommitDecisionMsg(Box<CommitDecision>),
LOWconsensus/src/pending_votes.rs41 /// The vote completes a new TwoChainTimeoutCertificate
LOWconsensus/src/counters.rs181pub static NUM_BLOCKS_IN_TREE: Lazy<IntGauge> = Lazy::new(|| {
LOWconsensus/src/network_tests.rs41/// `TwinId` is used by the NetworkPlayground to uniquely identify
LOWconsensus/src/network_tests.rs61 /// These events will usually be handled by the event loop spawned in
LOWconsensus/src/experimental/buffer_manager.rs301 // if new from execution_phase_rx,
LOW…ensus/src/experimental/tests/persisting_phase_tests.rs1// Copyright (c) The Diem Core Contributors
LOWconsensus/src/experimental/tests/signing_phase_tests.rs1// Copyright (c) The Diem Core Contributors
LOWconsensus/src/experimental/tests/integration_tests.rs1// Copyright (c) The Diem Core Contributors
LOWconsensus/src/liveness/proposal_generator.rs21
LOWconsensus/src/liveness/round_state.rs61 /// 3-chain rule for commits, so round 1 has round index 0. For example, if one wants
LOWconsensus/src/liveness/round_state.rs121/// * there is a TimeoutCertificate for round `r-1`.
LOWconsensus/src/twins/basic_twins_test.rs61/// than required for quorum do not commit anything.
LOWconsensus/src/twins/basic_twins_test.rs121/// Create 2 partitions, p1=[n1, n3], p2=[n0, twin0, n2]
LOWconsensus/src/twins/basic_twins_test.rs181/// Create 2 partitions, p1=[n0, n1, n2], p2=[n3, twin0, twin1]
LOWconsensus/src/twins/basic_twins_test.rs261///
LOWconsensus/src/block_storage/sync_manager.rs281 pub fn new(network: NetworkSender, preferred_peer: Author) -> Self {
LOWconsensus/src/block_storage/block_tree.rs301
LOWconsensus/src/block_storage/block_store.rs81}
LOWconsensus/src/block_storage/block_store.rs481 }
LOWshuffle/transaction-builder/src/framework.rs1// Copyright (c) The Diem Core Contributors
LOWshuffle/transaction-builder/src/framework.rs21 language_storage::{ModuleId, TypeTag},
LOWshuffle/transaction-builder/src/framework.rs41/// impl ScriptFunctionCall {
LOWshuffle/transaction-builder/src/framework.rs61 ///
LOWshuffle/transaction-builder/src/framework.rs81 },
LOWshuffle/transaction-builder/src/framework.rs101 /// `Diem::CurrencyInfo<Token>` resource published under `0xA550C18` will be
LOWshuffle/transaction-builder/src/framework.rs121 /// | Error Category | Error Reason | Description
LOWshuffle/transaction-builder/src/framework.rs141 },
LOWshuffle/transaction-builder/src/framework.rs161 /// The successful execution of this transaction will emit:
LOWshuffle/transaction-builder/src/framework.rs181 /// | `Errors::NOT_PUBLISHED` | `Diem::EPREBURN_QUEUE` | The account at `preburn_add
LOWshuffle/transaction-builder/src/framework.rs201 /// # Technical Description
LOWshuffle/transaction-builder/src/framework.rs221 /// | ------ | ------ | -------------
LOWshuffle/transaction-builder/src/framework.rs261 },
LOWshuffle/transaction-builder/src/framework.rs281 /// and the `rold_id` field being `Roles::VALIDATOR_ROLE_ID`. This is emitted on the
LOWshuffle/transaction-builder/src/framework.rs301 /// | `Errors::REQUIRES_ROLE` | `Roles::EDIEM_ROOT` | The sending account is not the Diem Roo
LOWshuffle/transaction-builder/src/framework.rs321 /// Root account.
LOWshuffle/transaction-builder/src/framework.rs341 /// | `sliding_nonce` | `u64` | The `sliding_nonce` (see: `SlidingNonce`) to be used for this transacti
LOWshuffle/transaction-builder/src/framework.rs361 /// * `ValidatorAdministrationScripts::remove_validator_and_reconfigure`
LOWshuffle/transaction-builder/src/framework.rs381 /// `AccountFreezing::FreezeAccountEvent`. The transaction sender must be the
LOWshuffle/transaction-builder/src/framework.rs401 /// # Common Abort Conditions
LOWshuffle/transaction-builder/src/framework.rs421 amount: u64,
LOWshuffle/transaction-builder/src/framework.rs441 /// `Diem::CurrencyInfo<Token`'s `preburn_events` handle for `Token` and with
LOWshuffle/transaction-builder/src/framework.rs461 /// | `Errors::REQUIRES_ROLE` | `Roles::EDESIGNATED_DEALER` | The `account` did not ha
LOWshuffle/transaction-builder/src/framework.rs481 /// # Parameters
LOWshuffle/transaction-builder/src/framework.rs501 /// # Summary
LOWshuffle/transaction-builder/src/framework.rs521 /// | ---------------- | -------------- | -------------
LOWshuffle/transaction-builder/src/framework.rs541 ///
LOWshuffle/transaction-builder/src/framework.rs561 /// | `Errors::INVALID_ARGUMENT` | `SlidingNonce::ENONCE_TOO_NEW` | The `sliding_nonce` i
LOWshuffle/transaction-builder/src/framework.rs581 /// # Technical Description
LOWshuffle/transaction-builder/src/framework.rs601 /// # Common Abort Conditions
LOWshuffle/transaction-builder/src/framework.rs621 /// # Technical Description
LOWshuffle/transaction-builder/src/framework.rs641 /// | ------ | ------ | -------------
LOWshuffle/transaction-builder/src/framework.rs661 /// | `Errors::INVALID_STATE` | `Diem::EMINTING_NOT_ALLOWED` | Minting is not currently allowed
LOWshuffle/transaction-builder/src/framework.rs681 /// # Technical Description
1801 more matches not shown…
Hallucination Indicators6 hits · 60 pts
SeverityFileLineSnippet
CRITICALlanguage/tools/move-cli/src/sandbox/commands/publish.rs103 .map(|((ident, _), m)| (ident.value.module.0.value.to_string(), m))
CRITICALlanguage/move-model/src/builder/module_builder.rs194 self.symbol_pool().make(m.value.module.0.value.as_str()),
CRITICALlanguage/move-model/src/builder/exp_translator.rs557 self.symbol_pool().make(m.value.module.0.value.as_str()),
CRITICALjson-rpc/src/stream_rpc/subscription_types.rs108 self.client.connection_context.sdk_info.language.as_str(),
CRITICALjson-rpc/src/stream_rpc/subscription_types.rs109 &self.client.connection_context.sdk_info.version.to_string(),
CRITICALjson-rpc/src/stream_rpc/subscription_types.rs181 helper.client.connection_context.sdk_info.language.as_str(),
Synthetic Comment Markers7 hits · 52 pts
SeverityFileLineSnippet
HIGHshuffle/transaction-builder/src/framework.rs11//! This code was generated by compiling known Script interfaces ("ABIs") with the tool `transaction-builder-generator`.
HIGHtestsuite/smoke-test/src/transaction.rs71 // query the transaction and check it contains the same values as requested
HIGH…leases/artifacts/current/transaction_script_builder.rs11//! This code was generated by compiling known Script interfaces ("ABIs") with the tool `transaction-builder-generator`.
HIGH…ifacts/release-1.2.0-rc0/transaction_script_builder.rs11//! This code was generated by compiling known Script interfaces ("ABIs") with the tool `transaction-builder-generator`.
HIGH…ifacts/release-1.4.0-rc0/transaction_script_builder.rs11//! This code was generated by compiling known Script interfaces ("ABIs") with the tool `transaction-builder-generator`.
HIGHlanguage/transaction-builder/generator/src/rust.rs127//! This code was generated by compiling known Script interfaces ("ABIs") with the tool `transaction-builder-generator`.
HIGHsdk/transaction-builder/src/stdlib.rs11//! This code was generated by compiling known Script interfaces ("ABIs") with the tool `transaction-builder-generator`.
Cross-File Repetition7 hits · 35 pts
SeverityFileLineSnippet
HIGHdocker/compose/data-restore/s3-public.toml0file_handle="$backup_handle/$file_name" echo "$file_handle" exec 1>&- gzip -c | aws s3 cp - "s3://$bucket/$sub_dir/$file
HIGHhelm/fullnode/files/backup/s3.toml0file_handle="$backup_handle/$file_name" echo "$file_handle" exec 1>&- gzip -c | aws s3 cp - "s3://$bucket/$sub_dir/$file
HIGHhelm/fullnode/files/backup/s3-public.toml0file_handle="$backup_handle/$file_name" echo "$file_handle" exec 1>&- gzip -c | aws s3 cp - "s3://$bucket/$sub_dir/$file
HIGH…backup-cli/src/storage/command_adapter/gcp.sample.toml0# backup handle is the same with input backup name, output to stdout echo "$backup_name"
HIGH…ckup-cli/src/storage/command_adapter/azure.sample.toml0# backup handle is the same with input backup name, output to stdout echo "$backup_name"
HIGH…/backup-cli/src/storage/command_adapter/s3.sample.toml0# backup handle is the same with input backup name, output to stdout echo "$backup_name"
HIGH.github/workflows/transaction-replay.toml0# backup handle is the same with input backup name, output to stdout echo "$backup_name"
Verbosity Indicators13 hits · 25 pts
SeverityFileLineSnippet
LOWnetwork/netcore/src/transport/and_then.rs161 // Step 1: Drive Fut1 to completion
LOWnetwork/netcore/src/transport/and_then.rs167 // Step 4: Drive Fut2 to completion
LOWnetwork/netcore/src/transport/and_then.rs172 // Step 2: Ensure that Fut1 is dropped
LOWnetwork/netcore/src/transport/and_then.rs174 // Step 3: Run F on the output of Fut1 to create Fut2
LOW…uage/move-prover/bytecode/src/verification_analysis.rs594 // Step 1: remove suspended invariants from the the relevance set. These suspended
LOW…uage/move-prover/bytecode/src/verification_analysis.rs607 // Step 2: defer the suspended invariants back to the caller and the caller will accept
LOW…rover/bytecode/src/global_invariant_instrumentation.rs392 // Step 1: emit entrypoint assumptions
LOW…rover/bytecode/src/global_invariant_instrumentation.rs395 // Step 2: emit entrypoint snapshots. This can happen if this function defers invariant
LOW…rover/bytecode/src/global_invariant_instrumentation.rs402 // Step 3: go over the bytecode and instrument assertions.
LOWlanguage/move-model/src/lib.rs106 // Step 1: parse the program to get comments and a separation of targets and dependencies.
LOWlanguage/move-model/src/lib.rs147 // Step 2: run the compiler up to expansion
LOWlanguage/move-model/src/lib.rs208 // Step 3: selective compilation.
LOWdevtools/x/src/nextest.rs64 // Step 1: build all the test binaries with --no-run.
AI Slop Vocabulary8 hits · 24 pts
SeverityFileLineSnippet
MEDIUMtypes/src/network_address/mod.rs35/// future-proof network address represented as a stack of protocols. Essentially
MEDIUMtestsuite/cli/diem-wallet/src/wallet_library.rs6//! we will be releasing more robust Wallet implementations. It is our intention to present a
MEDIUMtestsuite/cli/diem-wallet/src/wallet_library.rs8//! implementation and it's security guarantees throughout testnet. For a more robust wallet
MEDIUMlanguage/move-prover/tests/testsuite.rs251/// in the source. We still use datatest to finally run the tests to utilize its
MEDIUM…uage/move-prover/bytecode/src/reaching_def_analysis.rs54 // For being robust, we protect this function against cycles in alias definitions. If
MEDIUMlanguage/bytecode-verifier/src/type_safety.rs5//! It does not utilize control flow, but does check each block independently
MEDIUMstorage/diemdb/src/diemdb_test.rs377 // TODO(philiphayes): more robust fuzzing?
MEDIUMsecure/net/src/lib.rs15//! Internally both the client and server leverage a NetworkStream that communications in blocks
Slop Phrases5 hits · 10 pts
SeverityFileLineSnippet
LOWcrates/diem-crypto/benches/noise.rs4//! Don't forget to run this benchmark with AES-NI enable.
MEDIUMdocker/compose/data-restore/docker-compose.yaml19 # Diem Association provides public data backup you can use, check the offical website.
LOWdocker/compose/data-restore/docker-compose.yaml35# so make sure you start this docker compose using same project name as the db you want to restore.
LOWlanguage/move-model/src/builder/module_builder.rs2192 // Don't forget to put schema back.
MEDIUMsdk/src/lib.rs17//! Here is a simple example to show how to create two accounts and do a p2p transfer on testnet:
Decorative Section Separators3 hits · 9 pts
SeverityFileLineSnippet
MEDIUMstorage/jellyfish-merkle/src/lib.rs22//! .──────────────────────.
MEDIUMstorage/jellyfish-merkle/src/lib.rs23//! _.─────' `──────.
MEDIUMstorage/jellyfish-merkle/src/lib.rs39//!+──────────────────────────────────────────────────────────────────────────────────────────────+
Hyper-Verbose Identifiers6 hits · 6 pts
SeverityFileLineSnippet
LOWlanguage/transaction-builder/generator/src/python3.rs131def decode_script_function_payload(payload: TransactionPayload) -> ScriptFunctionCall:
LOWdevelopers.diem.com/static/js/mobile_nav.js9 function addClickHandlersToMainNavTriggers() {
LOWdevelopers.diem.com/static/js/mobile_nav.js24 function addClickHandlersToSubNavTriggers() {
LOWdevelopers.diem.com/static/js/mobile_nav.js39 function addClickHandlersToNavToggles(navToggles, nav, _isMainNavClick, _isSubNavClick) {
LOWdevelopers.diem.com/static/js/forms.js86 function handleEnterpriseTypeChange(val) {
LOWscripts/fgi/kube.py86def get_cluster_name_from_context(context):
Example Usage Blocks2 hits · 3 pts
SeverityFileLineSnippet
LOWcrates/diem-assets-proof/src/lib.rs9//! ### Example usage:
LOWscripts/cargo_update_outdated.sh11# Example usage:
Fake / Example Data2 hits · 2 pts
SeverityFileLineSnippet
LOWdevelopers.diem.com/docs/v2-docs-guide.md26 overlay="Send a test transaction to orem ipsum dolor sit amet, ctetur adipiscing elit, sed do"
LOWdevelopers.diem.com/docs/v2-docs-guide.md218 overlay="Send a test transaction to orem ipsum dolor sit amet, ctetur adipiscing elit, sed do"
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippet
LOWhelm/fullnode/values.yaml38 # Set this to a StorageClass available on your Kubernetes cluster
Deep Nesting1 hit · 1 pts
SeverityFileLineSnippet
LOWscripts/fgi/kube.py90