I need to understand how to add new Python smell detectors for issues #48 and #49. These…
Private research annotation
Sign in to add a private research label or note.
- User
I need to understand how to add new Python smell detectors for issues #48 and #49. These are:
#48: lost_exception_context — detect
raise X(...)withoutfrominside except blocks (AST-based, Python-only) #49: vestigial_parameter + noop_function + stderr_traceback — detect semantically dead code patterns (AST + regex, Python-only)Please investigate THOROUGHLY:
-
Python smells detector location and structure: Look at
desloppify/lang/python/— find where Python-specific smell detectors are defined. Look at how existing Python smells (likedebug_tag,workaround_tag,star_import_no_all,subprocess_no_timeout,mutable_class_var,unreachable_code,constant_return,regex_backtrack,naive_comment_strip) are implemented. What's the function signature pattern? How are entries appended? -
How detectors are registered: Look at
desloppify/registry.pyto understand DetectorMeta and how new detectors get registered. What fields are needed? -
How detector phases work: Look at
desloppify/lang/python/__init__.pyto see how Python detector phases are invoked. How does the phase function call individual smell detectors? -
Scoring dimensions: Look at
desloppify/scoring.pyto understand which dimension these would map to (likely "Code quality" for smells). -
Narrative integration: Look at
desloppify/narrative/__init__.pyfor DETECTOR_TOOLS — do new detectors need to be added there? -
Existing similar detectors: Check what exists for exception handling (bare_except, broad_except, empty_except, swallowed_error) to understand the pattern and avoid overlap.
Return a detailed summary of:
- The exact files that need modification
- The function signature pattern for new smell detectors
- The registration mechanism
- Any constants/lists that need updating
- How the phase runner invokes detectors
-
Assistant
I'll conduct a thorough investigation of the Python smell detector architecture to understand how to add the new detectors for issues #48 and #49.
Assistant
Now let me look at the Python smells detector to understand the pattern:
Assistant
Let me continue reading the smell detector to see the AST-based patterns:
- User
I need to understand how to add new AST-based Python detectors for issues #50 and #51:
#50: fragile_dict_contract — detect functions accepting
dict/Dict[str, Any]params with heavy bracket access (4+ keys). AST-based, Python-only. #51: global_mutable_config + monkey_patch — detect module-level mutable state modified from functions, and runtime attribute mutation on imported modules. AST-based, Python-only.Please investigate THOROUGHLY:
-
Python detector structure: Look at
desloppify/lang/python/directory — what files exist? How are detectors organized? Are there separate detector files or are they all in one smells file?
-
Assistant
I'll conduct a thorough investigation of the Python detector structure and how to add these new AST-based detectors. Let me start by exploring the codebase systematically.
Assistant
Let me continue reading and also check for existing exception-related detectors:
Assistant
Now let me explore the key files to understand the structure:
Assistant
Now let me check the test file to understand the pattern better and look at the existing exception handling:
Assistant
Perfect! Now let me check the test file to understand what's expected:
Assistant
Now let me verify the DETECTOR_TOOLS constant and understand the narrative integration:
Assistant
Now let me check the smells.py file to understand the existing Python smell detectors:
Assistant
Perfect! Now let me look at how the smells dimension is configured in scoring:
- User
I need to understand how to implement improvements to the test_coverage system for issues #52, #53, and #54:
#52: test_coverage_depth — weight coverage by complexity and detect thin tests #53: wontfix auto-resolution — test_coverage findings in wontfix status not auto-resolved when tests are added #54: scoring model — test health dimension disproportionately punishes frontend codebases, needs LOC awareness
Please investigate VERY THOROUGHLY:
Assistant
Excellent! Now let me check the GitHub issues to understand what the new detectors should do:
Assistant
Let me continue reading base.py and check the existing security detector pattern:
Assistant
I'll conduct a thorough investigation of the test coverage system and related components. Let me start by reading the key files systematically.
Assistant
Let me check if there are any test files related to these new detectors:
Assistant
Let me check the review test to see if there are hints about the new detectors:
Assistant
Now let me check the smells.py detect_smells function and understand how detectors are called:
Assistant
Now let me read the narrative dimensions and scan pipeline:
Assistant
Let me check the git status and recent changes to understand the context:
Assistant
Let me check the issues in the repository:
Assistant
Now let me check the plan.py to see where findings are generated and how complexity data flows:
Assistant
Let me check the existing cross-lang detectors and understand the "global_keyword" smell better:
Assistant
Let me check if there are GitHub issue descriptions or comments in the code:
Assistant
Now let me search for where structural complexity data is stored and how it flows through the system:
Assistant
Let me look at the Python smells detector ending to understand the complete pattern:
Assistant
Now I have enough information! Let me create a comprehensive summary document. Let me also check what the exact structure should be for adding to the registry:
Assistant
Now let me check how the language plugins integrate test_coverage and complexity detection:
Assistant
Now let me check how detectors are registered and check the enums file:
Assistant
Perfect! Now let me create a comprehensive summary document with all the findings. Let me also check if there's any documentation about what #48 and #49 should contain:
Assistant
Now let me look at how a phase runner is structured and how findings flow into scoring:
Assistant
Now let me look at the phase_test_coverage function implementation in base.py:
Assistant
Now let me check the scoring.py file to understand dimensions:
Assistant
Perfect! Now let me check the narrative/headline to see how security is handled in headlines:
Assistant
Perfect. Now let me check if there are any related issues by looking at the git log:
Assistant
Now let me create a comprehensive summary. Let me also check the specific wontfix auto-resolution logic one more time:
Assistant
Let me check how phases are added to the pipeline and understand the full flow:
Assistant
Perfect! Now let me check the base phase_security to understand how to structure a dedicated detector:
Assistant
Perfect! Now I have enough information to provide a comprehensive analysis. Let me create a final summary document.
Assistant
Assistant
Assistant