Repository Analysis

carbon-language/carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)

4.8 Likely human-written View on GitHub
4.8
Adjusted Score
4.8
Raw Score
100%
Time Factor
2026-05-30
Last Push
33,718
Stars
C++
Language
277,548
Lines of Code
1093
Files
1125
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 47MEDIUM 16LOW 1062

Pattern Findings

1125 matches across 12 categories. Click a row to expand file-level details.

Over-Commented Block976 hits · 962 pts
SeverityFileLineSnippet
LOWutils/tree_sitter/test_runner.cpp1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWdocs/design/generics/appendix-rewrite-constraints.md541interface B {
LOWdocs/design/generics/appendix-rewrite-constraints.md621}
LOWdocs/design/generics/details.md3121 // - argument has type `N.E.N`
LOWdocs/design/generics/details.md5441// Definition of the previously declared class type
LOWdocs/design/generics/details.md5461
LOWdocs/design/expressions/member_access.md701fn AddTwoIntegers(a: Integer, b: Integer) -> Integer {
LOWtesting/fuzzing/libfuzzer.h1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWtesting/file_test/test_file.h1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWtesting/file_test/test_file.cpp1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWtesting/file_test/test_file.cpp21
LOWtesting/file_test/autoupdate.cpp1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWtesting/file_test/file_test_base.h1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWtesting/file_test/file_test_base.h21#include "testing/file_test/autoupdate.h"
LOWtesting/file_test/file_test_base.h41 // - Each file has a `fail_` prefix if !per_file_success[i].second.
LOWtesting/file_test/file_test_base.h61 // content written to `output_stream` and `error_stream`. Children should use
LOWtesting/file_test/file_test_base.h141 // The test fixture name.
LOWtesting/file_test/file_test_base.cpp1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWtesting/file_test/file_test_base.cpp21
LOWtesting/file_test/file_test_base.cpp41#include "common/check.h"
LOWtesting/file_test/file_test_base_test.cpp1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWtesting/file_test/test_file_test.cpp1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWtesting/file_test/run_test.cpp1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWtesting/file_test/autoupdate.h1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWtesting/base/file_helpers.h1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWtesting/base/file_helpers.h21
LOWtesting/base/unified_diff_matcher.h1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWtesting/base/global_exe_path.h1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWtesting/base/capture_std_streams.cpp1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWcommon/ostream.h1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWcommon/ostream.h81
LOWcommon/exe_path.h1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWcommon/filesystem.h1// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
LOWcommon/filesystem.h21#include "common/check.h"
LOWcommon/filesystem.h41// reasonable Windows implementation is possible.
LOWcommon/filesystem.h61//
LOWcommon/filesystem.h81// The different creation options available when opening a file or directory.
LOWcommon/filesystem.h161// pattern that facilitates octal modeling:
LOWcommon/filesystem.h221
LOWcommon/filesystem.h341//
LOWcommon/filesystem.h381 //
LOWcommon/filesystem.h401 // inability to finish writing.
LOWcommon/filesystem.h421 //
LOWcommon/filesystem.h441 // and this routine will block and attempt to acquire the requested lock for a
LOWcommon/filesystem.h461 explicit FileRefBase(int fd) : fd_(fd) {}
LOWcommon/filesystem.h481 // result in unnoticed data loss.
LOWcommon/filesystem.h501};
LOWcommon/filesystem.h561// This extends the `FileRef` API to provide ownership of the file handle. Most
LOWcommon/filesystem.h601 //
LOWcommon/filesystem.h621};
LOWcommon/filesystem.h661 // Begin reading the entries in a directory.
LOWcommon/filesystem.h681 -> ErrorOr<llvm::SmallVector<std::filesystem::path>, FdError>;
LOWcommon/filesystem.h721 // Like the `stat` system call on Unix-like platforms, this will follow any
LOWcommon/filesystem.h741
LOWcommon/filesystem.h781 -> ErrorOr<WriteFile, PathError>;
LOWcommon/filesystem.h801 // component can be created by the call to this routine.
LOWcommon/filesystem.h821 // permissions restrictive and not include any group access.
LOWcommon/filesystem.h841 // This is a convenience wrapper for opening the path, creating it according
LOWcommon/filesystem.h861 -> ErrorOr<Success, PathError>;
LOWcommon/filesystem.h881 // `target.c_str()`, ignoring everything past any embedded null bytes.
916 more matches not shown…
Cross-File Repetition47 hits · 235 pts
SeverityFileLineSnippet
HIGHwebsite/prebuild.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGH…kills/summarize_testdata_changes/scripts/parse_diff.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHexamples/bazel_test_runner.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHexamples/bazel/update_module_to_nightly.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHbazel/cc_toolchains/cc_tools_test.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHbazel/version/gen_tmpl.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHbazel/check_deps/check_non_test_cc_deps.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHbazel/check_deps/update_roots.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHgithub_tools/check_dependent_pr_test.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHgithub_tools/check_dependent_pr.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHgithub_tools/github_helpers.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHgithub_tools/pr_comments_test.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHgithub_tools/pr_comments.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHgithub_tools/github_helpers_test.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/source_stats.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/bazel_mod_deps.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/check_sha_filenames.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/run_buildifier.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/check_header_guards.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/target_determinator.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/query_module_versions.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/forbid_llvm_googletest.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/fix_cc_deps.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/run_bazel.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/no_op_test.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/create_compdb.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/check_build_graph.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/run_bazelisk.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/workspace_status.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/scripts_utils.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/lldbinit.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/run_buildozer.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/bench_runner.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHscripts/calculate_release_shas.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHproposals/p000555-operator-precedence/figures.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHproposals/scripts/new_proposal_test.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHproposals/scripts/utils_test.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHproposals/scripts/check_proposal_names_test.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHproposals/scripts/utils.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHproposals/scripts/new_proposal.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHproposals/scripts/check_proposal_names.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHtoolchain/autoupdate_testdata.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHtoolchain/install/install_test.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHtoolchain/install/cc_tools_wrapper_test.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHtoolchain/install/toolchain_tar_test.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHtoolchain/runtimes/configure_cmake_file_impl.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
HIGHtoolchain/diagnostics/check_diagnostics.py0part of the carbon language project, under the apache license v2.0 with llvm exceptions. see /license for license inform
AI Slop Vocabulary12 hits · 32 pts
SeverityFileLineSnippet
MEDIUMcommon/filesystem.h430 // file's size to the provided string size. Essentially, this function
MEDIUMcommon/hashing_benchmark.cpp143 // When using random sizes, we leverage `i` which is guaranteed to range
MEDIUMcommon/raw_hashtable.h1520 // growth, but we know we'll find an empty slot, so leverage that.
MEDIUMcommon/raw_hashtable_metadata_group.h832 // This algorithm only works for matching *present* bytes. We leverage the
MEDIUMcommon/hashing.h924 // Essentially the same technique used for dynamically sized byte sequences
MEDIUMcommon/hashing.h1016 // latency over a more robust approach. Doing another mix with the size (the
LOWscripts/fix_cc_deps.py110 # Ignore the version, just use the repo name.
MEDIUM.github/workflows/auto_label_prs.yaml61 # convenience. Essentially, this is everything we intend to ship as
MEDIUMproposals/scripts/utils.py13 """Returns a robust slug of the title."""
MEDIUMtoolchain/driver/compile_subcommand.cpp132 // Instead of controlling this with more nuanced flags, we
MEDIUMtoolchain/driver/runtimes_cache_test.cpp150 // be robust against this, but it isn't important *how* the fallback occurs,
MEDIUMtoolchain/parse/tree.h296 // While we don't want users to directly leverage the index of `NodeId` for
Hyper-Verbose Identifiers37 hits · 31 pts
SeverityFileLineSnippet
LOWgithub_tools/check_dependent_pr_test.py90 def test_process_pr_no_overlap(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py110 def test_process_pr_with_overlap(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py133 def test_process_pr_dependencies_merged(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py157 def test_process_pr_dependency_got_new_commits(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py184 def test_process_pr_non_coherent_prefix(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py204 def test_process_pr_overlap_only_on_head_ref(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py227 def test_process_pr_scanning_no_add(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py248 def test_process_pr_no_changes_needed(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py270 def test_process_pr_invalid_marker(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py296 def test_process_pr_hidden_comment(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py326 def test_process_pr_sticky_first_commit(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py352 def test_process_pr_rebase_first_commit(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py378 def test_process_pr_fallback_no_independent_commit(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py404 def test_process_pr_sequence_failure(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py424 def test_process_pr_no_overlap_different_commits(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py444 def test_process_pr_no_unique_commit(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py464 def test_process_pr_multiple_non_overlapping_commits(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py486 def test_always_sets_status_check_success(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py505 def test_always_sets_status_check_pending(self) -> None:
LOWgithub_tools/check_dependent_pr_test.py524 def test_process_pr_sibling_prs(self) -> None:
LOWgithub_tools/check_dependent_pr.py189def _parse_and_validate_state(
LOWgithub_tools/pr_comments_test.py22 def test_format_comment_short(self):
LOWgithub_tools/pr_comments_test.py257 def test_accumulate_pr_comment(self):
LOWgithub_tools/github_helpers_test.py93 def test_execute_and_paginate_empty(self):
LOWgithub_tools/github_helpers_test.py103 def test_execute_and_paginate_one_page(self):
LOWgithub_tools/github_helpers_test.py115 def test_execute_and_paginate_one_page_count_mismatch(self):
LOWgithub_tools/github_helpers_test.py126 def test_execute_and_paginate_two_page(self):
LOWgithub_tools/github_helpers_test.py146 def test_execute_and_paginate_first_page_done(self):
LOWgithub_tools/github_helpers_test.py160 def test_execute_and_paginate_first_page_continue(self):
LOWscripts/bench_runner.py777def get_benchmark_names_and_metrics(
LOWscripts/bench_runner.py852def collect_benchmark_metrics(
LOWproposals/scripts/new_proposal_test.py18 def test_calculate_branch_short(self):
LOWproposals/scripts/new_proposal_test.py24 def test_calculate_branch_long(self):
LOWproposals/scripts/new_proposal_test.py33 def test_calculate_branch_flag(self):
LOWproposals/scripts/check_proposal_names_test.py35 def test_rename_file_and_directory(self) -> None:
LOWproposals/scripts/check_proposal_names_test.py93 def test_update_directory_references(self) -> None:
LOWproposals/scripts/check_proposal_names_test.py125 def test_relative_path_rename(self) -> None:
Deep Nesting16 hits · 16 pts
SeverityFileLineSnippet
LOWwebsite/prebuild.py75
LOW…kills/summarize_testdata_changes/scripts/parse_diff.py12
LOWbazel/version/gen_tmpl.py52
LOWgithub_tools/check_dependent_pr.py189
LOWgithub_tools/check_dependent_pr.py286
LOWgithub_tools/pr_comments.py306
LOWscripts/source_stats.py109
LOWscripts/fix_cc_deps.py132
LOWscripts/fix_cc_deps.py188
LOWscripts/fix_cc_deps.py217
LOWscripts/lldbinit.py41
LOWscripts/bench_runner.py852
LOWscripts/bench_runner.py975
LOWproposals/scripts/check_proposal_names.py90
LOWtoolchain/autoupdate_testdata.py23
LOWtoolchain/runtimes/configure_cmake_file_impl.py66
Fake / Example Data16 hits · 14 pts
SeverityFileLineSnippet
LOWcommon/command_line.h175// Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
LOWcommon/command_line.h175// Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
LOWcommon/filesystem_benchmark.cpp32 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod "
LOWcommon/filesystem_benchmark.cpp32 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod "
LOWgithub_tools/pr_comments_test.py44 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
LOWgithub_tools/pr_comments_test.py44 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
LOWgithub_tools/pr_comments_test.py47 " author: Lorem ipsum dolor sit amet, consectetur adipiscing "
LOWgithub_tools/pr_comments_test.py47 " author: Lorem ipsum dolor sit amet, consectetur adipiscing "
LOWgithub_tools/pr_comments_test.py54 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
LOWgithub_tools/pr_comments_test.py54 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
LOWgithub_tools/pr_comments_test.py57 " author: Lorem ipsum dolor sit amet, consectetur adipiscing "
LOWgithub_tools/pr_comments_test.py57 " author: Lorem ipsum dolor sit amet, consectetur adipiscing "
LOWgithub_tools/pr_comments_test.py75 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
LOWgithub_tools/pr_comments_test.py75 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
LOWgithub_tools/pr_comments_test.py83 " Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
LOWgithub_tools/pr_comments_test.py83 " Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
Self-Referential Comments4 hits · 10 pts
SeverityFileLineSnippet
MEDIUM.github/workflows/tests.yaml33 # Create a synthetic matrix dimension with the event name for filtering.
MEDIUMproposals/scripts/new_proposal.py189 # Create a proposal branch.
MEDIUMproposals/scripts/new_proposal.py228 # Create a PR with WIP+proposal labels.
MEDIUMtoolchain/install/install_test.py101 # Create a test file that we'll preprocess.
Example Usage Blocks5 hits · 8 pts
SeverityFileLineSnippet
LOWcommon/array_stack.h17// Example usage:
LOWcommon/template_string.h24// Example usage:
LOWcommon/struct_reflection.h10// Example usage:
LOWcommon/hashing.h205// Example usage:
LOWtoolchain/testing/yaml_test_helpers.h11// Example usage:
Excessive Try-Catch Wrapping5 hits · 6 pts
SeverityFileLineSnippet
LOWbazel/cc_toolchains/cc_tools_test.py54 except Exception as e:
LOWgithub_tools/check_dependent_pr.py282 except Exception as e:
LOWscripts/query_module_versions.py37 except Exception as e:
LOWscripts/query_module_versions.py58 except Exception as e:
MEDIUMproposals/scripts/check_proposal_names.py157 print("Error: proposals directory not found.")
Verbosity Indicators4 hits · 6 pts
SeverityFileLineSnippet
LOWtoolchain/check/member_access.cpp764 // Step 1: figure out the type of the associated entity from the interface.
LOWtoolchain/check/import_ref.cpp4466 // Step 1: check for a constant value.
LOWtoolchain/check/import_ref.cpp4473 // Step 2: resolve the instruction.
LOWtoolchain/check/import_ref.cpp4486 // Step 3: pop or retry.
Unused Imports2 hits · 2 pts
SeverityFileLineSnippet
LOWscripts/source_stats.py10
LOWscripts/bench_runner.py58
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippet
LOWscripts/scripts_utils.py137 # Check if there's a cached file that can be used.