Repository Analysis

ast-grep/ast-grep

⚡A CLI tool for code structural search, lint and rewriting. Written in Rust

0.9 Likely human-written View on GitHub
0.9
Adjusted Score
0.9
Raw Score
100%
Time Factor
2026-05-28
Last Push
14,236
Stars
Rust
Language
77,450
Lines of Code
263
Files
51
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 4MEDIUM 1LOW 46

Pattern Findings

51 matches across 6 categories. Click a row to expand file-level details.

Over-Commented Block35 hits · 35 pts
SeverityFileLineSnippet
LOWcrates/core/src/pinned.rs1use crate::matcher::NodeMatch;
LOWcrates/core/src/source.rs1//! This module defines the `Doc` and `Content` traits to abstract away source code encoding issues.
LOWcrates/core/src/tree_sitter/traversal.rs1//! # Traverse Node AST
LOWcrates/config/src/rule_config.rs61 pub core: SerializableRuleCore,
LOWcrates/config/src/rule_config.rs81 pub message: String,
LOWcrates/config/src/rule_core.rs41type RResult<T> = std::result::Result<T, RuleCoreError>;
LOWcrates/config/src/rule/selector.rs1#![allow(clippy::doc_lazy_continuation)]
LOWcrates/config/src/rule/parameterized_util.rs1//! Parameterized utility rules have two parts:
LOWcrates/config/src/rule/mod.rs41///
LOWcrates/config/src/rule/mod.rs61 /// It specifies the position in nodes' sibling list.
LOWcrates/config/src/rule/mod.rs81 pub precedes: Maybe<Box<Relation>>,
LOWcrates/wasm/tests/web.rs1//! Integration tests for ast-grep-wasm.
LOWcrates/language/src/lib.rs1//! This module defines the supported programming languages for ast-grep.
LOWcrates/language/src/lib.rs201
LOWcrates/language/src/lib.rs221// https://developer.hashicorp.com/terraform/language/syntax/configuration#identifiers
LOWcrates/cli/src/config.rs41 #[serde(skip_serializing_if = "Option::is_none")]
LOWcrates/cli/src/run.rs61#[derive(Args)]
LOWcrates/cli/src/verify.rs161// for result in summary {
LOWcrates/cli/src/verify.rs181 /// Conflicts with --update-all.
LOWcrates/cli/src/new.rs21 name: Option<String>,
LOWcrates/cli/src/new.rs101 }
LOWcrates/cli/src/new.rs121 ///
LOWcrates/cli/src/scan.rs41 /// --inline-rules is incompatible with --rule.
LOWcrates/cli/src/scan.rs61 #[clap(flatten)]
LOWcrates/cli/src/completions.rs1//! How to use generate shell completions.
LOWcrates/cli/src/utils/worker.rs21 /// `consume_items` will run in a separate single thread.
LOWcrates/cli/src/utils/args.rs21 #[clap(value_parser, default_value = ".")]
LOWcrates/cli/src/utils/args.rs41 /// Use this if you need to take code stream from standard input.
LOWcrates/cli/src/utils/args.rs121 /// Note that code rewrite only happens inside a session.
LOWcrates/cli/src/utils/args.rs141 /// You can pass optional value to this flag by using `--json=<STYLE>` syntax
LOWcrates/cli/src/utils/args.rs301 #[clap(long, conflicts_with = "rule", value_name = "REGEX")]
LOWcrates/cli/src/utils/args.rs321 /// Note, this flag must use `=` to specify its value.
LOWcrates/cli/src/utils/inspect.rs1//! See https://github.com/ast-grep/ast-grep/issues/905
LOWcrates/cli/src/print/mod.rs141 /// N.B. this can be different from node.text() because
LOWcrates/napi/src/sg_node.rs401
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippet
HIGHcrates/pyo3/tests/test_simple.py0function test() { let a = 123 let b = 456 let c = 789 }
HIGHcrates/pyo3/tests/test_wrong_usage.py0function test() { let a = 123 let b = 456 let c = 789 }
HIGHcrates/pyo3/tests/test_traversal.py0function test() { let a = 123 let b = 456 let c = 789 }
Unused Imports7 hits · 7 pts
SeverityFileLineSnippet
LOWcrates/pyo3/ast_grep_py/__init__.py1
LOWcrates/pyo3/ast_grep_py/__init__.py4
LOWcrates/pyo3/ast_grep_py/__init__.py4
LOWcrates/pyo3/ast_grep_py/__init__.py4
LOWcrates/pyo3/ast_grep_py/__init__.py4
LOWcrates/pyo3/ast_grep_py/__init__.py4
LOWcrates/pyo3/ast_grep_py/__init__.py4
Cross-Language Confusion (JS/TS)1 hit · 5 pts
SeverityFileLineSnippet
HIGHcrates/napi/__test__/index.spec.ts51 print("ザ・ワールド")`
AI Slop Vocabulary1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMcrates/napi/src/lib.rs75/// It utilize multiple CPU cores when **concurrent processing sources**.
Hyper-Verbose Identifiers4 hits · 2 pts
SeverityFileLineSnippet
LOWcrates/pyo3/tests/test_rule.py97def test_complex_config_dict_not_found():
LOWcrates/pyo3/tests/test_wrong_usage.py14def test_wrong_use_pattern_as_dict():
LOWcrates/pyo3/tests/test_wrong_usage.py41def test_error_for_invalid_kind():
LOWcrates/pyo3/tests/test_wrong_usage.py45def test_no_error_for_invalid_pattern():