repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
peteromallet/desloppify | from __future__ import annotations
import importlib
from pathlib import Path
from desloppify.languages import available_langs, get_lang
def _full_langs() -> list[str]:
"""Return only languages with full (non-generic) plugin structure."""
return [lang for lang in available_langs() if get_lang(lang).integratio... | key.lower() | assert | func_call | desloppify/tests/lang/common/test_lang_standardization.py | test_detect_command_keys_use_canonical_snake_case | 101 | null | |
peteromallet/desloppify | from __future__ import annotations
from pathlib import Path
from desloppify.languages.python.detectors.deps import build_dep_graph
from desloppify.languages.python.detectors.uncalled import detect_uncalled_functions
def _graph_entry(*, imports: set[str] | None = None) -> dict:
return {
"imports": imports... | [] | assert | collection | desloppify/languages/python/tests/test_py_uncalled.py | test_called_within_same_file_not_detected | 67 | null | |
peteromallet/desloppify | from __future__ import annotations
import json
from pathlib import Path
from types import SimpleNamespace
from unittest.mock import patch
import desloppify.languages.typescript.detectors.exports as exports_mod
def _make_args(path: str = "/tmp/fake", json_output: bool = False, top: int = 10):
return SimpleNamespa... | "2" | assert | string_literal | desloppify/languages/typescript/tests/test_ts_exports_detector.py | test_cmd_exports_table_output | 98 | null | |
peteromallet/desloppify | from __future__ import annotations
import json
from pathlib import Path
from types import SimpleNamespace
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 like argparse ou... | 3 | assert | numeric_literal | desloppify/languages/csharp/tests/test_csharp_deps_cli.py | test_cmd_deps_overview_respects_top_limit | 173 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/typescript/tests/test_ts_logs.py | test_no_tag_not_detected | TestDetectLogs | 62 | null |
peteromallet/desloppify | 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... | [] | assert | collection | desloppify/languages/typescript/tests/test_ts_facade.py | test_non_facade_file_not_detected | TestDetectReexportFacades | 75 | null |
peteromallet/desloppify | from pathlib import Path
import pytest
import desloppify.languages.typescript.detectors.unused as ts_unused_mod
from desloppify.languages.typescript.detectors.unused import (
TS6133_RE,
TS6192_RE,
_categorize_unused,
detect_unused,
)
def _root(tmp_path, set_project_root, monkeypatch):
"""Point PR... | "15" | assert | string_literal | desloppify/languages/typescript/tests/test_ts_unused.py | test_ts6133_matches | TestErrorRegex | 53 | null |
peteromallet/desloppify | from pathlib import Path
import pytest
import desloppify.languages.typescript.detectors.unused as ts_unused_mod
from desloppify.languages.typescript.detectors.unused import (
TS6133_RE,
TS6192_RE,
_categorize_unused,
detect_unused,
)
def _root(tmp_path, set_project_root, monkeypatch):
"""Point PR... | "7" | assert | string_literal | desloppify/languages/typescript/tests/test_ts_unused.py | test_ts6133_matches | TestErrorRegex | 54 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/typescript/tests/test_ts_fixers.py | test_nested_braces | TestCommonFindBalancedEnd | 88 | null |
peteromallet/desloppify | from __future__ import annotations
from desloppify.intelligence.review.dimensions import (
DIMENSION_PROMPTS,
DIMENSIONS,
is_custom_dimension,
is_known_dimension,
normalize_dimension_name,
)
def test_normalize_empty_string():
assert normalize_dimension_name("") == | "" | assert | string_literal | desloppify/tests/review/test_dimensions_init.py | test_normalize_empty_string | 45 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/typescript/tests/test_ts_facade.py | test_facade_file_detected | TestDetectReexportFacades | 65 | null |
peteromallet/desloppify | 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_below_threshold_returns_none(self):
... | None | assert | none_literal | desloppify/languages/python/tests/test_py_complexity.py | test_below_threshold_returns_none | TestComputeMaxParams | 19 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/typescript/tests/test_ts_patterns.py | test_fragmentation_detected_with_enough_areas | TestDetectPatternAnomalies | 126 | null |
peteromallet/desloppify | from __future__ import annotations
import json
from pathlib import Path
from types import SimpleNamespace
from unittest.mock import patch
import desloppify.languages.typescript.detectors.exports as exports_mod
def test_detect_dead_exports_returns_knip_results():
"""Returns entries and correct count when Knip fin... | 3 | assert | numeric_literal | desloppify/languages/typescript/tests/test_ts_exports_detector.py | test_detect_dead_exports_returns_knip_results | 33 | null | |
peteromallet/desloppify | from __future__ import annotations
import json
import logging
import desloppify.core.fallbacks as fallbacks_mod
import desloppify.core.query as query_mod
def test_write_query_injects_config_payload(tmp_path, monkeypatch):
monkeypatch.setattr(query_mod, "load_config", lambda: {"target_strict_score": 97})
monk... | True | assert | bool_literal | desloppify/tests/core/test_core_direct.py | test_write_query_injects_config_payload | 27 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_facade.py | test_facade_file_detected | TestDetectReexportFacades | 79 | null |
peteromallet/desloppify | from __future__ import annotations
import desloppify.languages.typescript.move as ts_move
class TestMoveTsHelpers:
def test_strip_ts_ext(self):
assert ts_move._strip_ts_ext("foo.ts") == | "foo" | assert | string_literal | desloppify/languages/typescript/tests/test_ts_move.py | test_strip_ts_ext | TestMoveTsHelpers | 15 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_private_imports.py | test_detects_cross_module_private_import | 38 | null | |
peteromallet/desloppify | from __future__ import annotations
from pathlib import Path
from types import SimpleNamespace
import desloppify.app.commands.scan.scan_helpers as scan_helpers_mod
def test_formatting_helpers():
hidden = scan_helpers_mod._format_hidden_by_detector({"smells": 3, "dupes": 1})
assert "smells: +3" in hidden
a... | "red" | assert | string_literal | desloppify/tests/scan/test_scan_helpers_direct.py | test_formatting_helpers | 34 | null | |
peteromallet/desloppify | from desloppify.app.commands.status_cmd import (
cmd_status,
show_dimension_table,
show_focus_suggestion,
show_ignore_summary,
show_structural_areas,
show_subjective_followup,
)
from desloppify.app.commands.status_parts.summary import (
print_open_scope_breakdown,
score_summary_lines,
)
... | "" | assert | string_literal | desloppify/tests/commands/test_cmd_status.py | test_show_focus_suggestion_empty_dims_no_crash | TestStatusModuleSanity | 38 | null |
peteromallet/desloppify | 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... | frag[0] | assert | complex_expr | desloppify/languages/typescript/tests/test_ts_patterns.py | test_fragmentation_detected_with_enough_areas | TestDetectPatternAnomalies | 127 | null |
peteromallet/desloppify | import json
from types import SimpleNamespace
from unittest.mock import MagicMock, patch
from desloppify.languages._framework.commands_base import (
make_cmd_complexity,
make_cmd_facade,
make_cmd_large,
make_cmd_naming,
make_cmd_passthrough,
make_cmd_single_use,
make_cmd_smells,
)
def _mak... | captured.out | assert | complex_expr | desloppify/tests/commands/test_commands_base.py | test_no_entries_prints_green | TestMakeCmdFacade | 221 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/typescript/tests/test_ts_extractors.py | test_extract_multiple_functions | 219 | null | |
peteromallet/desloppify | import desloppify.core.config as config_mod
from desloppify.app.commands.helpers.runtime import CommandRuntime
from desloppify.app.commands.zone_cmd import (
_zone_clear,
_zone_set,
_zone_show,
cmd_zone,
)
class TestCmdZoneDispatch:
def test_unknown_action_prints_usage(self, capsys):
impor... | err | assert | variable | desloppify/tests/commands/test_cmd_zone.py | test_unknown_action_prints_usage | TestCmdZoneDispatch | 102 | null |
peteromallet/desloppify | 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."""
... | [] | assert | collection | desloppify/languages/typescript/tests/test_ts_smells.py | test_clean_file_no_smells | 477 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_dict_keys.py | test_one_edit | TestLevenshtein | 40 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_responsibility_cohesion.py | test_detects_disconnected_dumping_ground_module | 43 | null | |
peteromallet/desloppify | from __future__ import annotations
import json
from pathlib import Path
from types import SimpleNamespace
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 like argparse ou... | out | assert | variable | desloppify/languages/csharp/tests/test_csharp_deps_cli.py | test_cmd_deps_single_file_text_output | 61 | null | |
peteromallet/desloppify | from __future__ import annotations
from pathlib import Path
from desloppify.languages.python.detectors.deps import build_dep_graph
from desloppify.languages.python.detectors.uncalled import detect_uncalled_functions
def _graph_entry(*, imports: set[str] | None = None) -> dict:
return {
"imports": imports... | 1 | assert | numeric_literal | desloppify/languages/python/tests/test_py_uncalled.py | test_detects_uncalled_private_function | 44 | null | |
peteromallet/desloppify | from __future__ import annotations
from pathlib import Path
from types import SimpleNamespace
from desloppify.intelligence.review._prepare.issue_history import (
ReviewHistoryOptions,
build_batch_issue_focus,
build_issue_history_context,
)
from desloppify.intelligence.review.prepare import (
HolisticR... | "" | assert | string_literal | desloppify/tests/review/test_issue_history_context.py | test_issue_history_strips_auto_resolve_notes | 128 | null | |
peteromallet/desloppify | from __future__ import annotations
from desloppify.engine.policy.zones import FileZoneMap, Zone
from desloppify.hook_registry import get_lang_hook
from desloppify.languages import get_lang
def test_test_coverage_hooks_registered():
assert get_lang_hook("go", "test_coverage") is not | None | assert | none_literal | desloppify/languages/go/tests/test_init.py | test_test_coverage_hooks_registered | 48 | null | |
peteromallet/desloppify | from __future__ import annotations
from pathlib import Path
from types import SimpleNamespace
import desloppify.languages.typescript.phases as phases
from desloppify.engine.detectors.coupling import CouplingEdgeCounts
def test_phase_structural_uses_lang_thresholds(monkeypatch, tmp_path: Path):
"""Structural phas... | [] | assert | collection | desloppify/languages/typescript/tests/test_ts_phases.py | test_phase_structural_uses_lang_thresholds | 74 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_dict_keys.py | test_identical | TestLevenshtein | 37 | null |
peteromallet/desloppify | from types import SimpleNamespace
import pytest
import desloppify.app.commands.scan.scan as scan_cmd_mod
import desloppify.app.commands.scan.scan_artifacts as scan_artifacts_mod
import desloppify.intelligence.narrative as narrative_mod
import desloppify.languages as lang_mod
from desloppify.app.commands.scan.scan imp... | out | assert | variable | desloppify/tests/commands/test_cmd_scan.py | test_cmd_scan_prints_coverage_preflight_warning | TestCmdScanExecution | 210 | null |
peteromallet/desloppify | from __future__ import annotations
from types import SimpleNamespace
from desloppify.app.commands.helpers.rendering import (
print_agent_plan,
print_ranked_actions,
print_replacement_groups,
)
from desloppify.app.commands.helpers.state import require_completed_scan, state_path
from desloppify.app.commands... | out | assert | variable | desloppify/tests/commands/test_helpers.py | test_print_agent_plan_numbered_steps | 28 | null | |
peteromallet/desloppify | 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 | assert | variable | desloppify/languages/python/tests/test_py_smells.py | test_entry_keys | TestOutputStructure | 595 | null |
peteromallet/desloppify | import pytest
import desloppify.app.commands.fix.apply_flow as fix_apply_mod
from desloppify.app.commands.fix.apply_flow import (
_SKIP_REASON_LABELS,
_print_fix_retro,
_print_fix_summary,
_resolve_fixer_results,
)
from desloppify.app.commands.fix.cmd import (
cmd_fix,
)
from desloppify.languages._... | [] | assert | collection | desloppify/tests/commands/test_cmd_fix.py | test_skips_already_fixed | TestResolveFixerResults | 140 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_extractors.py | test_class_with_init_attributes | TestExtractPyClasses | 279 | null |
peteromallet/desloppify | from __future__ import annotations
from pathlib import Path
from desloppify.languages.python.detectors.deps import build_dep_graph
from desloppify.languages.python.detectors.uncalled import detect_uncalled_functions
def _graph_entry(*, imports: set[str] | None = None) -> dict:
return {
"imports": imports... | 4 | assert | numeric_literal | desloppify/languages/python/tests/test_py_uncalled.py | test_detects_uncalled_private_function | 46 | null | |
peteromallet/desloppify | from __future__ import annotations
import json
from pathlib import Path
from types import SimpleNamespace
from unittest.mock import patch
import desloppify.languages.typescript.detectors.exports as exports_mod
def _make_args(path: str = "/tmp/fake", json_output: bool = False, top: int = 10):
return SimpleNamespa... | 1 | assert | numeric_literal | desloppify/languages/typescript/tests/test_ts_exports_detector.py | test_cmd_exports_json_output | 61 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/typescript/tests/test_ts_props.py | test_detects_bloated_props_interface | TestDetectPropInterfaceBloat | 36 | null |
peteromallet/desloppify | import json
from pathlib import Path
import pytest
from desloppify.engine._state import filtering as state_query_mod
from desloppify.state import (
MergeScanOptions,
apply_finding_noise_budget,
empty_state,
ensure_state_defaults,
load_state,
make_finding,
resolve_finding_noise_budget,
... | d | assert | variable | desloppify/tests/state/test_state.py | test_detail_passed_through | TestMakeFinding | 228 | null |
peteromallet/desloppify | from __future__ import annotations
from desloppify.engine.policy.zones import FileZoneMap, Zone
from desloppify.hook_registry import get_lang_hook
from desloppify.languages import get_lang
def test_go_vendor_classified_as_vendor():
cfg = get_lang("go")
zone_map = FileZoneMap(
["pkg/foo.go", "vendor/li... | Zone.VENDOR | assert | complex_expr | desloppify/languages/go/tests/test_init.py | test_go_vendor_classified_as_vendor | 69 | null | |
peteromallet/desloppify | from __future__ import annotations
import desloppify.app.cli_support.parser as cli_parser
import desloppify.app.cli_support.parser_groups as cli_parser_groups
import desloppify.app.commands.config_cmd as config_cmd
import desloppify.app.commands.move.move_directory as move_directory
import desloppify.app.commands.move... | [] | assert | collection | desloppify/tests/commands/test_direct_coverage_modules.py | test_smoke_lang_plugins | 220 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_mutable_state.py | test_upper_case_constant | TestNotFlagged | 105 | null |
peteromallet/desloppify | from __future__ import annotations
import inspect
from types import SimpleNamespace
import desloppify.intelligence.narrative as narrative_mod
from desloppify.app.commands import next as next_mod
from desloppify.app.commands.helpers.runtime import CommandRuntime
from desloppify.app.commands.next import _low_subjective... | out | assert | variable | desloppify/tests/commands/test_cmd_next.py | test_requires_prior_scan | TestCmdNextOutput | 81 | null |
peteromallet/desloppify | import json
import shutil
from collections import Counter
from pathlib import Path
from types import SimpleNamespace
from desloppify.engine.planning.core import generate_findings
from desloppify.engine.planning.scan import PlanScanOptions
from desloppify.languages._framework.runtime import LangRunOverrides, make_lang_... | "low" | assert | string_literal | desloppify/tests/lang/csharp/test_csharp_scan.py | test_csharp_actionability_gate_downgrades_without_corroboration | 145 | null | |
peteromallet/desloppify | import inspect
import pytest
import desloppify.app.commands.resolve.apply as resolve_apply_mod
import desloppify.app.commands.resolve.cmd as resolve_mod
import desloppify.app.commands.resolve.selection as resolve_selection_mod
import desloppify.cli as cli_mod
import desloppify.intelligence.narrative as narrative_mod
... | out | assert | variable | desloppify/tests/commands/test_cmd_resolve.py | test_resolve_no_matches | TestCmdResolve | 132 | null |
peteromallet/desloppify | from desloppify.app.commands.status_cmd import (
cmd_status,
show_dimension_table,
show_focus_suggestion,
show_ignore_summary,
show_structural_areas,
show_subjective_followup,
)
from desloppify.app.commands.status_parts.summary import (
print_open_scope_breakdown,
score_summary_lines,
)
... | out | assert | variable | desloppify/tests/commands/test_cmd_status.py | test_show_dimension_table_with_empty_dims | TestStatusModuleSanity | 31 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_complexity.py | test_deep_nesting_detected | TestComputeNestingDepth | 100 | null |
peteromallet/desloppify | from __future__ import annotations
from pathlib import Path
from types import SimpleNamespace
import desloppify.languages.typescript.phases as phases
from desloppify.engine.detectors.coupling import CouplingEdgeCounts
def test_phase_coupling_passes_orphaned_options(monkeypatch, tmp_path: Path):
captured: dict[st... | {} | assert | collection | desloppify/languages/typescript/tests/test_ts_phases.py | test_phase_coupling_passes_orphaned_options | 166 | null | |
peteromallet/desloppify | from __future__ import annotations
import inspect
from types import SimpleNamespace
import desloppify.intelligence.narrative as narrative_mod
from desloppify.app.commands import next as next_mod
from desloppify.app.commands.helpers.runtime import CommandRuntime
from desloppify.app.commands.next import _low_subjective... | [] | assert | collection | desloppify/tests/commands/test_cmd_next.py | test_tier_navigator_always_printed | TestCmdNextOutput | 119 | null |
peteromallet/desloppify | from __future__ import annotations
from pathlib import Path
import desloppify.languages.python.move as py_move
class TestMovePyHelpers:
def test_path_to_py_module(self):
root = Path("/project")
assert py_move._path_to_py_module("/project/foo/bar.py", root) == "foo.bar"
assert py_move._pa... | "foo" | assert | string_literal | desloppify/languages/python/tests/test_py_move.py | test_path_to_py_module | TestMovePyHelpers | 19 | null |
peteromallet/desloppify | 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... | sorted(ranks) | assert | func_call | desloppify/languages/python/tests/test_py_smells.py | test_severity_sort_order | TestOutputStructure | 616 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_unused.py | test_no_unused_in_clean_code | TestCleanCode | 238 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_complexity.py | test_2_space_indent | TestDetectIndentUnit | 171 | null |
peteromallet/desloppify | from __future__ import annotations
from pathlib import Path
from types import SimpleNamespace
import desloppify.engine._state.filtering as filtering_mod
import desloppify.engine.planning.common as plan_common_mod
import desloppify.engine.planning.scan as plan_scan_mod
import desloppify.engine.planning.select as plan_... | True | assert | bool_literal | desloppify/tests/core/test_plan_modules_direct.py | test_is_subjective_phase_checks_label_and_run_name | 37 | null | |
peteromallet/desloppify | from __future__ import annotations
import pytest
from desloppify.intelligence.narrative.action_engine import (
_fixer_has_applicable_findings,
)
from desloppify.intelligence.narrative.action_engine import (
compute_actions as _compute_actions,
)
from desloppify.intelligence.narrative.action_models import Acti... | True | assert | bool_literal | desloppify/tests/core/test_narrative_actions.py | test_non_smells_detector_always_applicable | TestFixerHasApplicableFindings | 141 | null |
peteromallet/desloppify | from __future__ import annotations
import functools
import textwrap
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from desloppify.intelligence.review.context import (
ReviewContext,
build_review_context,
serialize_context,
)
from desloppify.intelligence.review.context_... | d | assert | variable | desloppify/tests/review/test_review_context.py | test_always_present_fields | TestSerializeContext | 1,058 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/go/tests/test_extractors.py | test_extract_simple_function | 39 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_smells.py | test_clean_file | TestCleanCode | 510 | null |
peteromallet/desloppify | import json
from pathlib import Path
import pytest
from desloppify.engine._state import filtering as state_query_mod
from desloppify.state import (
MergeScanOptions,
apply_finding_noise_budget,
empty_state,
ensure_state_defaults,
load_state,
make_finding,
resolve_finding_noise_budget,
... | s | assert | variable | desloppify/tests/state/test_state.py | test_structure | TestEmptyState | 256 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_deps.py | test_ignores_non_string_args | TestDynamicImportFinder | 269 | null |
peteromallet/desloppify | from __future__ import annotations
from desloppify.engine.policy.zones import FileZoneMap, Zone
from desloppify.hook_registry import get_lang_hook
from desloppify.languages import get_lang
def test_config_name():
cfg = get_lang("go")
assert cfg.name == | "go" | assert | string_literal | desloppify/languages/go/tests/test_init.py | test_config_name | 15 | null | |
peteromallet/desloppify | 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":... | None | assert | none_literal | desloppify/languages/python/tests/test_py_facade.py | test_pure_reexport | TestIsPyFacade | 25 | null |
peteromallet/desloppify | from pathlib import Path
from types import SimpleNamespace
import desloppify.app.commands.move.move as move_mod
from desloppify.app.commands.move.move import _cmd_move_dir
from desloppify.app.commands.move.move_language import (
detect_lang_from_dir,
detect_lang_from_ext,
resolve_lang_for_file_move,
re... | [] | assert | collection | desloppify/tests/commands/test_cmd_move.py | test_empty_list | TestDedup | 39 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_coupling_contracts.py | test_detects_implicit_mixin_contract_dependencies | 31 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/typescript/tests/test_ts_concerns.py | test_short_file_not_flagged | TestDetectMixedConcerns | 74 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_responsibility_cohesion.py | test_detects_disconnected_dumping_ground_module | 44 | null | |
peteromallet/desloppify | import shutil
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_instantiation(self):
config = PythonConfig(... | None | assert | none_literal | desloppify/languages/python/tests/test_py_init.py | test_instantiation | TestPythonConfig | 19 | null |
peteromallet/desloppify | from types import SimpleNamespace
import pytest
import desloppify.app.commands.scan.scan as scan_cmd_mod
import desloppify.app.commands.scan.scan_artifacts as scan_artifacts_mod
import desloppify.intelligence.narrative as narrative_mod
import desloppify.languages as lang_mod
from desloppify.app.commands.scan.scan imp... | [] | assert | collection | desloppify/tests/commands/test_cmd_scan.py | test_empty_exclusions | TestAuditExcludedDirs | 446 | null |
peteromallet/desloppify | 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,... | [] | assert | collection | desloppify/languages/python/tests/test_py_private_imports.py | test_skips_test_file_private_import | 54 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_deps.py | test_single_file_no_imports | TestBasicGraph | 45 | null |
peteromallet/desloppify | from __future__ import annotations
from pathlib import Path
import desloppify.languages.python.move as py_move
class TestMovePyHelpers:
def test_compute_py_relative_import(self):
result = py_move._compute_py_relative_import(
"/project/pkg/a.py", "/project/pkg/b.py"
)
assert ... | ".b" | assert | string_literal | desloppify/languages/python/tests/test_py_move.py | test_compute_py_relative_import | TestMovePyHelpers | 48 | null |
peteromallet/desloppify | from __future__ import annotations
import json
from pathlib import Path
from types import SimpleNamespace
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 like argparse ou... | 0 | assert | numeric_literal | desloppify/languages/csharp/tests/test_csharp_deps_cli.py | test_cmd_deps_single_file_json_output | 90 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_dict_keys.py | test_empty | TestLevenshtein | 43 | null |
peteromallet/desloppify | 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_arrow_function(tmp_path):
"""Arrow function assigned to const is ex... | "add" | assert | string_literal | desloppify/languages/typescript/tests/test_ts_extractors.py | test_extract_arrow_function | 163 | null | |
peteromallet/desloppify | 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... | {} | assert | collection | desloppify/languages/typescript/tests/test_ts_patterns.py | test_empty_directory | TestBuildCensus | 55 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/typescript/tests/test_ts_fixers.py | test_multiline_parens | TestCommonFindBalancedEnd | 78 | null |
peteromallet/desloppify | 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... | "Map" | assert | string_literal | desloppify/languages/go/tests/test_extractors.py | test_extract_generics | 79 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_responsibility_cohesion.py | test_ignores_small_files_even_if_disconnected | 79 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_private_imports.py | test_detects_cross_module_private_import | 39 | null | |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/typescript/tests/test_ts_logs.py | test_returns_file_count | TestDetectLogs | 93 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/go/tests/test_extractors.py | test_extract_simple_function | 37 | null | |
peteromallet/desloppify | from __future__ import annotations
import desloppify.app.commands.dev_scaffold_templates as templates_mod
def test_build_scaffold_files_contains_expected_paths():
files = templates_mod.build_scaffold_files(
lang_name="ruby",
class_name="RubyConfig",
extensions=[".rb"],
markers=["Ge... | "" | assert | string_literal | desloppify/tests/commands/dev/test_dev_scaffold_templates_direct.py | test_build_scaffold_files_contains_expected_paths | 17 | null | |
peteromallet/desloppify | from __future__ import annotations
import json
from pathlib import Path
from types import SimpleNamespace
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 like argparse ou... | 5 | assert | numeric_literal | desloppify/languages/csharp/tests/test_csharp_deps_cli.py | test_cmd_deps_single_file_json_output | 91 | null | |
peteromallet/desloppify | from desloppify.languages.typescript import TypeScriptConfig
def test_config_fixers_dict():
"""TypeScriptConfig.fixers is a dict with at least 'unused-imports'."""
cfg = TypeScriptConfig()
assert isinstance(cfg.fixers, dict)
assert "unused-imports" in | cfg.fixers | assert | complex_expr | desloppify/languages/typescript/tests/test_ts_init.py | test_config_fixers_dict | 57 | null | |
peteromallet/desloppify | import inspect
import desloppify.engine.planning.core as plan_mod
from desloppify.app.commands import plan_cmd
from desloppify.app.commands.plan_cmd import cmd_plan_output
class TestCmdPlanOutput:
def test_no_scan_prints_warning(self, monkeypatch, capsys):
"""When no scan has been performed, should print... | out | assert | variable | desloppify/tests/commands/test_cmd_plan.py | test_no_scan_prints_warning | TestCmdPlanOutput | 59 | null |
peteromallet/desloppify | 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... | set() | assert | func_call | desloppify/languages/typescript/tests/test_ts_deps.py | test_empty_directory | TestBuildDynamicImportTargets | 262 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/python/tests/test_py_deps.py | test_importer_count | TestGraphStructure | 150 | null |
peteromallet/desloppify | from pathlib import Path
import pytest
import desloppify.languages.typescript.detectors.react as react_detector_mod
from desloppify.languages.typescript.detectors.react import (
_count_return_fields,
detect_context_nesting,
detect_hook_return_bloat,
detect_state_sync,
)
def _root(tmp_path, set_projec... | 1 | assert | numeric_literal | desloppify/languages/typescript/tests/test_ts_react.py | test_detects_useeffect_only_calling_setters | TestDetectStateSync | 51 | null |
peteromallet/desloppify | 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 | assert | numeric_literal | desloppify/languages/typescript/tests/test_ts_extractors.py | test_extract_handles_nested_braces | 247 | null | |
peteromallet/desloppify | 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... | None | assert | none_literal | desloppify/languages/typescript/tests/test_ts_deprecated.py | test_returns_none_for_unresolvable | TestExtractDeprecatedSymbol | 124 | null |
peteromallet/desloppify | 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 | assert | variable | desloppify/tests/core/test_plan.py | test_returns_string | TestGeneratePlanMd | 335 | null |
peteromallet/desloppify | from __future__ import annotations
import json
from pathlib import Path
from types import SimpleNamespace
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 like argparse ou... | 1 | assert | numeric_literal | desloppify/languages/csharp/tests/test_csharp_deps_cli.py | test_cmd_deps_overview_json_output | 151 | null | |
peteromallet/desloppify | import shutil
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_scan_coverage_prerequisites_when_bandit_present(se... | [] | assert | collection | desloppify/languages/python/tests/test_py_init.py | test_scan_coverage_prerequisites_when_bandit_present | TestPythonConfig | 91 | null |
peteromallet/desloppify | 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... | "" | assert | string_literal | desloppify/languages/python/tests/test_py_extractors.py | test_body_hash_populated | TestExtractPyFunctions | 134 | null |
peteromallet/desloppify | from types import SimpleNamespace
import pytest
import desloppify.app.commands.scan.scan as scan_cmd_mod
import desloppify.app.commands.scan.scan_artifacts as scan_artifacts_mod
import desloppify.intelligence.narrative as narrative_mod
import desloppify.languages as lang_mod
from desloppify.app.commands.scan.scan imp... | "" | assert | string_literal | desloppify/tests/commands/test_cmd_scan.py | test_zero_delta | TestFormatDelta | 299 | null |
peteromallet/desloppify | from __future__ import annotations
import json
from pathlib import Path
from types import SimpleNamespace
from unittest.mock import patch
import desloppify.languages.typescript.detectors.exports as exports_mod
def _make_args(path: str = "/tmp/fake", json_output: bool = False, top: int = 10):
return SimpleNamespa... | rows[0][2] | assert | complex_expr | desloppify/languages/typescript/tests/test_ts_exports_detector.py | test_cmd_exports_table_output | 99 | null | |
peteromallet/desloppify | 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_parse_param_names_empty():
"""Empty string yields no params."""
assert... | [] | assert | collection | desloppify/languages/typescript/tests/test_ts_extractors.py | test_parse_param_names_empty | 51 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.