repo_id
stringclasses
400 values
commit_sha
stringclasses
400 values
commit_index
int32
0
951
in_repo_split
stringclasses
1 value
cross_repo_split
stringclasses
1 value
test_file
stringlengths
7
121
test_function
stringlengths
1
108
assertion_type
stringclasses
32 values
difficulty
stringclasses
8 values
context_lines
int32
3
600
prefix
large_stringlengths
44
113k
target
large_stringlengths
1
498
anchor_sha
stringclasses
400 values
anchor_index
int32
0
951
qna_source
stringclasses
1 value
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/csharp/tests/test_csharp_parse_helpers.py
test_find_matching_brace_empty_body
assert
numeric_literal
14
from __future__ import annotations from desloppify.languages.csharp._parse_helpers import ( extract_csharp_params, extract_csharp_return_annotation, find_expression_end, find_matching_brace, split_params, ) def test_find_matching_brace_empty_body(): content = "{}" assert find_matching_bra...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/csharp/tests/test_csharp_parse_helpers.py
test_find_expression_end_simple
assert
numeric_literal
14
from __future__ import annotations from desloppify.languages.csharp._parse_helpers import ( extract_csharp_params, extract_csharp_return_annotation, find_expression_end, find_matching_brace, split_params, ) def test_find_expression_end_simple(): content = "x + 1;" assert find_expression_e...
5
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/csharp/tests/test_csharp_parse_helpers.py
test_split_params_generic_type
assert
numeric_literal
15
from __future__ import annotations from desloppify.languages.csharp._parse_helpers import ( extract_csharp_params, extract_csharp_return_annotation, find_expression_end, find_matching_brace, split_params, ) def test_split_params_generic_type(): """Commas inside generic brackets are not split p...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/go/tests/test_extractors.py
test_extract_simple_function
assert
numeric_literal
31
from __future__ import annotations from pathlib import Path from unittest.mock import patch from desloppify.languages.go.extractors import ( extract_functions, extract_go_functions, normalize_go_body, ) def _write_go_file(tmp_path: Path, name: str, content: str) -> str: f = tmp_path / name f.writ...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/go/tests/test_extractors.py
test_extract_simple_function
assert
numeric_literal
33
from __future__ import annotations from pathlib import Path from unittest.mock import patch from desloppify.languages.go.extractors import ( extract_functions, extract_go_functions, normalize_go_body, ) def _write_go_file(tmp_path: Path, name: str, content: str) -> str: f = tmp_path / name f.writ...
3
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/go/tests/test_extractors.py
test_extract_functions_directory
assert
numeric_literal
45
from __future__ import annotations from pathlib import Path from unittest.mock import patch from desloppify.languages.go.extractors import ( extract_functions, extract_go_functions, normalize_go_body, ) def _write_go_file(tmp_path: Path, name: str, content: str) -> str: f = tmp_path / name f.writ...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_complexity.py
test_multiple_functions_returns_max
assert
numeric_literal
25
import textwrap from desloppify.languages.python.detectors import complexity as complexity_mod from desloppify.languages.python.detectors.complexity import ( compute_long_functions, compute_max_params, compute_nesting_depth, ) class TestComputeMaxParams: def test_multiple_functions_returns_max(self):...
9
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_complexity.py
test_nested_parens_handled
assert
numeric_literal
24
import textwrap from desloppify.languages.python.detectors import complexity as complexity_mod from desloppify.languages.python.detectors.complexity import ( compute_long_functions, compute_max_params, compute_nesting_depth, ) class TestComputeMaxParams: def test_nested_parens_handled(self): ...
8
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_complexity.py
test_deep_nesting_detected
assert
numeric_literal
27
import textwrap from desloppify.languages.python.detectors import complexity as complexity_mod from desloppify.languages.python.detectors.complexity import ( compute_long_functions, compute_max_params, compute_nesting_depth, ) class TestComputeNestingDepth: def test_deep_nesting_detected(self): ...
5
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_complexity.py
test_4_space_indent
assert
numeric_literal
19
import textwrap from desloppify.languages.python.detectors import complexity as complexity_mod from desloppify.languages.python.detectors.complexity import ( compute_long_functions, compute_max_params, compute_nesting_depth, ) class TestDetectIndentUnit: def test_4_space_indent(self): lines = ...
4
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_complexity.py
test_2_space_indent
assert
numeric_literal
20
import textwrap from desloppify.languages.python.detectors import complexity as complexity_mod from desloppify.languages.python.detectors.complexity import ( compute_long_functions, compute_max_params, compute_nesting_depth, ) class TestDetectIndentUnit: def test_2_space_indent(self): lines =...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_complexity.py
test_tab_counted_as_chars
assert
numeric_literal
19
import textwrap from desloppify.languages.python.detectors import complexity as complexity_mod from desloppify.languages.python.detectors.complexity import ( compute_long_functions, compute_max_params, compute_nesting_depth, ) class TestDetectIndentUnit: def test_tab_counted_as_chars(self): l...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_coupling_contracts.py
test_detects_implicit_mixin_contract_dependencies
assert
numeric_literal
25
from pathlib import Path from desloppify.languages.python.detectors.coupling_contracts import ( detect_implicit_mixin_contracts, ) def _write(tmp_path: Path, rel: str, content: str) -> Path: path = tmp_path / rel path.parent.mkdir(parents=True, exist_ok=True) path.write_text(content) return path ...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_coupling_contracts.py
test_detects_implicit_mixin_contract_dependencies
assert
numeric_literal
28
from pathlib import Path from desloppify.languages.python.detectors.coupling_contracts import ( detect_implicit_mixin_contracts, ) def _write(tmp_path: Path, rel: str, content: str) -> Path: path = tmp_path / rel path.parent.mkdir(parents=True, exist_ok=True) path.write_text(content) return path ...
4
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_deps.py
test_single_file_no_imports
assert
numeric_literal
37
import textwrap from pathlib import Path from desloppify.languages.python.detectors.deps import ( build_dep_graph, find_python_dynamic_imports, ) def _make_pkg(tmp_path: Path, files: dict[str, str]) -> Path: """Create a Python package directory structure. Args: tmp_path: pytest temp directory...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_deps.py
test_multi_file_graph
assert
numeric_literal
41
import textwrap from pathlib import Path from desloppify.languages.python.detectors.deps import ( build_dep_graph, find_python_dynamic_imports, ) def _make_pkg(tmp_path: Path, files: dict[str, str]) -> Path: """Create a Python package directory structure. Args: tmp_path: pytest temp directory...
3
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_deps.py
test_importer_count
assert
numeric_literal
46
import textwrap from pathlib import Path from desloppify.languages.python.detectors.deps import ( build_dep_graph, find_python_dynamic_imports, ) def _make_pkg(tmp_path: Path, files: dict[str, str]) -> Path: """Create a Python package directory structure. Args: tmp_path: pytest temp directory...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_deps.py
test_ignores_non_string_args
assert
numeric_literal
43
import textwrap from pathlib import Path from desloppify.languages.python.detectors.deps import ( build_dep_graph, find_python_dynamic_imports, ) def _make_pkg(tmp_path: Path, files: dict[str, str]) -> Path: """Create a Python package directory structure. Args: tmp_path: pytest temp directory...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_dict_keys.py
test_identical
assert
numeric_literal
27
import textwrap from pathlib import Path from desloppify.languages.python.detectors import dict_keys as dict_keys_mod from desloppify.languages.python.detectors.dict_keys import ( detect_dict_key_flow, detect_schema_drift, ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> Path: ...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_dict_keys.py
test_one_edit
assert
numeric_literal
28
import textwrap from pathlib import Path from desloppify.languages.python.detectors import dict_keys as dict_keys_mod from desloppify.languages.python.detectors.dict_keys import ( detect_dict_key_flow, detect_schema_drift, ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> Path: ...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_dict_keys.py
test_empty
assert
numeric_literal
28
import textwrap from pathlib import Path from desloppify.languages.python.detectors import dict_keys as dict_keys_mod from desloppify.languages.python.detectors.dict_keys import ( detect_dict_key_flow, detect_schema_drift, ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> Path: ...
3
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_dict_keys.py
test_swap
assert
numeric_literal
28
import textwrap from pathlib import Path from desloppify.languages.python.detectors import dict_keys as dict_keys_mod from desloppify.languages.python.detectors.dict_keys import ( detect_dict_key_flow, detect_schema_drift, ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> Path: ...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_extractors.py
test_simple_function
assert
numeric_literal
30
import textwrap from pathlib import Path from desloppify.languages.python.extractors import ( detect_passthrough_functions, extract_py_classes, extract_py_functions, extract_py_params, normalize_py_body, ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> str: """Write...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_extractors.py
test_simple_function
assert
numeric_literal
34
import textwrap from pathlib import Path from desloppify.languages.python.extractors import ( detect_passthrough_functions, extract_py_classes, extract_py_functions, extract_py_params, normalize_py_body, ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> str: """Write...
3
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_extractors.py
test_class_with_init_attributes
assert
numeric_literal
34
import textwrap from pathlib import Path from desloppify.languages.python.extractors import ( detect_passthrough_functions, extract_py_classes, extract_py_functions, extract_py_params, normalize_py_body, ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> str: """Write...
8
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_extractors.py
test_passthrough_detected
assert
numeric_literal
31
import textwrap from pathlib import Path from desloppify.languages.python.extractors import ( detect_passthrough_functions, extract_py_classes, extract_py_functions, extract_py_params, normalize_py_body, ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> str: """Write...
4
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_facade.py
test_facade_file_detected
assert
numeric_literal
24
from __future__ import annotations from desloppify.languages.python.detectors.facade import ( detect_reexport_facades, is_py_facade, ) def _make_graph_entry(importer_count: int = 0) -> dict: return { "imports": set(), "importers": set(), "import_count": 0, "importer_count":...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_facade.py
test_empty_graph
assert
numeric_literal
22
from __future__ import annotations from desloppify.languages.python.detectors.facade import ( detect_reexport_facades, is_py_facade, ) def _make_graph_entry(importer_count: int = 0) -> dict: return { "imports": set(), "importers": set(), "import_count": 0, "importer_count":...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_facade.py
test_python_directory_facade
assert
numeric_literal
35
from __future__ import annotations from desloppify.languages.python.detectors.facade import ( detect_reexport_facades, is_py_facade, ) def _make_graph_entry(importer_count: int = 0) -> dict: return { "imports": set(), "importers": set(), "import_count": 0, "importer_count":...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_init.py
test_exclusions_non_empty
assert
numeric_literal
16
from desloppify.engine.policy.zones import Zone from desloppify.languages.python import ( PY_COMPLEXITY_SIGNALS, PY_ENTRY_PATTERNS, PY_GOD_RULES, PY_SKIP_NAMES, PY_ZONE_RULES, PythonConfig, ) class TestPythonConfig: def test_exclusions_non_empty(self): config = PythonConfig() ...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_init.py
test_all_have_weight
assert
numeric_literal
17
from desloppify.engine.policy.zones import Zone from desloppify.languages.python import ( PY_COMPLEXITY_SIGNALS, PY_ENTRY_PATTERNS, PY_GOD_RULES, PY_SKIP_NAMES, PY_ZONE_RULES, PythonConfig, ) class TestComplexitySignals: def test_all_have_weight(self): for s in PY_COMPLEXITY_SIGNAL...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_mutable_state.py
test_list_mutated
assert
numeric_literal
30
import textwrap from pathlib import Path from desloppify.languages.python.detectors.mutable_state import ( detect_global_mutable_config, ) def _write_py(tmp_path: Path, code: str, filename: str = "mod.py") -> Path: f = tmp_path / filename f.write_text(textwrap.dedent(code)) return tmp_path def _names...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_mutable_state.py
test_upper_case_constant
assert
numeric_literal
30
import textwrap from pathlib import Path from desloppify.languages.python.detectors.mutable_state import ( detect_global_mutable_config, ) def _write_py(tmp_path: Path, code: str, filename: str = "mod.py") -> Path: f = tmp_path / filename f.write_text(textwrap.dedent(code)) return tmp_path def _names...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_mutable_state.py
test_mutation_count
assert
numeric_literal
33
import textwrap from pathlib import Path from desloppify.languages.python.detectors.mutable_state import ( detect_global_mutable_config, ) def _write_py(tmp_path: Path, code: str, filename: str = "mod.py") -> Path: f = tmp_path / filename f.write_text(textwrap.dedent(code)) return tmp_path def _names...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_private_imports.py
test_detects_cross_module_private_import
assert
numeric_literal
34
from __future__ import annotations from pathlib import Path from desloppify.languages.python.detectors.private_imports import detect_private_imports def _graph_entry(*, imports: set[str] | None = None) -> dict: return { "imports": imports or set(), "importers": set(), "importer_count": 0,...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_private_imports.py
test_detects_cross_module_private_import
assert
numeric_literal
35
from __future__ import annotations from pathlib import Path from desloppify.languages.python.detectors.private_imports import detect_private_imports def _graph_entry(*, imports: set[str] | None = None) -> dict: return { "imports": imports or set(), "importers": set(), "importer_count": 0,...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_responsibility_cohesion.py
test_detects_disconnected_dumping_ground_module
assert
numeric_literal
36
from pathlib import Path from desloppify.languages.python.detectors.responsibility_cohesion import ( detect_responsibility_cohesion, ) def _write(tmp_path: Path, rel: str, content: str) -> Path: path = tmp_path / rel path.parent.mkdir(parents=True, exist_ok=True) path.write_text(content) return pa...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_responsibility_cohesion.py
test_detects_disconnected_dumping_ground_module
assert
numeric_literal
39
from pathlib import Path from desloppify.languages.python.detectors.responsibility_cohesion import ( detect_responsibility_cohesion, ) def _write(tmp_path: Path, rel: str, content: str) -> Path: path = tmp_path / rel path.parent.mkdir(parents=True, exist_ok=True) path.write_text(content) return pa...
3
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_responsibility_cohesion.py
test_detects_disconnected_dumping_ground_module
assert
numeric_literal
40
from pathlib import Path from desloppify.languages.python.detectors.responsibility_cohesion import ( detect_responsibility_cohesion, ) def _write(tmp_path: Path, rel: str, content: str) -> Path: path = tmp_path / rel path.parent.mkdir(parents=True, exist_ok=True) path.write_text(content) return pa...
9
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_responsibility_cohesion.py
test_ignores_small_files_even_if_disconnected
assert
numeric_literal
30
from pathlib import Path from desloppify.languages.python.detectors.responsibility_cohesion import ( detect_responsibility_cohesion, ) def _write(tmp_path: Path, rel: str, content: str) -> Path: path = tmp_path / rel path.parent.mkdir(parents=True, exist_ok=True) path.write_text(content) return pa...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_smells.py
test_clean_file
assert
numeric_literal
49
import textwrap from pathlib import Path from desloppify.languages.python.detectors import smells as smells_mod from desloppify.languages.python.detectors.smells import ( detect_smells, ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> Path: """Write a Python file and return the dir...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_smells.py
test_clean_file
assert
numeric_literal
50
import textwrap from pathlib import Path from desloppify.languages.python.detectors import smells as smells_mod from desloppify.languages.python.detectors.smells import ( detect_smells, ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> Path: """Write a Python file and return the dir...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_uncalled.py
test_detects_uncalled_private_function
assert
numeric_literal
40
from __future__ import annotations from pathlib import Path from desloppify.languages.python.detectors.uncalled import detect_uncalled_functions from desloppify.languages.python.detectors.deps import build_dep_graph def _graph_entry(*, imports: set[str] | None = None) -> dict: return { "imports": imports...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_uncalled.py
test_detects_uncalled_private_function
assert
numeric_literal
42
from __future__ import annotations from pathlib import Path from desloppify.languages.python.detectors.uncalled import detect_uncalled_functions from desloppify.languages.python.detectors.deps import build_dep_graph def _graph_entry(*, imports: set[str] | None = None) -> dict: return { "imports": imports...
4
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_unused.py
test_unused_import_detected
assert
numeric_literal
33
import shutil import textwrap from pathlib import Path import pytest from desloppify.languages.python.detectors.unused import detect_unused pytestmark = pytest.mark.skipif( shutil.which("ruff") is None, reason="ruff not installed" ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> Path...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_unused.py
test_no_unused_in_clean_code
assert
numeric_literal
32
import shutil import textwrap from pathlib import Path import pytest from desloppify.languages.python.detectors.unused import detect_unused pytestmark = pytest.mark.skipif( shutil.which("ruff") is None, reason="ruff not installed" ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> Path...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/smells/test_ts_smell_helpers.py
test_simple_function
assert
numeric_literal
24
from desloppify.languages.typescript.detectors._smell_detectors import ( _detect_catch_return_default, _detect_dead_functions, _detect_monster_functions, _detect_window_globals, _find_function_start, ) from desloppify.languages.typescript.detectors._smell_helpers import ( _detect_async_no_await,...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/smells/test_ts_smell_helpers.py
test_nested_braces
assert
numeric_literal
25
from desloppify.languages.typescript.detectors._smell_detectors import ( _detect_catch_return_default, _detect_dead_functions, _detect_monster_functions, _detect_window_globals, _find_function_start, ) from desloppify.languages.typescript.detectors._smell_helpers import ( _detect_async_no_await,...
4
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/smells/test_ts_smell_helpers.py
test_flags_async_without_await
assert
numeric_literal
31
from desloppify.languages.typescript.detectors._smell_detectors import ( _detect_catch_return_default, _detect_dead_functions, _detect_monster_functions, _detect_window_globals, _find_function_start, ) from desloppify.languages.typescript.detectors._smell_helpers import ( _detect_async_no_await,...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/smells/test_ts_smell_helpers.py
test_skips_async_with_await
assert
numeric_literal
32
from desloppify.languages.typescript.detectors._smell_detectors import ( _detect_catch_return_default, _detect_dead_functions, _detect_monster_functions, _detect_window_globals, _find_function_start, ) from desloppify.languages.typescript.detectors._smell_helpers import ( _detect_async_no_await,...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_concerns.py
test_detects_mixed_jsx_fetch_transforms
assert
numeric_literal
44
from pathlib import Path import pytest import desloppify.languages.typescript.detectors.concerns as concerns_detector_mod def _root(tmp_path, set_project_root, monkeypatch): """Point PROJECT_ROOT at the tmp directory via RuntimeContext.""" monkeypatch.setattr(concerns_detector_mod, "PROJECT_ROOT", tmp_path) ...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_concerns.py
test_short_file_not_flagged
assert
numeric_literal
43
from pathlib import Path import pytest import desloppify.languages.typescript.detectors.concerns as concerns_detector_mod def _root(tmp_path, set_project_root, monkeypatch): """Point PROJECT_ROOT at the tmp directory via RuntimeContext.""" monkeypatch.setattr(concerns_detector_mod, "PROJECT_ROOT", tmp_path) ...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_deprecated.py
test_finds_deprecated_annotations
assert
numeric_literal
34
from pathlib import Path import pytest import desloppify.languages.typescript.detectors.deprecated as deprecated_detector_mod import desloppify.utils as utils_mod def _root(tmp_path, set_project_root, monkeypatch): """Point PROJECT_ROOT at the tmp directory via RuntimeContext.""" monkeypatch.setattr(utils_mo...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_deprecated.py
test_empty_directory
assert
numeric_literal
26
from pathlib import Path import pytest import desloppify.languages.typescript.detectors.deprecated as deprecated_detector_mod import desloppify.utils as utils_mod def _root(tmp_path, set_project_root, monkeypatch): """Point PROJECT_ROOT at the tmp directory via RuntimeContext.""" monkeypatch.setattr(utils_mo...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_deps.py
test_graph_has_counts
assert
numeric_literal
33
import json from pathlib import Path import pytest import desloppify.languages.typescript.detectors.deps as deps_detector_mod import desloppify.utils as utils_mod from desloppify.engine.detectors import orphaned as orphaned_detector_mod def _root(tmp_path, set_project_root, monkeypatch): """Point PROJECT_ROOT at...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_deps.py
test_no_framework_files_no_change
assert
numeric_literal
33
import json from pathlib import Path import pytest import desloppify.languages.typescript.detectors.deps as deps_detector_mod import desloppify.utils as utils_mod from desloppify.engine.detectors import orphaned as orphaned_detector_mod def _root(tmp_path, set_project_root, monkeypatch): """Point PROJECT_ROOT at...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_exports_detector.py
test_detect_dead_exports_returns_empty_when_knip_unavailable
assert
numeric_literal
19
from __future__ import annotations import json from io import StringIO from pathlib import Path from types import SimpleNamespace from unittest.mock import patch import pytest import desloppify.languages.typescript.detectors.exports as exports_mod def test_detect_dead_exports_returns_empty_when_knip_unavailable(): ...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_exports_detector.py
test_detect_dead_exports_returns_knip_results
assert
numeric_literal
24
from __future__ import annotations import json from io import StringIO from pathlib import Path from types import SimpleNamespace from unittest.mock import patch import pytest import desloppify.languages.typescript.detectors.exports as exports_mod def test_detect_dead_exports_returns_knip_results(): """Returns ...
3
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_exports_detector.py
test_cmd_exports_json_output
assert
numeric_literal
27
from __future__ import annotations import json from io import StringIO from pathlib import Path from types import SimpleNamespace from unittest.mock import patch import pytest import desloppify.languages.typescript.detectors.exports as exports_mod def _make_args(path: str = "/tmp/fake", json_output: bool = False, t...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_exports_detector.py
test_cmd_exports_table_output
assert
numeric_literal
38
from __future__ import annotations import json from io import StringIO from pathlib import Path from types import SimpleNamespace from unittest.mock import patch import pytest import desloppify.languages.typescript.detectors.exports as exports_mod def _make_args(path: str = "/tmp/fake", json_output: bool = False, t...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_extractors.py
test_extract_named_function
assert
numeric_literal
27
import re import textwrap from desloppify.languages.typescript.extractors import ( _extract_ts_params, _parse_param_names, extract_props, extract_ts_functions, normalize_ts_body, tsx_passthrough_pattern, ) def test_extract_named_function(tmp_path): """Named function declaration is extracte...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_extractors.py
test_extract_named_function
assert
numeric_literal
32
import re import textwrap from desloppify.languages.typescript.extractors import ( _extract_ts_params, _parse_param_names, extract_props, extract_ts_functions, normalize_ts_body, tsx_passthrough_pattern, ) def test_extract_named_function(tmp_path): """Named function declaration is extracte...
5
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_extractors.py
test_extract_multiple_functions
assert
numeric_literal
33
import re import textwrap from desloppify.languages.typescript.extractors import ( _extract_ts_params, _parse_param_names, extract_props, extract_ts_functions, normalize_ts_body, tsx_passthrough_pattern, ) def test_extract_multiple_functions(tmp_path): """Multiple functions in one file are...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_extractors.py
test_extract_handles_nested_braces
assert
numeric_literal
31
import re import textwrap from desloppify.languages.typescript.extractors import ( _extract_ts_params, _parse_param_names, extract_props, extract_ts_functions, normalize_ts_body, tsx_passthrough_pattern, ) def test_extract_handles_nested_braces(tmp_path): """Nested braces in function body ...
7
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_facade.py
test_facade_file_detected
assert
numeric_literal
24
from __future__ import annotations from desloppify.languages.typescript.detectors.facade import ( detect_reexport_facades, is_ts_facade, ) def _make_graph_entry(importer_count: int = 0) -> dict: return { "imports": set(), "importers": set(), "import_count": 0, "importer_cou...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_facade.py
test_empty_graph
assert
numeric_literal
22
from __future__ import annotations from desloppify.languages.typescript.detectors.facade import ( detect_reexport_facades, is_ts_facade, ) def _make_graph_entry(importer_count: int = 0) -> dict: return { "imports": set(), "importers": set(), "import_count": 0, "importer_cou...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_fixers.py
test_single_line_parens
assert
numeric_literal
29
import textwrap from desloppify.languages.typescript.fixers import __all__ from desloppify.languages.typescript.fixers.common import ( apply_fixer, collapse_blank_lines, extract_body_between_braces, find_balanced_end, ) from desloppify.languages.typescript.fixers.if_chain import ( _find_if_chain_en...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_fixers.py
test_multiline_parens
assert
numeric_literal
29
import textwrap from desloppify.languages.typescript.fixers import __all__ from desloppify.languages.typescript.fixers.common import ( apply_fixer, collapse_blank_lines, extract_body_between_braces, find_balanced_end, ) from desloppify.languages.typescript.fixers.if_chain import ( _find_if_chain_en...
3
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_fixers.py
test_braces_tracking
assert
numeric_literal
29
import textwrap from desloppify.languages.typescript.fixers import __all__ from desloppify.languages.typescript.fixers.common import ( apply_fixer, collapse_blank_lines, extract_body_between_braces, find_balanced_end, ) from desloppify.languages.typescript.fixers.if_chain import ( _find_if_chain_en...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_fixers.py
test_nested_braces
assert
numeric_literal
29
import textwrap from desloppify.languages.typescript.fixers import __all__ from desloppify.languages.typescript.fixers.common import ( apply_fixer, collapse_blank_lines, extract_body_between_braces, find_balanced_end, ) from desloppify.languages.typescript.fixers.if_chain import ( _find_if_chain_en...
4
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_fixers.py
test_applies_transform_and_writes
assert
numeric_literal
38
import textwrap from desloppify.languages.typescript.fixers import __all__ from desloppify.languages.typescript.fixers.common import ( apply_fixer, collapse_blank_lines, extract_body_between_braces, find_balanced_end, ) from desloppify.languages.typescript.fixers.if_chain import ( _find_if_chain_en...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_init.py
test_config_phases_non_empty
assert
numeric_literal
7
from desloppify.languages.typescript import TypeScriptConfig def test_config_phases_non_empty(): """TypeScriptConfig.phases is a non-empty list.""" cfg = TypeScriptConfig() assert len(cfg.phases) >
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_logs.py
test_detects_tagged_console_log
assert
numeric_literal
23
from pathlib import Path import pytest from desloppify.languages.typescript.detectors.logs import TAG_EXTRACT_RE, detect_logs def _root(set_project_root): """Point PROJECT_ROOT at the tmp directory via RuntimeContext.""" def _write(tmp_path: Path, name: str, content: str) -> Path: p = tmp_path / name p....
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_logs.py
test_no_tag_not_detected
assert
numeric_literal
24
from pathlib import Path import pytest from desloppify.languages.typescript.detectors.logs import TAG_EXTRACT_RE, detect_logs def _root(set_project_root): """Point PROJECT_ROOT at the tmp directory via RuntimeContext.""" def _write(tmp_path: Path, name: str, content: str) -> Path: p = tmp_path / name p....
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_logs.py
test_multiple_tags_in_one_file
assert
numeric_literal
32
from pathlib import Path import pytest from desloppify.languages.typescript.detectors.logs import TAG_EXTRACT_RE, detect_logs def _root(set_project_root): """Point PROJECT_ROOT at the tmp directory via RuntimeContext.""" def _write(tmp_path: Path, name: str, content: str) -> Path: p = tmp_path / name p....
3
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_logs.py
test_returns_file_count
assert
numeric_literal
25
from pathlib import Path import pytest from desloppify.languages.typescript.detectors.logs import TAG_EXTRACT_RE, detect_logs def _root(set_project_root): """Point PROJECT_ROOT at the tmp directory via RuntimeContext.""" def _write(tmp_path: Path, name: str, content: str) -> Path: p = tmp_path / name p....
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_patterns.py
test_detects_pattern_usage
assert
numeric_literal
31
from pathlib import Path import pytest from desloppify.languages.typescript.detectors.patterns import ( PATTERN_FAMILIES, _build_census, detect_pattern_anomalies, ) def _root(set_project_root): """Point PROJECT_ROOT at the tmp directory via RuntimeContext.""" def _write(tmp_path: Path, name: str, co...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_patterns.py
test_fragmentation_detected_with_enough_areas
assert
numeric_literal
46
from pathlib import Path import pytest from desloppify.languages.typescript.detectors.patterns import ( PATTERN_FAMILIES, _build_census, detect_pattern_anomalies, ) def _root(set_project_root): """Point PROJECT_ROOT at the tmp directory via RuntimeContext.""" def _write(tmp_path: Path, name: str, co...
5
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_patterns.py
test_fragmentation_detected_with_enough_areas
assert
numeric_literal
49
from pathlib import Path import pytest from desloppify.languages.typescript.detectors.patterns import ( PATTERN_FAMILIES, _build_census, detect_pattern_anomalies, ) def _root(set_project_root): """Point PROJECT_ROOT at the tmp directory via RuntimeContext.""" def _write(tmp_path: Path, name: str, co...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_patterns.py
test_fragmentation_detected_with_enough_areas
assert
numeric_literal
50
from pathlib import Path import pytest from desloppify.languages.typescript.detectors.patterns import ( PATTERN_FAMILIES, _build_census, detect_pattern_anomalies, ) def _root(set_project_root): """Point PROJECT_ROOT at the tmp directory via RuntimeContext.""" def _write(tmp_path: Path, name: str, co...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_phases.py
test_phase_structural_uses_lang_thresholds
assert
numeric_literal
58
from __future__ import annotations from pathlib import Path from types import SimpleNamespace import desloppify.languages.typescript.phases as phases def test_phase_structural_uses_lang_thresholds(monkeypatch, tmp_path: Path): """Structural phase should honor language-configured thresholds.""" captured: dict...
0
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_phases.py
test_phase_structural_uses_lang_thresholds
assert
numeric_literal
66
from __future__ import annotations from pathlib import Path from types import SimpleNamespace import desloppify.languages.typescript.phases as phases def test_phase_structural_uses_lang_thresholds(monkeypatch, tmp_path: Path): """Structural phase should honor language-configured thresholds.""" captured: dict...
2
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_props.py
test_detects_bloated_props_interface
assert
numeric_literal
28
from pathlib import Path import pytest import desloppify.languages.typescript.detectors.props as props_detector_mod from desloppify.languages.typescript.detectors.props import detect_prop_interface_bloat def _root(tmp_path, set_project_root, monkeypatch): """Point PROJECT_ROOT at the tmp directory via RuntimeCon...
1
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_dict_keys.py
test_finding_keys
assert
variable
39
import textwrap from pathlib import Path from desloppify.languages.python.detectors import dict_keys as dict_keys_mod from desloppify.languages.python.detectors.dict_keys import ( detect_dict_key_flow, detect_schema_drift, ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> Path: ...
f
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_mutable_state.py
test_entry_keys
assert
variable
31
import textwrap from pathlib import Path from desloppify.languages.python.detectors.mutable_state import ( detect_global_mutable_config, ) def _write_py(tmp_path: Path, code: str, filename: str = "mod.py") -> Path: f = tmp_path / filename f.write_text(textwrap.dedent(code)) return tmp_path def _names...
e
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_smells.py
test_entry_keys
assert
variable
39
import textwrap from pathlib import Path from desloppify.languages.python.detectors import smells as smells_mod from desloppify.languages.python.detectors.smells import ( detect_smells, ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> Path: """Write a Python file and return the dir...
e
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_unused.py
test_entry_keys
assert
variable
33
import shutil import textwrap from pathlib import Path import pytest from desloppify.languages.python.detectors.unused import detect_unused pytestmark = pytest.mark.skipif( shutil.which("ruff") is None, reason="ruff not installed" ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> Path...
e
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/tests/core/test_config.py
test_returns_all_keys
assert
variable
24
import json import pytest from desloppify.core.config import ( CONFIG_SCHEMA, _migrate_from_state_files, add_ignore_pattern, config_for_query, default_config, load_config, save_config, set_config_value, set_ignore_metadata, unset_config_value, ) class TestConfigForQuery: d...
q
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/tests/review/test_review_context.py
test_always_present_fields
assert
variable
43
from __future__ import annotations import functools import textwrap from pathlib import Path from unittest.mock import MagicMock, patch import pytest from desloppify.state import empty_state as make_empty_state from desloppify.intelligence.review.context import ( ReviewContext, build_review_context, seri...
d
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/tests/state/test_state.py
test_detail_passed_through
assert
variable
82
import json from pathlib import Path import pytest from desloppify.engine._state import filtering as state_query_mod from desloppify.state import ( MergeScanOptions, empty_state, ensure_state_defaults, upsert_findings, validate_state_invariants, ) from desloppify.state import ( apply_finding_n...
d
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/tests/state/test_state.py
test_structure
assert
variable
80
import json from pathlib import Path import pytest from desloppify.engine._state import filtering as state_query_mod from desloppify.state import ( MergeScanOptions, empty_state, ensure_state_defaults, upsert_findings, validate_state_invariants, ) from desloppify.state import ( apply_finding_n...
s
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/tests/commands/fix/test_fix_options_io.py
test_load_fixer_returns_lang_and_fixer_config
assert
variable
43
from __future__ import annotations import dataclasses from unittest.mock import MagicMock, patch import pytest from desloppify.app.commands.fix.options import _COMMAND_POST_FIX, _load_fixer from desloppify.languages._framework.base.types import FixerConfig, LangConfig def _make_fixer(name: str = "test_fixer", post_...
fc
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/tests/core/test_plan.py
test_returns_string
assert
variable
75
from __future__ import annotations from datetime import date from desloppify.engine.planning.core import ( CONFIDENCE_ORDER, TIER_LABELS, generate_plan_md, get_next_item, get_next_items, ) from desloppify.engine.planning.render import ( _plan_dimension_table, _plan_header, _plan_tier_s...
md
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/tests/detectors/test_complexity.py
test_single_pattern_above_threshold
assert
variable
38
import textwrap from desloppify.engine.detectors.base import ComplexitySignal from desloppify.engine.detectors.complexity import detect_complexity def _write_file(tmp_path, name, content): """Helper: write a file and return its absolute path string.""" p = tmp_path / name p.write_text(textwrap.dedent(cont...
fp
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/csharp/tests/test_csharp_deps_cli.py
test_cmd_deps_single_file_text_output
assert
variable
51
from __future__ import annotations import json from pathlib import Path from types import SimpleNamespace import pytest from desloppify.languages.csharp.deps.cli import cmd_cycles, cmd_deps def _make_args(path="/fake/project", file=None, json_flag=False, top=20, **extra): """Build a SimpleNamespace that looks l...
out
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/python/tests/test_py_smells.py
test_import_time_boundary_mutations_detected
assert
variable
43
import textwrap from pathlib import Path from desloppify.languages.python.detectors import smells as smells_mod from desloppify.languages.python.detectors.smells import ( detect_smells, ) def _write_py(tmp_path: Path, code: str, filename: str = "test_mod.py") -> Path: """Write a Python file and return the dir...
ids
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_exports_detector.py
test_cmd_exports_no_dead_exports
assert
variable
23
from __future__ import annotations import json from io import StringIO from pathlib import Path from types import SimpleNamespace from unittest.mock import patch import pytest import desloppify.languages.typescript.detectors.exports as exports_mod def _make_args(path: str = "/tmp/fake", json_output: bool = False, t...
out
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_exports_detector.py
test_cmd_exports_prints_scanning_message
assert
variable
23
from __future__ import annotations import json from io import StringIO from pathlib import Path from types import SimpleNamespace from unittest.mock import patch import pytest import desloppify.languages.typescript.detectors.exports as exports_mod def _make_args(path: str = "/tmp/fake", json_output: bool = False, t...
err
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/languages/typescript/tests/test_ts_smells.py
test_detect_any_type
assert
variable
25
from pathlib import Path import pytest import desloppify.languages.typescript.detectors.smells as smells_detector_mod from desloppify.languages.typescript.detectors.smells import detect_smells def _root(tmp_path, set_project_root, monkeypatch): """Point PROJECT_ROOT at the tmp directory via RuntimeContext.""" ...
ids
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor
peteromallet/desloppify
d497501b737bf858db5890a8585100b99f8ad565
47
train
train
desloppify/tests/commands/fix/test_cmd_fix_review.py
test_prints_all_reviewed
assert
variable
71
from __future__ import annotations from unittest.mock import MagicMock, patch from desloppify.app.commands.fix.cmd import cmd_fix from desloppify.app.commands.fix.review_flow import _cmd_fix_review from desloppify.app.commands.helpers.runtime import CommandRuntime def _make_prepare_result(total_candidates=3, dims=No...
out
d497501b737bf858db5890a8585100b99f8ad565
47
v2_extractor_at_anchor